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, 10 years and 6 days ago. Viewed 2,830 times. #2
[diff] [history] [edit] [rdf]
labels
attachments
(2014-03-24)

Problem

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

Solution

# 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:


snipsnap.org | Copyright 2000-2002 Matthias L. Jugel and Stephan J. Schmidt