Networker

Re: [Networker] Jukebox control port using persistent names

2012-10-26 11:37:16
Subject: Re: [Networker] Jukebox control port using persistent names
From: Tim Mooney <Tim.Mooney AT NDSU DOT EDU>
To: NETWORKER AT LISTSERV.TEMPLE DOT EDU
Date: Fri, 26 Oct 2012 10:36:53 -0500
In regard to: Re: [Networker] Jukebox control port using persistent names,...:

Today at 2:47pm, Tim Mooney wrote:

Anyone on the list come up with udev rules that bind tape drives to
persistent but less onerous device names?

Yes, I use the following rule file (which I set up as /etc/udev/rules.d/20-local.rules):

KERNEL=="nst[0-9]*", IMPORT{parent}=="ID_*"
KERNEL=="nst[0-9]*", SUBSYSTEM=="scsi_tape", ENV{ID_SERIAL}=="", IMPORT{program}="scsi_id -u -g -x -s %p -d $tempnode" KERNEL=="nst[0-9]*", SUBSYSTEM=="scsi_tape", ENV{ID_SERIAL}=="", IMPORT{program}="scsi_id -u -g -x -a -s %p -d $tempnode" KERNEL=="nst[0-9]*", SUBSYSTEM=="scsi_tape", ENV{ID_SERIAL}=="3500507631241A79B", NAME="nst0", SYMLINK+="tape/by-id/$env{ID_BUS}-$env{ID_SERIAL}-nst", SYMLINK+="tape0" KERNEL=="nst[0-9]*", SUBSYSTEM=="scsi_tape", ENV{ID_SERIAL}=="3500507631247C87A", NAME="nst1", SYMLINK+="tape/by-id/$env{ID_BUS}-$env{ID_SERIAL}-nst", SYMLINK+="tape1" KERNEL=="nst[0-9]*", SUBSYSTEM=="scsi_tape", ENV{ID_SERIAL}=="3500507631247C81E", NAME="nst2", SYMLINK+="tape/by-id/$env{ID_BUS}-$env{ID_SERIAL}-nst", SYMLINK+="tape2" KERNEL=="nst[0-9]*", SUBSYSTEM=="scsi_tape", ENV{ID_SERIAL}=="?*", SYMLINK+="tape/by-id/$env{ID_BUS}-$env{ID_SERIAL}-nst"

Every time I replace a tape drive, I have to remember to edit this file with the new WWN before I have RHEL rescan the scsi bus. But, it lets me use the /dev/nst[0-2] paths in the jukebox config and KNOW that they will be the correct ones.

Thanks Frank!  That's exactly what I was looking for -- having the short
names *be* links to the persistent names, rather than the other way
around.

Tim
--
Tim Mooney                                             Tim.Mooney AT ndsu DOT 
edu
Enterprise Computing & Infrastructure                  701-231-1076 (Voice)
Room 242-J6, IACC Building                             701-231-8541 (Fax)
North Dakota State University, Fargo, ND 58105-5164