Amanda-Users

Re: New tapetype

2003-02-04 11:54:49
Subject: Re: New tapetype
From: Gene Heskett <gene_heskett AT iolinc DOT net>
To: John Cunningham <johnw_cunningham AT yahoo DOT com>, amanda-users AT amanda DOT org
Date: Tue, 4 Feb 2003 11:17:19 -0500
On Tuesday 04 February 2003 10:10, John Cunningham wrote:
>Gene,
>Thanks - I was wondering about that.  I'm using /dev/nst0 - do I
> need use a different device to avoid compression?  I'm really new
> to this - thanks for the help.  I'm posting a follow up with some
> SCSI issues I had in setup this morning... -John

No, that device is fine, and required by amanda as thats the 
non-rewinding device.

Linux does not have a compressed/non-compressed selection in its 
device types.  So that means you will need to look up where the 
dip-switches are on your drive, and set them to the no-compression 
position.  Unforch, that tape you used (and any others also written 
by this drive) will now have a compression flag set in a tape 
header that is not accessable to the user at the head end of the 
tape.  When you insert the tape, the drive reads that header in the 
process of discovering what knd of a tape this one is, and it will 
find that flag turned on and will turn the compression back on 
silently and relentlessly.

To turn it off, one must use a combination of mt to run the drive, 
and dd to write to it. The basic idea is to rewind the tape, use mt 
to turn the compression off (see the docs on your version of mt, 
they've recently been playing with it) and then write enough data 
to the drive that its forced to flush its buffers.  At this point 
it will re-write that hidden header with the compression flags off 
and that tape will then be fixed to show a no compression 
preference setting when it is subsequently re-inserted nto the 
drive.

Something like this:
mt -f /dev/nst0 rewind
## save the tapes label
dd if=/dev/st0 of=./scratch bs=32k count=1
mt -d /dev/nst0 defcompression -1 (or off, depends on your mt)
## most drives have at least a 4 meg (131072 blocks of 32768 bytes) 
## buffer, so overrun it
dd if=/dev/zero of=/dev/st0 bs=32k count=131073
## restore the label
dd if=./scratch of=/dev/st0 bs=32k count=1
## then to show the restored label and make us feel better
dd if=/dev/st0
##which will spit out the restored label onscreen.

Now, if that drive has a compression status led, it should be off.  
My Seagate 4 slotter has such an led in the front of the drawer.

One could make a script out of this, and put it to run 30 minutes 
ahead of amdump so that as the tapes come around in the rotation, 
they will be fixed, but you will have that data available for 
recoveries up till that point 30 minutes before they were 
schedueled to be overwritten anyway.  Let it run till all tapes 
have beeb treated, then disable the crontab entry.

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

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