From: "Nathanael Burton" <mathrock@airpost.net>
To: linux-hotplug@vger.kernel.org
Subject: udev, st driver, SAN attached tape
Date: Wed, 28 Jun 2006 01:32:01 +0000 [thread overview]
Message-ID: <1151458321.29675.264820494@webmail.messagingengine.com> (raw)
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
next reply other threads:[~2006-06-28 1:32 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-06-28 1:32 Nathanael Burton [this message]
2006-06-28 6:58 ` udev, st driver, SAN attached tape Andrey Borzenkov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1151458321.29675.264820494@webmail.messagingengine.com \
--to=mathrock@airpost.net \
--cc=linux-hotplug@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).