Amanda-Users

Re: another chg-zd-mtx problem

2003-02-13 13:19:42
Subject: Re: another chg-zd-mtx problem
From: Gene Heskett <gene_heskett AT iolinc DOT net>
To: Pete Poggione <ppoggione AT ebsllc DOT com>, Jon LaBadie <jon AT jgcomp DOT com>
Date: Thu, 13 Feb 2003 11:45:37 -0500
On Thursday 13 February 2003 09:54, Pete Poggione wrote:
>Jon -
>Perhaps I'm have a blonde moment over this whole configuration
> issue. Please excuse my ignorance... and I do appreciate your
> help. Below see my comments embedded in your last email..
>
>On Wed, 2003-02-12 at 15:16, Jon LaBadie wrote:
>> Is there a "groups" command on your system.
>> Or maybe the "id" command will show it.
>
>Both 'groups' and ID work on my system (Mandrake 9)
>
>>It might be useful to check what are the groups amanda belongs to
>> when logged in and when running from cron.
>>A little script like this could be make (I'm calling it "ckit")
>>
>>    exec 1> /tmp/ckit-$$ 2>&1
>>
>>    groups    # or id or what ever
>>    mtx -f <your tape device> status     # or info or inquiry or
>> what ever
>
>'amanda' does not belong to any secondary groups. I now have set
> the changer device group to 'disk' (the amanda group) and
> verified that group has rw permissions.
>
>lr-xr-xr-x    1 root     root           36 Feb 10 13:45 /dev/sg2
> -> scsi/host0/bus0/target5/lun1/generic
>
>crw-rw----    1 root     disk      21,   2 Dec 31  1969
>/dev/scsi/host0/bus0/target5/lun1/generic
>
>I created the script and ran at the command line as 'amanda' as
> well as from amanda's cron. The output looks like this: (I called
> both groups and id in the script) The output was identical from
> either a shell or cron.
>
>script output:
>
>disk
>uid=502(amanda) gid=6(disk) groups=6(disk)
>  Storage Changer /dev/sg2:1 Drives, 6 Slots ( 0 Import/Export )
>Data Transfer Element 0:Full (Storage Element 2 Loaded)
>      Storage Element 1:Full
>      Storage Element 2:Empty
>      Storage Element 3:Full
>      Storage Element 4:Full
>      Storage Element 5:Full
>      Storage Element 6:Full
>
>> If that works, try a "cd amanda_config_dir ; chg-zd-mtx <some
>> command>" in the cron script.
>
>OK - I tried this manually.. my configs are in
>/usr/local/etc/amanda/daily-net. So I went there and ran:
>
>/usr/local/libexec/chg-zd-mtx -info. The result was not good. It
> returns
>
>"<none> could not determine current slot"
>
>The contents of the debug file for the above test is:
>======================================================
>chg-zd-mtx: debug 1 pid 3361 ruid 0 euid 0: start at Thu Feb 13
> 09:34:17 2003
>09:34:17 Arg info:
>         $# = 1
>         $0 = "/usr/local/libexec/chg-zd-mtx"
>         $1 = "-info"
>09:34:17 Running: /sbin/mtx status
>09:34:17 Exit code: 0
>         Stdout:
>  Storage Changer /dev/sg2:1 Drives, 6 Slots ( 0 Import/Export )
>Data Transfer Element 0:Full (Storage Element 2 Loaded)
>      Storage Element 1:Full
>      Storage Element 2:Empty
>      Storage Element 3:Full
>      Storage Element 4:Full
>      Storage Element 5:Full
>      Storage Element 6:Full
>09:34:17 Config info:
>         firstslot = "1"
>         lastslot = "6"
>         cleanslot = "6"

Here is the only place I see that might be a problem, but it doesn't 
appear to be germain to your problem.  IF you have a cleaning tape 
in slot 6, then one would normally set lastslot to "5" which would 
prevent the inadvertant clean cycle during a "looking for the right 
tape" scan.  IF you don't keep a cleaning tape in slot 6 then I'd 
not even define cleanslot.  I don't know enough about your drive to 
be much help other than this.  My experience is with a 
Seagate/Campaq 4 slotter.

>         cleancycle = "120"
>         offline_before_unload = "0"
>         unloadpause = "0"
>         autoclean = "0"
>         autocleancount = "99"
>         havereader = "0"
>         driveslot = "1"
>         poll_drive_ready = "3"
>         max_drive_wait = "120"
>09:34:17 Exit (2) -> <none> could not determine current slot
>chg-zd-mtx: pid 3484 finish time Thu Feb 13 09:34:17 2003
>==========================================================
>
>I don't know if this helps in determining where my stuff is SB
> (Sh**'s broke)
>
>The user config portion of ../daily-net/mtx-changer:
>
>### USER CONFIGURATION
># Name of the tape drive (takes place of "tapedev" option in
>amanda.conf)
>#  and default driver number in library (usu 0) that DRIVE_NAME
> points to
>DRIVE_NAME="/dev/nst1"
>DRIVE_NUM=0
>
># Location of "STC" command and control device
>MTX_CMD="/sbin/mtx";
>MTX_CONTROL="/dev/sg2";
>
># Whether tape drive must eject tape before changer retrieves
>#  (ie, EXB-2x0). Usually okay if set while not necessary, bad if
>#  required but not set.
>DRIVE_MUST_EJECT=1
>
># How long to check drive readiness (in seconds) after mounting
> (or #  ejecting) a volume (on some libraries, the motion or eject
> command may
>#  complete before the drive has the volume fully mounted and
> online, #  or ready for retrieval, resulting in "Drive not
> ready"/"Media not #  ready" errors). Do an "mt status" command
> every 5 seconds upto this #  time.
>DRIVE_READY_TIME_MAX=120
>
>#  tape "mt" command location...
>MT_CMD="/bin/mt"     # called via "MT_CMD -f DRIVE_NAME rewind" &
>                         #   "MT_CMD -f DRIVE_NAME offline" to
> eject # and "MT_CMD -f DRIVE_NAME status" to get ready info
>
>++++
>
>and one again my mtx-changer.conf is:
>
>firstslot=1     #### 1st tape slot
>lastslot=6      #### Last tape slot
>cleanslot=6     #### Slot with cleaner tape
>
># Do you want to clean the drive after a certain number of
> accesses? # NOTE - This is unreliable, since 'accesses' aren't
> 'uses', and we # have no reliable way to count this. A single
> amcheck could # generate as many accesses as slots you have, plus
> 1.
># ALSO NOTE - many modern tape loaders handle this automatically.
>
>AUTOCLEAN=0     #### Set to '1' or greater to enable
>
>autocleancount=99       #### Number of access before a clean.
>
>havereader=0    #### If you have a barcode reader, set to 1.
>
>offlinestatus=1 #### Set to 0 if 'mt status' gives an
>                #### "offline" when drive is offline.
>                #### Set to 1 or greater if 'mt status'
>                #### doesn't give and offline, rather an
>                #### "ONLINE" when drive is online.
>
>OFFLINE_BEFORE_UNLOAD=0 #### Does your tape driver require a
>                        #### 'mt offline' before mtx unload?
>
>
>+++
>
>Thanks again to everyone for their continued help
>
>-- Still scratching my head.
>
>
>[This E-mail scanned for viruses by Declude Virus]

-- 
Cheers, Gene
AMD K6-III@500mhz 320M
Athlon1600XP@1400mhz  512M
99.23% setiathome rank, not too shabby for a WV hillbilly

<Prev in Thread] Current Thread [Next in Thread>