udev, st driver, SAN attached tape
I'm trying to configure udev rules to dynamically create the non-rewinding tape device nodes for SAN attached tape drives based on WWNN. My rules seem to be working correctly to some extent, except udev is not building the WWNN based tape device paths on reboot.
System:
RedHat Enterprise Linux 4.0 Update 3 (x86)
Example rules:
KERNEL="nst[0-9]*", PROGRAM="/etc/udev/scripts/getTapeWWNNbyGeneric.sh %n", RESULT="5001XXXXXXXXXXXX", NAME="library1/tape1", SYMLINK="san/tape/nst%c %k"
KERNEL="nst[0-9]*", PROGRAM="/etc/udev/scripts/getTapeWWNNbyGeneric.sh %n", RESULT="5001XXXXXXXXXXXY", NAME="library2/tape1", SYMLINK="san/tape/nst%c %k"
What "/etc/udev/scripts/getTapeWWNNbyGeneric.sh" does:
- Takes nst tape number as argument, ex: 0 -> nst0
- Grab SCSI bus ID from udev info, ex: "udevinfo -a -p /sys/class/scsi_tape/nst0 | grep ID"
- Query all SCSI generic devices for a matching SCSI ID, if matching sg device found set $GENERIC
- Query the SCSI generic device for the WWNN from EVPD page 0x83, ex:
"scsi_id -g -s /class/scsi_generic/$GENERIC"
- Strip off the NAA type from the beginning of the WWNN
- If no errors have occurred, output WWNN to STDOUT and return "0", otherwise return "1".
The reason I query the SCSI generic device instead of the tape device directly for the WWNN is because if that drive happens to be reserved by another host on the SAN I get a RESERVATION CONFLICT. If I query the SCSI generic device for the tape I can still get the WWNN even if the drive is reserved on athother host.
After system boot if I remove the Qlogic HBA module and modprobe it back into the kernel, udev correctly queries the devices and builds the correct tape device nodes and links based upon the WWNN. However if I reboot the system it seems like udev isn't correctly configuring my rules. On reboot, udev creates the standard kernel tape devices as if my custom rules weren't there: /dev/st0, /dev/nst0, etc... Again, if right after boot I simply "rmmod qla2300; modprobe qla2300" udev builds the correct nodes.
Any ideas? Also how can I debug what is happening during boot and udev? When udev is building the device nodes the root file system is mounted read-only, and syslog and networking aren't up yet. How do I output debug info from my udev script to the boot log?
Thanks,
-Nate
Signature · 12 lines
http://www.fastmail.fm - Faster than the air-speed velocity of an
unladen european swallow
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid0709&bid&3057&dat1642
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Quoted 9 lines · Nathanael Burton
After system boot if I remove the Qlogic HBA module and modprobe it back into the kernel, udev correctly queries the devices and builds the correct tape device nodes and links based upon the WWNN. However if I reboot the system it seems like udev isn't correctly configuring my rules. On reboot, udev creates the standard kernel tape devices as if my custom rules weren't there:
/dev/st0,/dev/nst0, etc... Again, if right after boot I simply "rmmod qla2300; modprobe qla2300" udev builds the correct nodes.
usually this means your script is using programs from /usr and /usr is not mounted when udev is run at boot.
- -andrey
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.3 (GNU/Linux)
iD8DBQFEoiiJR6LMutpd94wRAkadAJ4mShoF+X9XaVtpEn6NtWoy2fLh7QCfY6UE 02bc95d96ORMlYWec5vplE8=GmJ7
-----END PGP SIGNATURE-----
Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid0709&bid&3057&dat1642
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel