Sunday, April 18, 2010

Adding disk to Linux VM without reboot

Have you rebooted your Linux VM after adding storage to it so changes will take effect? No more !
Here is a sweet way to re-scan the SCSI bus "on the fly":

1.Check your current disk status with: fdisk -l

2.Add the wanted disk via VMware GUI

3.To rescan the bus:
root@chronos# echo "- - -" > /sys/class/scsi_host/host#/scan


Replace host# with actual value such as host0. You can find scsi_host value using the following command:
root@chronos# ls /sys/class/scsi_host
host0
So the command will look like this:
root@chronos# echo "- - -" > /sys/class/scsi_host/host0/scan


No comments: