This is a quick guide on how to rescan the SCSI bus so the Linux system sees the new storage volume, after adding a new storage device in the hypervisor like vSphere. In this example I am working on a CentOS 6.x virtual machine.
- Add new storage volume with vSphere client (in this example we’ve added a 90GB volume)
- Check to make sure the new volume is seen by the system
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
[root@server1 ~]# fdisk -l Disk /dev/sda: 21.5 GB, 21474836480 bytes 255 heads, 63 sectors/track, 2610 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x00055029 Device Boot Start End Blocks Id System /dev/sda1 * 1 33 262144 83 Linux Partition 1 does not end on cylinder boundary. /dev/sda2 33 2611 20708352 8e Linux LVM Disk /dev/sdb: 53.7 GB, 53687091200 bytes 255 heads, 63 sectors/track, 6527 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x00000000 |
3. If the volume is not present, run the following command
1 |
[root@server11 ~]# for i in $(ls /sys/class/scsi_host);do echo "- - -" > /sys/class/scsi_host/$i/scan;done |
4. Check the system again (the new volume should now be presented as /dev/sdc)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
[root@server1 ~]# fdisk -l Disk /dev/sda: 21.5 GB, 21474836480 bytes 255 heads, 63 sectors/track, 2610 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x00055029 Device Boot Start End Blocks Id System /dev/sda1 * 1 33 262144 83 Linux Partition 1 does not end on cylinder boundary. /dev/sda2 33 2611 20708352 8e Linux LVM Disk /dev/sdb: 53.7 GB, 53687091200 bytes 255 heads, 63 sectors/track, 6527 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x00000000 Disk /dev/sdc: 96.6 GB, 96636764160 bytes 255 heads, 63 sectors/track, 11748 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x00000000 |