Amanda-Users

Re: AMANDA reports no slots, but there ARE slots!

2007-03-06 18:00:50
Subject: Re: AMANDA reports no slots, but there ARE slots!
From: FL <lengyel AT gmail DOT com>
To: sgw AT amanda DOT org
Date: Tue, 6 Mar 2007 17:53:29 -0500
Thanks for getting back to me so quickly!

Here's the relevant data:
OS is debian linux
flengyel@Wilf:~$ uname -a
Linux Wilf 2.6.17 #4 SMP PREEMPT Wed May 10 13:53:45 CEST 2006 i686 GNU/Linux

Amanda version:
 amadmin Daily version
build: VERSION="Amanda-2.5.1p1"
       BUILT_DATE="Wed Nov 29 02:15:07 CET 2006"
       BUILT_MACH="Linux intrepid 2.6.18-1-686 #1 SMP Fri Sep 29 16:25:40 UTC 2006 i686 GNU/Linux"
       CC="gcc"
       CONFIGURE_COMMAND="'./configure' '--prefix=/usr' '--bindir=/usr/sbin' '--mandir=/usr/share/man' '--libexecdir=/usr/lib/amanda' '--enable-shared' '--sysconfdir=/etc' '--localstatedir=/var/lib' '--with-gnutar-listdir=/var/lib/amanda/gnutar-lists' '--with-index-server=localhost' '--with-user=backup' '--with-group=backup' '--with-bsd-security' '--with-amandahosts' '--with-smbclient=/usr/bin/smbclient' '--with-debugging=/var/log/amanda' '--with-dumperdir=/usr/lib/amanda/dumper.d' '--with-tcpportrange=50000,50100' '--with-udpportrange=840,860' '--with-maxtapeblocksize=256' '--with-ssh-security'"
paths: bindir="/usr/sbin" sbindir="/usr/sbin"
       libexecdir="/usr/lib/amanda" mandir="/usr/share/man"
       AMANDA_TMPDIR="/tmp/amanda"
       AMANDA_DBGDIR="/var/log/amanda" CONFIG_DIR="/etc/amanda"
       DEV_PREFIX="/dev/" RDEV_PREFIX="/dev/" DUMP="/sbin/dump"
       RESTORE="/sbin/restore" VDUMP=UNDEF VRESTORE=UNDEF
       XFSDUMP="/sbin/xfsdump" XFSRESTORE="/sbin/xfsrestore"
       VXDUMP=UNDEF VXRESTORE=UNDEF
       SAMBA_CLIENT="/usr/bin/smbclient" GNUTAR="/bin/tar"
       COMPRESS_PATH="/bin/gzip" UNCOMPRESS_PATH="/bin/gzip"
       LPRCMD="/usr/bin/lpr" MAILER="/usr/bin/mail"
       listed_incr_dir="/var/lib/amanda/gnutar-lists"
defs:  DEFAULT_SERVER="localhost" DEFAULT_CONFIG="DailySet1"
       DEFAULT_TAPE_SERVER="localhost" HAVE_MMAP HAVE_SYSVSHM
       LOCKING=POSIX_FCNTL SETPGRP_VOID DEBUG_CODE
       AMANDA_DEBUG_DAYS=4 BSD_SECURITY RSH_SECURITY USE_AMANDAHOSTS
       CLIENT_LOGIN="backup" FORCE_USERID HAVE_GZIP
       COMPRESS_SUFFIX=".gz" COMPRESS_FAST_OPT="--fast"
       COMPRESS_BEST_OPT="--best" UNCOMPRESS_OPT="-dc"
sh-3.1#

And in my startup script, I have:

modprobe sg
chown root.tape /dev/sg0
chown root.tape /dev/sg1  # moved from sg2 to sg1!!!
chown root.tape /dev/sg2
chown root.tape /dev/sg3 
if [ ! -h /dev/changer ]; then
    ln -s /dev/sg1 /dev/changer
fi

But this is not optimal. According to /proc/scsi/scsi
I have this entry

Host: scsi2 Channel: 00 Id: 00 Lun: 00
  Vendor: EXABYTE  Model: LTO 1x7 2U       Rev: B005
  Type:   Medium Changer                   ANSI SCSI revision: 04

which means (now that I barely know enough to be dangerous)
that I need to create a rule to bind the scsi generic device I want
to sg1; so I have to derive something from the output of udevinfo
command:

sh-3.1# udevinfo -a -p /sys/class/scsi_generic/sg1/

udevinfo starts with the device the node belongs to and then walks up the
device chain, to print for every device found, all possibly useful attributes
in the udev key format.
Only attributes within one device section may be used together in one rule,
to match the device for which the node will be created.

  looking at device '/class/scsi_generic/sg1':
    KERNEL=="sg1"
    SUBSYSTEM=="scsi_generic"
    SYSFS{dev}=="21:1"

  looking at device '/devices/pci0000:00/0000:00: 1e.0/0000:06:00.0/host2/target2:0:0/2:0:0:0':
    ID=="2:0:0:0"
    BUS=="scsi"
    DRIVER==""
    SYSFS{ioerr_cnt}=="0x2"
    SYSFS{iodone_cnt}=="0x8c"
    SYSFS{iorequest_cnt}=="0x8c"
    SYSFS{iocounterbits}=="32"
    SYSFS{timeout}=="0"
    SYSFS{state}=="running"
    SYSFS{rev}=="B005"
    SYSFS{model}=="LTO 1x7 2U      "
    SYSFS{vendor}=="EXABYTE "
    SYSFS{scsi_level}=="5"
    SYSFS{type}=="8"
    SYSFS{queue_type}=="none"
    SYSFS{queue_depth}=="2"
    SYSFS{device_blocked}=="0"

  looking at device '/devices/pci0000:00/0000:00:1e.0/0000:06:00.0/host2/target2:0:0':
    ID=="target2:0:0"
    BUS==""
    DRIVER==""

  looking at device '/devices/pci0000:00/0000:00: 1e.0/0000:06:00.0/host2':
    ID=="host2"
    BUS==""
    DRIVER==""

  looking at device '/devices/pci0000:00/0000:00:1e.0/0000:06:00.0':
    ID=="0000:06: 00.0"
    BUS=="pci"
    DRIVER=="aic7xxx"
    SYSFS{modalias}=="pci:v00009005d00000080sv00009005sd0000E2A0bc01sc00i00"
    SYSFS{local_cpus}=="ffffffff"
    SYSFS{irq}=="21"
    SYSFS{class}=="0x010000"
    SYSFS{subsystem_device}=="0xe2a0"
    SYSFS{subsystem_vendor}=="0x9005"
    SYSFS{device}=="0x0080"
    SYSFS{vendor}=="0x9005"

  looking at device '/devices/pci0000:00/0000:00:1e.0':
    ID=="0000:00:1e.0"
    BUS=="pci"
    DRIVER==""
    SYSFS{modalias}=="pci:v00008086d0000244Esv00000000sd00000000bc06sc04i01"
    SYSFS{local_cpus}=="ffffffff"
    SYSFS{irq}=="0"
    SYSFS{class}=="0x060401"
    SYSFS{subsystem_device}=="0x0000"
    SYSFS{subsystem_vendor}=="0x0000"
    SYSFS{device}=="0x244e"
    SYSFS{vendor}=="0x8086"

  looking at device '/devices/pci0000:00':
    ID=="pci0000:00"
    BUS==""
    DRIVER==""


So, after the most cursory reading of the documentation, I guess that I want

ID=="2:0:0:0" BUS=="scsi" SYSFS{vendor}=="EXABYTE "   NAME="changer"

to identify the device and set the symbolic link (I also need to set the ownership and mode....).


On 3/6/07, Stefan G. Weichinger < sgw AT amanda DOT org> wrote:
FL schrieb:

> After watching the trouble recur, I see that the device associated with
> the changer SCSI device ID moved: it was /dev/sg2, today it is /dev/sg1.
> No changes were made to the Exabyte LTO-2 tape library  or to the SCSI
> card (or anything else). So there is something I'm failing to understand
> about udev, SCSI or the Exabyte.
>
> Perhaps during bootup I should attempt
>
> mtx -f /dev/sg0 status
> mtx -f /dev/sg1 status
>
> until I have a valid status, and link
> /dev/changer to that, then refer to /dev/changer in amanda.conf. That's
> a workaround: somehow the device assigned to the changer moves on
> occasion, after a reboot. Perhaps I should be referring to the changer
> device in some other way (bus number, SCSI ID, lun...).

Don't remember the used OS now:

Do you have something like udev on that box? You could then set up a
rule to get a fixed relation between devicename and device.

What else gets in the way? /dev/sg? are scsi-devices, on my boxes the
order is always the same, increasing with the SCSI-IDs.

Another idea would be:

chgrp tape /dev/sg?

in a start-script ...

Just quick thoughts.

Stefan