Amanda-Users

Re: mt commands at amdump startup

2002-11-16 15:16:02
Subject: Re: mt commands at amdump startup
From: Gene Heskett <gene_heskett AT iolinc DOT net>
To: marius AT overalt DOT no, amanda-users AT amanda DOT org
Date: Sat, 16 Nov 2002 14:40:30 -0500
On Saturday 16 November 2002 13:18, Marius Sorteberg wrote:
>Hi list,
>
>I use Amanda2.4.3 on FreeBSD 4.7, compiled from ports.
>My tapedevice is a DLT 15/30.
>
>I recently switched to software compression, and therefore whish
> to disable hardware compression. This is done with "mt comp off"
> on FreeBSD, and works well on my hardware. The tapedevice is
> external, in it's own case (the backup server is 1U).
>
>The "mt " command is lost after a reboot, or a powercycle on the
> tapedevice. A small script, run by cron would solve this, but is
> it "a better way"?
>
>I guess I'm looking for a setting in amanda.conf.
>
>Regards Marius Sorteberg

The most dependable way would be to raise the hood with manual in 
hand so you can locate and set the dipswitch that most likely 
controls that.

Bear in mind that some tape formats also store this setting on the 
tape, and one must cause a flush to the media after doing this 
without giving the drive a chance to re-read and reset this 
variable.  Doing the flush will cause it to re-write that hidden 
header data with the compression turned off.  This of course is on 
a tape by tape basis, so one must treat all tapes in the cycle to 
turn this off.  Because that effectively wipes the tape, do it to 
each in sequence immediately before amanda re-uses it.  You may 
have to write a short script to do this, and do it from crontab 
about 15 minutes before amanda starts.
In your script, save the tape header block before doing this, and 
restore it after (use dd) to keep amanda from upchucking because it 
can't find the tape its expecting.  It should look something like 
this, using the non-rewinding device for /dev/tape:
-----------------
mt -f /dev/tape rewind
# save this tapes id header
dd if=/dev/tape of=scratch count=1
mt -f /dev/tape rewind
# one of thses should hit it
mt -f /dev/tape compression off
mt -f /dev/tape defcompression off
mt -f /dev/tape datcompression off
# now force huge write to flush buffers to tape
# don't use /dev/urandom, doesn't always work for this
dd if=/dev/zero of=/dev/tape bs=32k count=65535
mt -f /dev/tape rewind
# restore header for amanda
dd if=scratch of=dev/tape
mt -f /dev/tape rewind
---------------
Which should do it.

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

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