On Saturday 25 February 2006 23:51, "Richard Fish" <[EMAIL PROTECTED]> 
wrote about 'Re: [gentoo-user] re-scanning for devices':
> On 2/25/06, Nick Smith <[EMAIL PROTECTED]> wrote:
> > is there a way to rescan for devices after bootup? like if i
> > hot-plugged a scsi drive into the machine after it was already
> > running? how can i re-detect the hardware?
>
> If you are using udev, and have configured the kernel for hotplug
> support, this should not be necessary.  The kernel will generate the
> appropriate hotplug events, and udev will create the device nodes.

Not quite.  SCSI (and possibly SATA, since it works though the SCSI 
interface in the kernel [1]) require an extra step when hotplugging, to 
scan a particular LUN:

echo 'add-single-device <chain> <target> <id> <lun> ' > /proc/scsi/scsi

You'll also have to use 'remove-single-device' w/ the same syntax to remove 
the device node for a scsi device that has been removed.

These commands will cause the necessary events to get sent to udev (or 
devfsd if you are still running that).  They are definitely not needed 
(nor should they be used) for buses that support new device notification, 
like USB or FireWire (tm). [2]

Finally, in kernels at least as recent as 2.6.16-rc1, attempting to add a 
device with the same chain, target, id, and lun as a device that has been 
removed will fail and generate some weird dmesg noise.  It won't panic or 
corrupt the kernel (or subsystem or even module), put it does put some 
practical limit on how much scsi hotplugging you can do before needed to 
reboot.

-- 
Boyd Stephen Smith Jr.
[EMAIL PROTECTED]
ICQ: 514984 YM/AIM: DaTwinkDaddy

[1] and [2]: All of this comes from my experience with SATA drives, but 
they are going through a hw raid controller that may be simply exposing 
SCSI devices, not SATA devices.  If SATA does have some sort of "device 
notification", I'll bet the SCSI "dance" doesn't have to be done -- but it 
my case it does.
-- 
gentoo-user@gentoo.org mailing list

Reply via email to