LINUX - Manual Disk Discovery

PROBLEM? 

Just added a drive, but you can not see it in "cat /proc/partitions"

mdev AND udev

The following method is good if you do not have mdev setup or udev setup.

If you have mdev setup then just run:

# mdev -s

If you have udev set up then the system should of automatically discovered the hot plug events and recognized the disks, so you probably wouldn't of been reading this in the first place.

MANUAL SCAN FOR DISKS:

What to do?
First you need to find out how many host folders you have with the command: "ls /sys/class/scsi_host/" and it will show you all the scsi hosts. For me It shows "host0" and "host1" so that means I need to run the following command for each host.
So I will run the following command, this is the general form - where you see # is the host number:
# echo "- - -" > /sys/class/scsi_host/host#/scan

What I Did?
So since 

# ls /sys/class/scsi_host

returns

host0 and host1

So to scan for disks
echo "- - -" > /sys/class/scsi_host/host0/scan
echo "- - -" > /sys/class/scsi_host/host1/scan

Why scan or reboot?

When you add a new disk to a system, the system will not acknowledge it till you reboot or scan the scsi hosts. After rebooting and or scanning the scsi hosts:

cat /proc/partitions will now show you the new added disk most likely as sdb (if you only had one disk before.)
Comments