Scan newly added disks or rescan resized disk in Linux VM
How do we rescan for new disks after adding a VMDK to a Linux Virtual Machine?
First, list all disks available in the VM
sudo fdisk -l
Running the following command will scan for new scsi disks.
sudo echo "- - -" > /sys/class/scsi_host/host0/scan
sudo echo "- - -" > /sys/class/scsi_host/hostN/scan
Run this command for all scsi_hosts.
Well, if you have increased the size of an existing disk, then the above procedure will not identify that. In that case, you have to first identify the disk which has been resized. And then go to the disk directory. And then enable rescan for that drive
echo '1' > device/rescan