autoloading sg driver during boot

Paul Howarth paul at city-fan.org
Thu Apr 14 15:02:04 UTC 2005


Aleksandar Milivojevic wrote:
> Paul Howarth wrote:
> 
>> Aren't the tape and the autochanger using different SCSI IDs or LUNs?
> 
> 
> Yes, they are.  Autochanger is SCSI ID 0, tape is SCSI ID 1.  The tape 
> gets /dev/st0* and /dev/nst0* on boot, and udev also creates couple of 
> symbolic links for it.  Once I do "modprobe sg", /dev/sg1 is 
> additionally created for tape (different major device number than st* 
> and nst*, of course), and /dev/sg0 for autochanger.
> 
>> Try this:
>> Manually load the sg module so that the sg devices get created.
>> What do you then get for:
>> $ udevinfo -a -p `udevinfo -q path -n /dev/sg0`
>> and
>> $ udevinfo -a -p `udevinfo -q path -n /dev/sg1`
> 
> 
> It gives this for sg0:
> 
>   looking at class device '/sys/class/scsi_generic/sg0':
>     SYSFS{dev}="21:0"
> 
> follow the class device's "device"
>   looking at the device chain at 
> '/sys/devices/pci0000:00/0000:00:06.0/host0/target0:0:0/0:0:0:0':
>     BUS="scsi"
>     ID="0:0:0:0"
>     SYSFS{detach_state}="0"
>     SYSFS{device_blocked}="0"
>     SYSFS{model}="EXB-210         "
>     SYSFS{queue_depth}="2"
>     SYSFS{rev}="1.10"
>     SYSFS{scsi_level}="3"
>     SYSFS{state}="running"
>     SYSFS{timeout}="0"
>     SYSFS{type}="8"
>     SYSFS{vendor}="EXABYTE "

Right, so this one's the autochanger. Try creating 
/etc/udev/rules.d/10-custom.rules containing the following line:

BUS="scsi", SYSFS{vendor}="EXABYTE*", SYSFS{model}="EXB-210*", 
NAME="sg%e", SYMLINK="autochanger%e"

Then see if you get the right device nodes created next time the SCSI 
card module is loaded.

Paul.




More information about the users mailing list