There are symlinks for the archive devices but not the tape drive control
devices which is what the tape alert commands need. I did already have it
set to use the symlink for the autochanger at least so that won't jump
around.

*> ls -l /dev/tape/by-id*











*total 0lrwxrwxrwx 1 root root  9 Jan 26 23:35 scsi-1ADIC_A0C0036905_LLA ->
../../sg8lrwxrwxrwx 1 root root  9 Jan 26 23:35 scsi-3500308c099903000 ->
../../st4lrwxrwxrwx 1 root root 10 Jan 26 23:35 scsi-3500308c099903000-nst
-> ../../nst4lrwxrwxrwx 1 root root  9 Jan 26 23:35 scsi-3500308c099903004
-> ../../st1lrwxrwxrwx 1 root root 10 Jan 26 23:35
scsi-3500308c099903004-nst -> ../../nst1lrwxrwxrwx 1 root root  9 Jan 26
23:35 scsi-3500308c099903094 -> ../../st3lrwxrwxrwx 1 root root 10 Jan 26
23:35 scsi-3500308c099903094-nst -> ../../nst3lrwxrwxrwx 1 root root  9 Jan
26 23:35 scsi-3500308c099903098 -> ../../st0lrwxrwxrwx 1 root root 10 Jan
26 23:35 scsi-3500308c099903098-nst -> ../../nst0lrwxrwxrwx 1 root root  9
Jan 26 23:35 scsi-3500308c09990309c -> ../../st2*
*lrwxrwxrwx 1 root root 10 Jan 26 23:35 scsi-3500308c09990309c-nst ->
../../nst2*

My only other idea is that maybe you could create a script that rewrites
the bacula-sd.conf every boot by parsing the output of this command as it
shows which sg* devices correspond to the st* ones:











*> lsscsi -g[0:0:0:0]    cd/dvd  HL-DT-ST DVD-ROM GDR-T10N 1.02  /dev/sr0
/dev/sg0[2:0:0:0]    tape    IBM      ULTRIUM-TD3      93GM  /dev/st0
/dev/sg1[4:0:0:0]    tape    IBM      ULTRIUM-TD3      93GM  /dev/st1
/dev/sg2[5:0:0:0]    tape    IBM      ULTRIUM-TD3      93GM  /dev/st4
/dev/sg6[5:0:0:1]    mediumx ADIC     Scalar i500      630G  /dev/sch0
/dev/sg8[6:0:0:0]    tape    IBM      ULTRIUM-TD3      93GM  /dev/st2
/dev/sg3[7:0:0:0]    tape    IBM      ULTRIUM-TD3      93GM  /dev/st3
/dev/sg4[9:0:0:0]    disk    ATA      ST1000VN002-2EY1 SC60  /dev/sda
/dev/sg5[9:0:1:0]    disk    ATA      ST1000VN002-2EY1 SC60  /dev/sdb
/dev/sg7*

Thanks,
Nate

On Sun, Jan 27, 2019 at 12:42 AM Adam Nielsen <a.niel...@shikadi.net> wrote:

> > I'm using Ubuntu 18.04.1 with Bacula 9.0.6 from the main repo.  I'd like
> to
> > enable the above alerts from the sample bacula-sd.conf but can't because
> my
> > system is assigning random device names after each reboot so that
> > /dev/nst0, /dev/nst1, etc. can be any /dev/sg* number.  I looked into
> > creating a udev rule for the drives but there's no output from the
> control
> > device that can be uniquely identified (DEVPATH can't be used in a udev
> > rule I've found out):
>
> On my Arch Linux system, udev already has persistent rules for tapes
> in /dev/tape:
>
> $ ls /dev/tape/by-id/
> total 0
> drwxr-xr-x 2 root root 100 Dec 18 20:45 .
> drwxr-xr-x 4 root root  80 Dec 18 18:22 ..
> lrwxrwxrwx 1 root root   9 Dec 19 23:21 scsi-350014380125815e0 -> ../../sg6
> lrwxrwxrwx 1 root root   9 Dec 19 23:21 scsi-350014380125815e1 -> ../../st0
> lrwxrwxrwx 1 root root  10 Dec 19 23:21 scsi-350014380125815e1-nst ->
> ../../nst0
>
> sg6 is the autochanger on my system.
>
> If your system doesn't have these, and no update to udev is available,
> maybe you can copy the rules across from a newer version of udev[1]?
>
> > Is there another way do make this work?  There's a more recent firmware
> for
> > my tape library, a Dell ML6000, that I've held off installing.  Do you
> > think a new firmware might allow the sg driver to provide more output?
>
> Nope, this is all part of the udev rule system.
>
> Cheers,
> Adam.
>
> [1]:
> https://github.com/systemd/systemd/blob/master/rules/60-persistent-storage-tape.rules
>
_______________________________________________
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users

Reply via email to