* udev, st driver, SAN attached tape
@ 2006-06-28 1:32 Nathanael Burton
2006-06-28 6:58 ` Andrey Borzenkov
0 siblings, 1 reply; 2+ messages in thread
From: Nathanael Burton @ 2006-06-28 1:32 UTC (permalink / raw)
To: linux-hotplug
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
--
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&kid\x120709&bid&3057&dat\x121642
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: udev, st driver, SAN attached tape
2006-06-28 1:32 udev, st driver, SAN attached tape Nathanael Burton
@ 2006-06-28 6:58 ` Andrey Borzenkov
0 siblings, 0 replies; 2+ messages in thread
From: Andrey Borzenkov @ 2006-06-28 6:58 UTC (permalink / raw)
To: linux-hotplug
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On Wednesday 28 June 2006 05:32, Nathanael Burton wrote:
> 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&kid\x120709&bid&3057&dat\x121642
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2006-06-28 6:58 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-06-28 1:32 udev, st driver, SAN attached tape Nathanael Burton
2006-06-28 6:58 ` Andrey Borzenkov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).