1 |
On Saturday 25 February 2006 23:51, "Richard Fish" <bigfish@××××××××××.org> |
2 |
wrote about 'Re: [gentoo-user] re-scanning for devices': |
3 |
> On 2/25/06, Nick Smith <nick.smith79@×××××.com> wrote: |
4 |
> > is there a way to rescan for devices after bootup? like if i |
5 |
> > hot-plugged a scsi drive into the machine after it was already |
6 |
> > running? how can i re-detect the hardware? |
7 |
> |
8 |
> If you are using udev, and have configured the kernel for hotplug |
9 |
> support, this should not be necessary. The kernel will generate the |
10 |
> appropriate hotplug events, and udev will create the device nodes. |
11 |
|
12 |
Not quite. SCSI (and possibly SATA, since it works though the SCSI |
13 |
interface in the kernel [1]) require an extra step when hotplugging, to |
14 |
scan a particular LUN: |
15 |
|
16 |
echo 'add-single-device <chain> <target> <id> <lun> ' > /proc/scsi/scsi |
17 |
|
18 |
You'll also have to use 'remove-single-device' w/ the same syntax to remove |
19 |
the device node for a scsi device that has been removed. |
20 |
|
21 |
These commands will cause the necessary events to get sent to udev (or |
22 |
devfsd if you are still running that). They are definitely not needed |
23 |
(nor should they be used) for buses that support new device notification, |
24 |
like USB or FireWire (tm). [2] |
25 |
|
26 |
Finally, in kernels at least as recent as 2.6.16-rc1, attempting to add a |
27 |
device with the same chain, target, id, and lun as a device that has been |
28 |
removed will fail and generate some weird dmesg noise. It won't panic or |
29 |
corrupt the kernel (or subsystem or even module), put it does put some |
30 |
practical limit on how much scsi hotplugging you can do before needed to |
31 |
reboot. |
32 |
|
33 |
-- |
34 |
Boyd Stephen Smith Jr. |
35 |
bss03@××××××××××.com |
36 |
ICQ: 514984 YM/AIM: DaTwinkDaddy |
37 |
|
38 |
[1] and [2]: All of this comes from my experience with SATA drives, but |
39 |
they are going through a hw raid controller that may be simply exposing |
40 |
SCSI devices, not SATA devices. If SATA does have some sort of "device |
41 |
notification", I'll bet the SCSI "dance" doesn't have to be done -- but it |
42 |
my case it does. |
43 |
-- |
44 |
gentoo-user@g.o mailing list |