On Tuesday 04 October 2005 03:20, Sven Rudolph wrote: >Gene Heskett <[EMAIL PROTECTED]> writes: >> On Thursday 29 September 2005 17:06, Christopher Davis wrote: >>>The drive doesn't have any dip switches - I even took the drive out of >>> the encosure and couldn't find anything. >>> >>>I copied the wrong mt command over - >>> >>>Where I'm at now is looking at stinit ant the /etc/stinig.def file to >>> create a /dev/nst0l device which disables compression - I'm in the >>> middle of another test right now and can't try it out just yet - but >>> if this works for me I'll send it to the list. We have a ton of >>> these Sun SDLT 220 drives floating around and want to use them. >>> >>> >>>I ran some tests using hardware compression and wasn't impressed with >>> the results so I'm trying it with it off. >> >> Be aware that for many tape formats, the compression status is saved >> in a hidden header of the tape, so that once its been written in the >> compression on mode, that will be restored to on when the >> tape is loaded regardless of your wishes unless specifically disabled. >> >> I had a script at one time that turned these flags off, and it looked >> something like this: >> >> #!/bin/sh >> mt -f /dev/nst0 rewind >> dd if=/dev/st0 of=./scratch count=1 >> mt -f /dev/nst0 defcompression off (or 0 depending on your mt) >> mt -f /dev/nst0 compression off (or 0 depending on your mt) >> dd if=./scratch of =/dev/nst0 >> dd if=/dev/zero of=/dev/st0 count=(your drives buffer size plus 1) >> dd if=/dev/st0 (should show the tape label unchanged from ./scratch) >> >> Note use of /dev/st0 for its automatic rewind in places. simplifies >> the script.. > >I use a bit less magic (it is enough to overwrite the first block on >tape (SDLT220/SDLT600)); see below. And in my do_amdump (a wrapper >around amdump) I have: > > /usr/sbin/amtape DailySet1 taper > > /usr/local/bin/erase_tape /dev/st2 > >(Some time ago we had a discussion on having a hook to run a command >when a tape is to be written, but we didn't find a good solution.) > > Sven >----- >host:~# cat /usr/local/bin/erase_tape >#!/bin/sh > >tapedev=$1 >labelfile=$(tempfile) > >mt -f $tapedev rewind > >dd if=$tapedev of=$labelfile bs=32k count=1 > >sudo unset_tape_compression $tapedev > >dd if=$labelfile of=$tapedev bs=32k count=1 > > > >host:~# cat /usr/local/bin/unset_tape_compression >#!/bin/sh > >tapedev="$1" > >case "$tapedev" in > /dev/st[0-9]) ;; > *) > echo "invalid device $tapedev" >&2 > exit 1 >esac > >mt -f $tapedev datcompression off
Neat, and with better housekeeping than some of my hacks have had. I tend to scratch the itchiest place first and when thats fixed, the rest just get a lick and a promise. Sometimes its a year before I get back to the promise :) -- Cheers, Gene "There are four boxes to be used in defense of liberty: soap, ballot, jury, and ammo. Please use in that order." -Ed Howdershelt (Author) 99.35% setiathome rank, not too shabby for a WV hillbilly Yahoo.com and AOL/TW attorneys please note, additions to the above message by Gene Heskett are: Copyright 2005 by Maurice Eugene Heskett, all rights reserved.
