* Home :: Get a random password :: Get a multi-word password :: What is my IP? (v4 | v6)
* My projects

Titlu

Tags: scsi,linux,howto


Sometimes, especially on virtual machines, we need to add or resize a new drive without rebooting.

More often than not, depending on the distribution and virtualisation platform in use, this happens automatically and we can easily notice a new drive popped up or its size has changed.
Usually this shows up in `dmesg`.
It is not always plain sailing, however this can be easily rectified manually:

If you've added a new disk, but it hasn't showed up in `dmesg` or `fdisk -l`, then try to scan the SCSI bus (watch out, as there could be multiple, eg host0, host1 etc).


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


If you have resized a disk in the hypervisor, but the guest has not picked up this change, try to rescan it. Obviously replace "sdb" with the drive in question:

echo "1" > /sys/class/block/sdb/device/rescan


Good luck!
(c)The Nux(tm) ;-)

No CSS, no Javascript, no some HTML.
No ads, no tracking, no cookies.