Rescan scsi: Difference between revisions
Created page with "To rescan your scsi disks (to look if a disk has been added) you can reread your scsi device by giving the following command: <pre> echo "- - -" >/sys/class/scsi_host/host0/scan </pre> It's very handy if you added a disk in VMware, don't want to reboot and have no flashy thingy disk-tools. If you added space to your first disk you need to rescan your disk with: <pre> echo 1 > /sys/block/sda/device/rescan </pre> If you resized your disk with fdisk for example, but th..." |
No edit summary |
||
Line 11: | Line 11: | ||
<pre> | <pre> | ||
echo 1 > /sys/block/sda/device/rescan | echo 1 > /sys/block/sda/device/rescan | ||
</pre> | |||
If you're running a multipath device you can check the multipath device size with | |||
<pre> | |||
multipath -l | |||
</pre> | |||
To resize the multipath device also run (e.g. multipath device dm-1) | |||
<pre> | |||
multipathd resize map dm-1 | |||
</pre> | </pre> | ||
Latest revision as of 09:21, 22 May 2025
To rescan your scsi disks (to look if a disk has been added) you can reread your scsi device by giving the following command:
echo "- - -" >/sys/class/scsi_host/host0/scan
It's very handy if you added a disk in VMware, don't want to reboot and have no flashy thingy disk-tools.
If you added space to your first disk you need to rescan your disk with:
echo 1 > /sys/block/sda/device/rescan
If you're running a multipath device you can check the multipath device size with
multipath -l
To resize the multipath device also run (e.g. multipath device dm-1)
multipathd resize map dm-1
If you resized your disk with fdisk for example, but the disk was still busy for some reason and the partition table could not be rescanned you can use partprobe, but the following command also works to update your partitions:
hdparm -z /dev/sdX
If this gives you a "BLKRRPART failed: Device or resource busy" because some partitions on the drive are currently mounted, if you really don't want to reboot, you can try:
partx -a /dev/sdX
This will force partitions to be added and such.