Skip to content

Instantly share code, notes, and snippets.

@sinewalker
Created August 28, 2018 23:48
Show Gist options
  • Save sinewalker/e36b170d28ffe6854fc459c4410a4a8e to your computer and use it in GitHub Desktop.
Save sinewalker/e36b170d28ffe6854fc459c4410a4a8e to your computer and use it in GitHub Desktop.
Rescan SCSI devices after changing on VM Host

Rescanning a Linux SCSI device after it is changed on a VM Host

Sometimes when you change the logical drive of a VM from the Host, the device size is not reflected in the Guest. So attempts to use the extra space with fdisk or the NVM tools will not "see" the extra disc.

This is because the Linux kernel doesn't notice it, because it's not looking. Linux usually only scans this at boot time. But you probably can't reboot a server if it's live, so what do you do?

To tell Linux to have another look now, you just need to poke it:

echo 1 > /sys/bus/scsi/devices/1:0:0:0/rescan

Where "1:0:0:0" is the device ID for the disc. Linux will rescan immediately and then the extra space will appear for you to use.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment