Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I'm having a fun problem here, we have a 10.04 server running bacula with 2 SAS tape drives. Last friday I had to unplug the tape drives a couple of times. Today, the devices are "reversed" (nst0 is now nst1).

Is there a way to force the device name, so that nst0 is always assigned to the same drive? (as in, if nst0 is not plugged in, nst0 will not be assigned to another device.)

Here's the content of /dev/tape/by-id :

lrwxrwxrwx 1 root root  9 2010-11-26 13:38 scsi-3500e09e0001b81e6 -> ../../st1
lrwxrwxrwx 1 root root 10 2010-11-26 13:38 scsi-3500e09e0001b81e6-nst -> ../../nst1
lrwxrwxrwx 1 root root  9 2010-11-26 13:38 scsi-3500e09e0001b9804 -> ../../st0
lrwxrwxrwx 1 root root 10 2010-11-26 13:38 scsi-3500e09e0001b9804-nst -> ../../nst0

Thanks!

share|improve this question
add comment

1 Answer 1

up vote 2 down vote accepted

You can use an udev rule o for the static device name, here is an example how to do it for an USB device:

http://www.wains.be/index.php/2010/04/10/udev-always-the-same-device-name-for-your-usb-drives/

share|improve this answer
    
Thanks for your reply, I was about to post a similar solution: KERNEL=="nst[0-9]*", SUBSYSTEM=="scsi_tape", ENV{ID_SERIAL}=="3500e09e0001b81e6", NAME="nst0", SYMLINK+="tape0" KERNEL=="st[0-9]*", SUBSYSTEM=="scsi_tape", ENV{ID_SERIAL}=="3500e09e0001b81e6", NAME="st0" KERNEL=="nst[0-9]*", SUBSYSTEM=="scsi_tape", ENV{ID_SERIAL}=="3500e09e0001b9804", NAME="nst1", SYMLINK+="tape1" KERNEL=="st[0-9]*", SUBSYSTEM=="scsi_tape", ENV{ID_SERIAL}=="3500e09e0001b9804", NAME="st1" But this doesn't "reserve" nst0, it just assigns it if a device with the matching serial number is plugged in. –  Jean Nov 29 '10 at 16:50
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.