Amanda-Users

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

2007-03-06 18:56:58
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 18:49:50 -0500


On 3/6/07, Stefan G. Weichinger <sgw AT amanda DOT org> wrote:
FL schrieb:
> Thanks for getting back to me so quickly!

Why should I sleep at midnight? ;-)

You too?

> 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

[...]

> 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....).

Looks OK, just try it with udevtest.

Why do you want that symbolic link?
Why not use "/dev/sg2" in your config?

But you may use it, sure.

Even better stuff: udev is also able to set the group:

I have (example):

# cat 10-udev.rules
# "chgrp tape" for the changer-robots
BUS=="scsi", KERNEL=="sg?", ATTR{model}=="SA100", GROUP="tape"

Stefan




This is what I settled on as a first guess
# my customized rule
ID=="2:0:0:0", BUS=="scsi", SYSFS{vendor}=="EXABYTE ",   NAME="changer", OWNER="root", GROUP="tape", MODE="0660"

and it worked: I have a /dev/changer (I removed the symbolic link instruction in my setup file). I'm using the name changer since
   mtx uses it if it exists
   I wanted to try udev with new names, to see that the major and minor number assignments were correct (they were) and to avoid any potential conflicts

With /dev/sg1 renamed to /dev/changer in amanda.conf, I ran an amcheck against my configuration (one should always do this after changing the config):

backup@Wilf:/etc/init.d$ amcheck Daily
Amanda Tape Server Host Check
-----------------------------
Holding disk /home/amanda: 61798904 KB disk space available, using 60774904 KB
slot 6: read label `Daily-13', date `20070221'
NOTE: skipping tape-writable test
Tape Daily-13 label ok
Server check took 208.007 seconds

Amanda Backup Client Hosts Check
--------------------------------
Client check: 1 host checked in 0.150 seconds, 0 problems found

(brought to you by Amanda 2.5.1p1 )
backup@Wilf:/etc/init.d$


So that worked. I'm not even sure that I needed to assert

modprobe sg

When I do this, I have:
sh-3.1# ls -latrs sg*
0 crw-rw---- 1 root tape 21, 0 Mar  6 13:30 sg0
0 crw-rw---- 1 root tape 21, 1 Mar  6 13:30 sg1
0 crw-rw---- 1 root tape 21, 3 Mar  6 13:30 sg3
sh-3.1#

so I see that my rule caused the reassignment of /dev/sg2 to /dev/changer

sh-3.1# ls -latrs changer
0 crw-rw---- 1 root tape 21, 2 Mar  6 13:30 changer
 
Now previously it was /dev/sg1

So if I wanted to fix sg1, I might have to write KERNEL="sg1" and for kicks
I suppose I could add SYMLINK+="changer"

Anyway, I will spare the list my real-time fumbling, and thanks for being so helpful!
AMANDA is a great program.

FL