tape compression

C M Reinehr cmr at amsent.com
Thu Feb 28 08:22:30 PST 2008


On Wednesday 27 February 2008 21:05, Vu Pham wrote:
> My Linux server has a tape drive SDLT320, which is supposed to be able
> to store 320Gb data with compression.
>
> Recently when the data is more than 160Gb , I guess it is about 180Gb
> now, then the tar command ends up with the error "tar: /dev/st0: Wrote
> only 0 of 10240 bytes" which I understand as the tape is full.
>
> The data itself is mostly document, I can estimate more than half  of
> them are .doc, .xls, .eml which are compressed pretty well.
>
> It looks like the tape drive does not compress at all.
>
> Below is the mt output:
> [root at coke root]# mt -f /dev/st0 status
> SCSI 2 tape drive:
> File number=0, block number=0, partition=0.
> Tape block size 0 bytes. Density code 0x49 (Quantum SDLT320).
> Soft error count since last status=0
> General status bits on (41010000):
>   BOT ONLINE IM_REP_EN
>
>
> Do I have to run any extra command to force the tape drive to use
> compression mode ? I already tried "mt -f /dev/st0 compression 1" but it
> does not help.
>
> Any advice is greatly appreciated.
>
> Vu

Vu,

What Bill says is very true, but here are some utilities that can be very 
helpful in figuring out what's going on. The tapeinfo command which comes in 
the mtx package can tell you explicitly if your hardware data compression is 
turned on or off. Check out, also, the scsitape command from the same 
package. Finally, there is the sg3_utils package which contains a number of 
useful SCSI utilities.

Here's what the output of the tapeinfo command looks like on my system with a 
Tandberg LTO2 tapedrive:

# tapeinfo -f /dev/sg9
Product Type: Tape Drive
Vendor ID: 'TANDBERG'
Product ID: 'TS400           '
Revision: '0333'
Attached Changer: No
SerialNumber: '400055200645'
MinBlock:256
MaxBlock:524288
SCSI ID: 2
SCSI LUN: 0
Ready: yes
BufferedMode: yes
Medium Type: 0x28
Density Code: 0x42
BlockSize: 512
DataCompEnabled: yes
DataCompCapable: yes
DataDeCompEnabled: yes
CompType: 0x1
DeCompType: 0x1
BOP: yes
Block Position: 0

By the way, the command that I use to turn compression on & off is: 
mt -f /dev/nst0 defcompression 1

Another thing is that with some tape drives (or so I've read) is that the 
compression & defcompression commands do not work. You have to set the 
density code.

Cheers!

cmr

-- 
Debian 'Etch' - Registered Linux User #241964
--------
"More laws, less justice." -- Marcus Tullius Ciceroca, 42 BC



More information about the Linux-users mailing list