Jumat, 17 Januari 2025

Existed HDD expend size (extand) On ESXi

Existed HDD expend size (extand) On ESXi

1. modify HDD Size

    On OS

2. check host#

    # ls /sys/class/scsi_host

3. scan host#

    ll /sys/class/scsi_disk

    echo "- - -" > /sys/class/scsi_host/host#/scan

    ls /sys/class/scsi_disk

    echo "1" > /sys/class/scsi_disk/0\:0\:1\:0/device/rescan ;
    scsi lihat di VM

4. check target HDD

    fdisk -l

5. resize

    resize2fs /dev/sd? ( or  resize4fs ) 

    resize2fs -f ( force /paksa )

6. mount -a 

PERLUAS RUANG DI LINUX SYSTEM

Add HDD to GuestVM On OS

01. Check host#

      # ls /sys/class/scsi_host

02. Scan host

      echo "- - -" > /sys/class/scsi_host/host1/scan

      echo "- - -" > /sys/class/scsi_host/host2/scan

      echo "- - -" > /sys/class/scsi_host/host3/scan

03. fdisk : check new HDD ID, 

      ex : /dev/sdb, /dev/sdc

      fdisk -l

04. mkfs: format HDD

      mkfs -t ext4 /dev/sd?

05. mount to target

      mount /dev/sd? /target_folder_name

06. (For Oracle) modify folder owder

      chmoe /target_folder_name

07. check hdd ID

      blkid 

08. Modify /etc/fstab : Auto mount HDD when system on

      mount -a

09. Check Disk

      df -h 



SCAN DISK ON LINUX UBUNTU

root@pcilibrenms-p:~# ll /sys/class/scsi_disk

total 0

drwxr-xr-x 2 root root 0 Jan 4 12:03 ./

drwxr-xr-x 74 root root 0 Jan 4 12:03 ../

lrwxrwxrwx 1 root root 0 Jan 4 12:03 2:0:0:0 -> ../../devices/pci0000:00/0000:00:10.0/host2/target2:0:0/2:0:0:0/scsi_disk/2:0:0:0/

root@pcilibrenms-p:~# echo "- - -" > /sys/class/scsi_host/host0/scan

root@pcilibrenms-p:~# echo "- - -" > /sys/class/scsi_host/host1/scan

root@pcilibrenms-p:~# echo "- - -" > /sys/class/scsi_host/host2/scan

root@pcilibrenms-p:~# ll /sys/class/scsi_disk

total 0

drwxr-xr-x 2 root root 0 Jan 4 12:03 ./

drwxr-xr-x 74 root root 0 Jan 4 12:03 ../

lrwxrwxrwx 1 root root 0 Jan 4 12:03 2:0:0:0 -> ../../devices/pci0000:00/0000:00:10.0/host2/target2:0:0/2:0:0:0/scsi_disk/2:0:0:0/

lrwxrwxrwx 1 root root 0 Jan 16 15:02 2:0:1:0 -> ../../devices/pci0000:00/0000:00:10.0/host2/target2:0:1/2:0:1:0/scsi_disk/2:0:1:0/

root@pcilibrenms-p:~# echo "1" > /sys/class/scsi_disk/2\:0\:1\:0/device/rescan

root@pcilibrenms-p:~# df -h

Filesystem Size Used Avail Use% Mounted on

tmpfs 3.2G 1.4M 3.2G 1% /run

/dev/mapper/ubuntu--vg-ubuntu--lv 245G 206G 28G 89% /

tmpfs 16G 0 16G 0% /dev/shm

tmpfs 5.0M 0 5.0M 0% /run/lock

/dev/sda2 974M 242M 665M 27% /boot

tmpfs 3.2G 4.0K 3.2G 1% /run/user/1003

root@pcilibrenms-p:~# echo "1" > /sys/class/scsi_disk/2\:0\:1\:0/device/rescan

root@pcilibrenms-p:~# fdisk -l