Re: Disable Tape Compression

2005-10-04 Thread Gene Heskett
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.



Re: Disable Tape Compression

2005-10-04 Thread Sven Rudolph
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




Re: Disable Tape Compression

2005-09-30 Thread Jon LaBadie
On Fri, Sep 30, 2005 at 02:10:51PM +0200, [EMAIL PROTECTED] wrote:
> Hi Listers,
> 
...
> 
> BTW: Is it true that a tape formerly written with hw-compression will
> "override" the 'drive compression off setting' because the compression
> on/off status has been written on the header of the tape? If yes, I should
> "reformat" a lot of tapes as described by Gene :-/

First, any tape written with HW compression will cause the drive to
switch modes when the data is read.

The problem comes when that switch persists during writes even though
you might have tried to set the device to no-compression.

Some OS, eg solaris, have different device names for compressed writes
and uncompressed writes.  No quibbles there, whatever the current mode
of the device, it is switched to the mode of the device.

The standard st and nst devices on Linux do no behave this way.  They
use whatever is the current mode of the tape.

At the start of tape operations amanda checks the identity of the tape
by reading the header and therein lies the problem.

- you have a tape with hw compress data
- you want to use is without hw compress so you do some mt magic
  hand wave and sure enough the tape is in no-hw-compress mode
- you start an amanda operation
- amanda reads the hw compressed data -- the tape drive switches mode
- now amanda writes but hw compression is on because of the header read

-- 
Jon H. LaBadie  [EMAIL PROTECTED]
 JG Computing
 4455 Province Line Road(609) 252-0159
 Princeton, NJ  08540-4322  (609) 683-7220 (fax)


Re: Disable Tape Compression

2005-09-30 Thread Paul Bijnens

[EMAIL PROTECTED] wrote:

Hi Listers,

Just to give my 0.02EUR



mt -f /dev/nst0 defcompression off (or 0 depending on your mt)
mt -f /dev/nst0 compression off (or 0 depending on your mt)



I am running SuSE 9.3 and the only available mt operation is
"datcompression"

See:
athene:~ # mt --version
GNU mt version 2.5


You need the "mt-st" program (or maybe "mtst") that does implement
the above controls.



BTW: Is it true that a tape formerly written with hw-compression will
"override" the 'drive compression off setting' because the compression
on/off status has been written on the header of the tape? If yes, I should
"reformat" a lot of tapes as described by Gene :-/



At least some versions of linux had it.  In my current environment
I cannot reproduce it anymore.

See:
http://marc.theaimsgroup.com/?l=amanda-users&m=112437658422585&w=2
http://marc.theaimsgroup.com/?l=amanda-users&m=112628055729242&w=2


--
Paul Bijnens, XplanationTel  +32 16 397.511
Technologielaan 21 bus 2, B-3001 Leuven, BELGIUMFax  +32 16 397.512
http://www.xplanation.com/  email:  [EMAIL PROTECTED]
***
* I think I've got the hang of it now:  exit, ^D, ^C, ^\, ^Z, ^Q, ^^, *
* F6, quit, ZZ, :q, :q!, M-Z, ^X^C, logoff, logout, close, bye, /bye, *
* stop, end, F3, ~., ^]c, +++ ATH, disconnect, halt,  abort,  hangup, *
* PF4, F20, ^X^X, :D::D, KJOB, F14-f-e, F8-e,  kill -1 $$,  shutdown, *
* init 0, kill -9 1, Alt-F4, Ctrl-Alt-Del, AltGr-NumLock, Stop-A, ... *
* ...  "Are you sure?"  ...   YES   ...   Phew ...   I'm out  *
***




Re: Disable Tape Compression

2005-09-30 Thread Gene Heskett
On Friday 30 September 2005 08:10, [EMAIL PROTECTED] wrote:
>Hi Listers,
>
>Just to give my 0.02EUR
>
>> > mt -f /dev/nst0 defcompression off (or 0 depending on your mt)
>> > mt -f /dev/nst0 compression off (or 0 depending on your mt)
>
>I am running SuSE 9.3 and the only available mt operation is
>"datcompression"
>
>See:
>athene:~ # mt --version
>GNU mt version 2.5
>athene:~ # man mt
>[...]
> datcompression
>  (some  SCSI-2  DAT  tapes) Inquire or set the
compression
>status
>  (on/off). If the count is one the compression status is
>printed.
>  If  the  count is zero, compression is disabled.
> Otherwise, com-
>  pression is enabled. The command uses the SCSI ioctl to
> read and
>  write  the Data Compression Characteristics mode page
> (15). ONLY
>  ROOT CAN USE THIS COMMAND.
>
>
>And in fact I do have the problem that I use at one site the Tandberg
> SLR7 without knowing how to switch off hw-compression. The mt
> datcompression {off|0} operation fails. That leads to my
amanda.conf:
>
>define tapetype SLR7 {
>comment "just produced by tapetype prog (hardware compression
on)"
>length 16500 mbytes# Manually decreased again
>filemark 186 kbytes
>speed 1300 kps
>}
>
>athene:~ # dmesg | grep SLR
>  Vendor: TANDBERG  Model: SLR7  Rev: 0483
>  Type:   Sequential-Access  ANSI SCSI revision: 02
>Attached scsi tape st0 at scsi0, channel 0, id 3, lun 0
>st0: try direct i/o: yes (alignment 512 B), max page reachable by HBA
>1048575
>
>
>BTW: Is it true that a tape formerly written with hw-compression will
>"override" the 'drive compression off setting' because the
compression
>on/off status has been written on the header of the tape? If yes, I
> should "reformat" a lot of tapes as described by Gene :-/
>
>
>Best regards
>Uwe

I believe thats pretty much the universal case, Uwe.  Think about
it... Otherwise, how would the drive ascertain if the tapes data
needed to be run thru the hardware decompression to make it valid
data?  The only other 'by the tape' method of defining it would be a
slider button on the tape.  But that could be moved by accident, so
if I were designing such a device, I'd 'simplicate' that option
out of the design before it ever hit the production line.  But thats
just the Old Farts thinking, based on 57 years of steering electrons
for a living.  I'll be 71 next week.

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



RE: Disable Tape Compression

2005-09-30 Thread Chuck Amadi Systems Administrator
Here's my output

#mt -f /dev/nst0 status
drive type = Generic SCSI-2 tape
drive status = 637534208
sense key error = 0
residue count = 0
file number = 0
block number = 1
Tape block size 0 bytes. Density code 0x26 (unknown).
Soft error count since last status=0
General status bits on (101):

The last but on line BOT ONLINE IM_REP_EN - tape drive is online and
ready.

I am afraid I don't know the message - Can't write mode page.

All the best





On Fri, 2005-09-30 at 14:31 +0200, [EMAIL PROTECTED] wrote:
> Hi Chuck,
> 
> You are right but unfortunately my Tandberg SLR fails on that operation. It
> worked well with all my HP drives.
> 
> Have a look:
> 
> minerva:~ # mt -f /dev/nst0 status
> drive type = Generic SCSI-2 tape
> drive status = 838861312
> sense key error = 0
> residue count = 0
> file number = 0
> block number = 0
> Tape block size 512 bytes. Density code 0x32 (unknown).
> Soft error count since last status=0
> General status bits on (4101):
>  BOT ONLINE IM_REP_EN
> minerva:~ # mt -f /dev/nst0 datcompression 0
> Can't write mode page.
> mt: /dev/nst0
> 
> 
> Thanks
> Uwe
> 
> 
> > -Original Message-
> > From: Chuck Amadi Systems Administrator [mailto:[EMAIL PROTECTED]
> > Sent: Friday, September 30, 2005 2:25 PM
> > To: [EMAIL PROTECTED]
> > Cc: Amanda List
> > Subject: RE: Disable Tape Compression
> > 
> > 
> > Hi 
> > 
> > My org uses SuSE 9 SLES servers and I used the following commands.
> > 
> > Turn off datacompression as Root run mt command that controls magnetic
> > tape
> > drive operation.
> > 
> > # Check datacompression status
> > myserver:~ # mt -f /dev/nst0 status
> > 
> > # Turns datacompression off 
> > myserver:~ # mt -f /dev/nst0 datcompression 0
> > Compression off.
> > 
> > I hope this helps if not someone on the list will guide you as I have
> > made a lot of progress thru this mailinf list.
> > 
> > Cheers
> > 
> > 
> > On Fri, 2005-09-30 at 14:10 +0200, [EMAIL PROTECTED] wrote:
> > > Hi Listers,
> > > 
> > > Just to give my 0.02EUR
> > > 
> > > > > mt -f /dev/nst0 defcompression off (or 0 depending on your mt)
> > > > > mt -f /dev/nst0 compression off (or 0 depending on your mt)
> > > 
> > > I am running SuSE 9.3 and the only available mt operation is
> > > "datcompression"
> > > 
> > > See:
> > > athene:~ # mt --version
> > > GNU mt version 2.5
> > > athene:~ # man mt
> > > [...]
> > >  datcompression
> > >   (some  SCSI-2  DAT  tapes) Inquire or set the 
> > compression
> > > status
> > >   (on/off). If the count is one the compression 
> > status is
> > > printed.
> > >   If  the  count is zero, compression is 
> > disabled. Otherwise,
> > > com-
> > >   pression is enabled. The command uses the 
> > SCSI ioctl to read
> > > and
> > >   write  the Data Compression Characteristics 
> > mode page (15).
> > > ONLY
> > >   ROOT CAN USE THIS COMMAND.
> > > 
> > > 
> > > And in fact I do have the problem that I use at one site 
> > the Tandberg SLR7
> > > without knowing how to switch off hw-compression. The mt 
> > datcompression
> > > {off|0} operation fails. That leads to my amanda.conf:
> > > 
> > > define tapetype SLR7 {
> > > comment "just produced by tapetype prog (hardware 
> > compression on)"
> > > length 16500 mbytes   # Manually decreased again
> > > filemark 186 kbytes
> > > speed 1300 kps
> > > }
> > > 
> > > athene:~ # dmesg | grep SLR
> > >   Vendor: TANDBERG  Model: SLR7  Rev: 0483
> > >   Type:   Sequential-Access  ANSI SCSI revision: 02
> > > Attached scsi tape st0 at scsi0, channel 0, id 3, lun 0
> > > st0: try direct i/o: yes (alignment 512 B), max page 
> > reachable by HBA
> > > 1048575
> > > 
> > > 
> > > BTW: Is it true that a tape formerly written with 
> > hw-compression will
> > > "override" the 'drive compression off setting' because the 
> > compression
> > > on/off status has been written on the header of the tape? 
> > If yes, I should
> > > "reformat" a lot of tapes as described by Gene :-/
> > > 
> > > 
> > > Best regards
> > > Uwe
> > > 
> > > 
> > > 
> > > Virus checked by G DATA AntiVirusKit
> > > Version: AVK 16.727 from 30.09.2005
> > > 
> > -- 
> > Unix/ Linux Systems Administrator
> > Chuck Amadi
> > The Surgical Material Testing Laboratory (SMTL), 
> > Princess of Wales Hospital 
> > Coity Road 
> > Bridgend, 
> > United Kingdom, CF31 1RQ.
> > Email chuck.smtl.co.uk
> > Tel: +44 1656 752820 
> > Fax: +44 1656 752830
> > 
> > 
> > 
> > 
> > 
> 
> 
> 
> Virus checked by G DATA AntiVirusKit
> Version: AVK 16.727 from 30.09.2005
> 
-- 
Unix/ Linux Systems Administrator
Chuck Amadi
The Surgical Material Testing Laboratory (SMTL), 
Princess of Wales Hospital 
Coity Road 
Bridgend, 
United Kingdom, CF31 1RQ.
Email chuck.smtl.co.uk
Tel: +44 1656 752820 
Fax: +44 1656 752830




RE: Disable Tape Compression

2005-09-30 Thread Chuck Amadi Systems Administrator
Hi 

My org uses SuSE 9 SLES servers and I used the following commands.

Turn off datacompression as Root run mt command that controls magnetic
tape
drive operation.

# Check datacompression status
myserver:~ # mt -f /dev/nst0 status

# Turns datacompression off 
myserver:~ # mt -f /dev/nst0 datcompression 0
Compression off.

I hope this helps if not someone on the list will guide you as I have
made a lot of progress thru this mailinf list.

Cheers


On Fri, 2005-09-30 at 14:10 +0200, [EMAIL PROTECTED] wrote:
> Hi Listers,
> 
> Just to give my 0.02EUR
> 
> > > mt -f /dev/nst0 defcompression off (or 0 depending on your mt)
> > > mt -f /dev/nst0 compression off (or 0 depending on your mt)
> 
> I am running SuSE 9.3 and the only available mt operation is
> "datcompression"
> 
> See:
> athene:~ # mt --version
> GNU mt version 2.5
> athene:~ # man mt
> [...]
>  datcompression
>   (some  SCSI-2  DAT  tapes) Inquire or set the compression
> status
>   (on/off). If the count is one the compression status is
> printed.
>   If  the  count is zero, compression is disabled. Otherwise,
> com-
>   pression is enabled. The command uses the SCSI ioctl to read
> and
>   write  the Data Compression Characteristics mode page (15).
> ONLY
>   ROOT CAN USE THIS COMMAND.
> 
> 
> And in fact I do have the problem that I use at one site the Tandberg SLR7
> without knowing how to switch off hw-compression. The mt datcompression
> {off|0} operation fails. That leads to my amanda.conf:
> 
> define tapetype SLR7 {
> comment "just produced by tapetype prog (hardware compression on)"
> length 16500 mbytes   # Manually decreased again
> filemark 186 kbytes
> speed 1300 kps
> }
> 
> athene:~ # dmesg | grep SLR
>   Vendor: TANDBERG  Model: SLR7  Rev: 0483
>   Type:   Sequential-Access  ANSI SCSI revision: 02
> Attached scsi tape st0 at scsi0, channel 0, id 3, lun 0
> st0: try direct i/o: yes (alignment 512 B), max page reachable by HBA
> 1048575
> 
> 
> BTW: Is it true that a tape formerly written with hw-compression will
> "override" the 'drive compression off setting' because the compression
> on/off status has been written on the header of the tape? If yes, I should
> "reformat" a lot of tapes as described by Gene :-/
> 
> 
> Best regards
> Uwe
> 
> 
> 
> Virus checked by G DATA AntiVirusKit
> Version: AVK 16.727 from 30.09.2005
> 
-- 
Unix/ Linux Systems Administrator
Chuck Amadi
The Surgical Material Testing Laboratory (SMTL), 
Princess of Wales Hospital 
Coity Road 
Bridgend, 
United Kingdom, CF31 1RQ.
Email chuck.smtl.co.uk
Tel: +44 1656 752820 
Fax: +44 1656 752830




RE: Disable Tape Compression

2005-09-30 Thread uwe . kaufmann
Hi Listers,

Just to give my 0.02EUR

> > mt -f /dev/nst0 defcompression off (or 0 depending on your mt)
> > mt -f /dev/nst0 compression off (or 0 depending on your mt)

I am running SuSE 9.3 and the only available mt operation is
"datcompression"

See:
athene:~ # mt --version
GNU mt version 2.5
athene:~ # man mt
[...]
 datcompression
  (some  SCSI-2  DAT  tapes) Inquire or set the compression
status
  (on/off). If the count is one the compression status is
printed.
  If  the  count is zero, compression is disabled. Otherwise,
com-
  pression is enabled. The command uses the SCSI ioctl to read
and
  write  the Data Compression Characteristics mode page (15).
ONLY
  ROOT CAN USE THIS COMMAND.


And in fact I do have the problem that I use at one site the Tandberg SLR7
without knowing how to switch off hw-compression. The mt datcompression
{off|0} operation fails. That leads to my amanda.conf:

define tapetype SLR7 {
comment "just produced by tapetype prog (hardware compression on)"
length 16500 mbytes # Manually decreased again
filemark 186 kbytes
speed 1300 kps
}

athene:~ # dmesg | grep SLR
  Vendor: TANDBERG  Model: SLR7  Rev: 0483
  Type:   Sequential-Access  ANSI SCSI revision: 02
Attached scsi tape st0 at scsi0, channel 0, id 3, lun 0
st0: try direct i/o: yes (alignment 512 B), max page reachable by HBA
1048575


BTW: Is it true that a tape formerly written with hw-compression will
"override" the 'drive compression off setting' because the compression
on/off status has been written on the header of the tape? If yes, I should
"reformat" a lot of tapes as described by Gene :-/


Best regards
Uwe



Virus checked by G DATA AntiVirusKit
Version: AVK 16.727 from 30.09.2005


Re: Disable Tape Compression

2005-09-30 Thread Stefan G. Weichinger
Gene Heskett wrote:

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

Gene, thanks a lot, I think this should go into the FAQ soon.
Could you (or somebody else) write some additional intro about why and
when this procedure is necessary?

This would help a lot, thanks.

Greets, Stefan


Re: Disable Tape Compression

2005-09-29 Thread Gene Heskett
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..

>
>-- Original Message --
>Received: Thu, 29 Sep 2005 02:29:47 PM MDT
>From: Gene Heskett <[EMAIL PROTECTED]>
>To: amanda-users@amanda.org
>Subject: Re: Disable Tape Compression
>
>> On Thursday 29 September 2005 12:08, Christopher Davis wrote:
>> >I'm using Amanda on Fedora Core 4 with a Quantum SDLT 220 tape drive
>> > - I want to disable hardware compression but I'm not sure of the
>> > best way to do that.
>> >
>> >I can issue a command mt -f /dev/nst0 defcompression 1 which seems to
>> > work (amtapetype doesn't give me the warning about hardware
>> > compresion) but as I understand it this change goes away as soon as
>> > I change tapes. Meaning each time I insert a new tape I have to
>> > re-enter this command?
>>
>> defcompression 1 turns it on, not off.  And there is probably a
>> dipswitch of jumper setting someplace on the drive to turn it on
>> permanently IF thats what you want.  Check your docs on the drive.
>>
>> However, running hardware compression hides the tapes true size from
>> amanda, so you have to make an educated guess in setting the
>> tapetypes 'size'.  Amanda meas7ures the amount of data sent down the
>> cable to the drive, and if amanda is doing the compression, which can
>> handily beat the hardwares compression ratio in many cases, then
>> amanda knows exactly how much the tape can hold.
>>
>> So, generally speaking, we don't recommend hardware compression.  To
>> give you an idea of how good the 'compress best' can be, I have a
>> report of from of my recent runs that, with a 48 entry disklist, some
>> compressed and some not, still put a bit over 17GB of real data in
>> about 7.5GB of storage space used.   It won't do that every night of
>> course, but often enough to pay for the cpu power it takes.
>>
>> >How can I make the change permanent so that I don't have to worry
>> > about manually changing a settting?
>> >
>> >
>> >Any ideas or help would be much appreciated.
>> >
>> >
>> >Chris
>>
>> --
>> 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.

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



Re: Disable Tape Compression

2005-09-29 Thread Jon LaBadie
On Thu, Sep 29, 2005 at 03:06:44PM -0600, Christopher Davis wrote:
> 
> 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.


That would be a nice addition to the list archives.


-- 
Jon H. LaBadie  [EMAIL PROTECTED]
 JG Computing
 4455 Province Line Road(609) 252-0159
 Princeton, NJ  08540-4322  (609) 683-7220 (fax)


Re: Disable Tape Compression

2005-09-29 Thread Christopher Davis
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.




-- Original Message --
Received: Thu, 29 Sep 2005 02:29:47 PM MDT
From: Gene Heskett <[EMAIL PROTECTED]>
To: amanda-users@amanda.org
Subject: Re: Disable Tape Compression

> On Thursday 29 September 2005 12:08, Christopher Davis wrote:
> >I'm using Amanda on Fedora Core 4 with a Quantum SDLT 220 tape drive - I
> > want to disable hardware compression but I'm not sure of the best way
> > to do that.
> >
> >I can issue a command mt -f /dev/nst0 defcompression 1 which seems to
> > work (amtapetype doesn't give me the warning about hardware compresion)
> > but as I understand it this change goes away as soon as I change tapes.
> >  Meaning each time I insert a new tape I have to re-enter this command?
> >
> defcompression 1 turns it on, not off.  And there is probably a
> dipswitch of jumper setting someplace on the drive to turn it on
> permanently IF thats what you want.  Check your docs on the drive.
> 
> However, running hardware compression hides the tapes true size from
> amanda, so you have to make an educated guess in setting the
> tapetypes 'size'.  Amanda meas7ures the amount of data sent down the
> cable to the drive, and if amanda is doing the compression, which can
> handily beat the hardwares compression ratio in many cases, then
> amanda knows exactly how much the tape can hold.
> 
> So, generally speaking, we don't recommend hardware compression.  To
> give you an idea of how good the 'compress best' can be, I have a
> report of from of my recent runs that, with a 48 entry disklist, some
> compressed and some not, still put a bit over 17GB of real data in
> about 7.5GB of storage space used.   It won't do that every night of
> course, but often enough to pay for the cpu power it takes.
> >
> >How can I make the change permanent so that I don't have to worry about
> >manually changing a settting?
> >
> >
> >Any ideas or help would be much appreciated.
> >
> >
> >Chris
> 
> -- 
> 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.
> 
> 






Re: Disable Tape Compression

2005-09-29 Thread Gene Heskett
On Thursday 29 September 2005 12:08, Christopher Davis wrote:
>I'm using Amanda on Fedora Core 4 with a Quantum SDLT 220 tape drive - I
> want to disable hardware compression but I'm not sure of the best way
> to do that.
>
>I can issue a command mt -f /dev/nst0 defcompression 1 which seems to
> work (amtapetype doesn't give me the warning about hardware compresion)
> but as I understand it this change goes away as soon as I change tapes.
>  Meaning each time I insert a new tape I have to re-enter this command?
>
defcompression 1 turns it on, not off.  And there is probably a
dipswitch of jumper setting someplace on the drive to turn it on
permanently IF thats what you want.  Check your docs on the drive.

However, running hardware compression hides the tapes true size from
amanda, so you have to make an educated guess in setting the
tapetypes 'size'.  Amanda meas7ures the amount of data sent down the
cable to the drive, and if amanda is doing the compression, which can
handily beat the hardwares compression ratio in many cases, then
amanda knows exactly how much the tape can hold.

So, generally speaking, we don't recommend hardware compression.  To
give you an idea of how good the 'compress best' can be, I have a
report of from of my recent runs that, with a 48 entry disklist, some
compressed and some not, still put a bit over 17GB of real data in
about 7.5GB of storage space used.   It won't do that every night of
course, but often enough to pay for the cpu power it takes.
>
>How can I make the change permanent so that I don't have to worry about
>manually changing a settting?
>
>
>Any ideas or help would be much appreciated.
>
>
>Chris

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



RE: Disable Tape Compression

2005-09-29 Thread Christopher Davis
There are no DIP switches that I can find - its a Sun Enclure (SDLT 220 unit) 
around a Quantum TR-S13AA.


Chris

-- Original Message --
Received: Thu, 29 Sep 2005 10:33:50 AM MDT
From: "Scott R. Burns" <[EMAIL PROTECTED]>
To: "Christopher Davis" <[EMAIL PROTECTED]>, 
Subject: RE: Disable Tape Compression

> Are there any dip switches on the drive ? My HP DAT24x6 has a dip switch
> bank on the bottom which turns off compression in the HW. I don't see any
> indication of that in your drives manual.
> 
> Scott..
> 
> Scott R. Burns
> NETCON Technologies Incorporated
> Suite 135 - 4474 Blakie Road
> London, Ontario, Canada
> N6L 1G7
> Voice: +1.519.652.0401
> Fax: +1.519.652.9275
> Web: www.netcontech.com
> 
> -Original Message-
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] Behalf Of Christopher Davis
> Sent: Thursday, September 29, 2005 12:09 PM
> To: amanda-users@amanda.org
> Subject: Disable Tape Compression
> 
> 
> I'm using Amanda on Fedora Core 4 with a Quantum SDLT 220 tape drive - I
> want
> to disable hardware compression but I'm not sure of the best way to do
that.
> 
> I can issue a command mt -f /dev/nst0 defcompression 1 which seems to work
> (amtapetype doesn't give me the warning about hardware compresion) but as I
> understand it this change goes away as soon as I change tapes.  Meaning
each
> time I insert a new tape I have to re-enter this command?
> 
> 
> How can I make the change permanent so that I don't have to worry about
> manually changing a settting?
> 
> 
> Any ideas or help would be much appreciated.
> 
> 
> Chris
> 
> 
> 
> 
> 






RE: Disable Tape Compression

2005-09-29 Thread Scott R. Burns
Are there any dip switches on the drive ? My HP DAT24x6 has a dip switch
bank on the bottom which turns off compression in the HW. I don't see any
indication of that in your drives manual.

Scott..

Scott R. Burns
NETCON Technologies Incorporated
Suite 135 - 4474 Blakie Road
London, Ontario, Canada
N6L 1G7
Voice: +1.519.652.0401
Fax: +1.519.652.9275
Web: www.netcontech.com

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of Christopher Davis
Sent: Thursday, September 29, 2005 12:09 PM
To: amanda-users@amanda.org
Subject: Disable Tape Compression


I'm using Amanda on Fedora Core 4 with a Quantum SDLT 220 tape drive - I
want
to disable hardware compression but I'm not sure of the best way to do that.

I can issue a command mt -f /dev/nst0 defcompression 1 which seems to work
(amtapetype doesn't give me the warning about hardware compresion) but as I
understand it this change goes away as soon as I change tapes.  Meaning each
time I insert a new tape I have to re-enter this command?


How can I make the change permanent so that I don't have to worry about
manually changing a settting?


Any ideas or help would be much appreciated.


Chris