Networker

Re: [Networker] Jukebox control port using persistent names

2012-10-25 20:40:53
Subject: Re: [Networker] Jukebox control port using persistent names
From: Frank Swasey <Frank.Swasey AT UVM DOT EDU>
To: NETWORKER AT LISTSERV.TEMPLE DOT EDU
Date: Thu, 25 Oct 2012 20:40:03 -0400
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.

-- Frank