Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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


share|improve this question
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:

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

Your Answer


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