For When You Can't Have The Real Thing
[ start | index | login ]
start > CentOS > 5 > SCSI Bus Rescan

SCSI Bus Rescan

Created by dave. Last edited by dave, 9 years and 256 days ago. Viewed 2,735 times. #2
[diff] [history] [edit] [rdf]


You've hot-added a new disk and now want to use it without rebooting.


# echo "- - -" > /sys/class/scsi_host/host1/scan

Change the "1" to the correct host bus number.

This will detect the new disk and add it.

Beware! If you add a disk in your system other than the current-last-detected-on-boot disk position, it *will* get a different sdX name the next time you boot (and more importantly, so with other disk(s))! All kinds of hilarity can ensue when this happens; make sure that you are using LVM, or md, or e2labels, or something else that can deal correctly with disks that don't come back with the same names the next time you boot.

Since I don't trust any of the above mechanisms, I usually try to make sure my disks are carefully ordered so that the new one will be detected at boot time after all the current ones. This isn't always practical with large RAID groups or large disk servers, but I've managed to avoid hurting myself too badly so far by trying hard.

no comments | post comment
This is a collection of techical information, much of it learned the hard way. Consider it a lab book or a /info directory. I doubt much of it will be of use to anyone else.

Useful: | Copyright 2000-2002 Matthias L. Jugel and Stephan J. Schmidt