Re-scan hard drives after a resize without rebooting

We can rescan hard drives after resize a virtual disk for a virtual machine without having to reboot the virtual machine. To do that; trigger a re-sync of the kernel for all the SCSI devices unless you know exactly which one it is connected to;

ls /sys/class/scsi_device/
echo 1 > /sys/class/scsi_device/0\:0\:0\:0/device/rescan
echo 1 > /sys/class/scsi_device/2\:0\:0\:0/device/rescan
echo 1 > /sys/class/scsi_device/2\:0\:1\:0/device/rescan

Bir cevap yazın