sslug-teknik team mailing list archive
-
sslug-teknik team
-
Mailing list archive
-
Message #07163
Re: Hotswap diske
On Mon, 3 May 1999, Henrik Morsing wrote:
> Der mangler en eller anden kommando til at få driveren til at lede efter
> den nye disk. Resette SCSI-bussen eller lignende.
Tjoh, ved at echo noget til /proc/scsi/scsi kan du. Proev at lede efter
"remove-single-device" paa www.google.com for at finde nogle howto'er, den
foerste jeg kunne finde var i SCSI-Programming howto, men der er nok nogle
bedre:
4.3.1. Dynamically insert and remove SCSI devices
If a newer kernel and the /proc file system is running, a non-busy
device can be removed and installed 'on the fly'.
To remove a SCSI device:
echo "scsi remove-single-device a b c d" > /proc/scsi/scsi
and similar, to add a SCSI device, do
echo "scsi add-single-device a b c d" > /proc/scsi/scsi
where
a == hostadapter id (first one being 0)
b == SCSI channel on hostadapter (first one being 0)
c == ID
d == LUN (first one being 0)
So in order to swap the /dev/sgc and /dev/sgd mappings from the
previous example, we could do
echo "scsi remove-single-device 0 0 4 0" > /proc/scsi/scsi
echo "scsi remove-single-device 0 0 5 0" > /proc/scsi/scsi
echo "scsi add-single-device 0 0 5 0" > /proc/scsi/scsi
echo "scsi add-single-device 0 0 4 0" > /proc/scsi/scsi
since generic devices are mapped in the order of their insertion.
When adding more devices to the scsi bus keep in mind there are
limited spare entries for new devices. The memory has been allocated
at boot time and has room for 2 more devices.
--
==============================================================================
Erwin Andreasen Herlev, Denmark <erw@xxxxxx> UNIX System Programmer
<URL:http://www.andreasen.org> <*> (not speaking for) DDE
==============================================================================
Follow ups
References