SCSI tape corruption problem
Now try this:
cd ~archive
mt -f /dev/tapes/tape0 rewind
tar cvf - . | gzip -9 | dd of=/dev/tapes/tape0 bs=32k
and then:
mt -f /dev/tapes/tape0 rewind dd if=/dev/tapes/tape0 bs=32k | gzip -d | tar --compare -v -f -
The above is the proper way to talk to a tape drive through gzip.
PS: if you pre-compress, it can be wise to suppress hardware compression (mt -f /dev/nst0 datcompression 0) and maybe use a big buffer with the buffer command.
Quoted 6 lines · Marc SCHAEFER
Now try this:
cd ~archive
mt -f/dev/tapes/tape0rewind
tar cvf - . | gzip -9 | dd of=/dev/tapes/tape0 bs=32k
Quoted 6 lines
and then:
mt -f /dev/tapes/tape0 rewind dd if=/dev/tapes/tape0 bs=32k | gzip -d | tar --compare -v -f -The above is the proper way to talk to a tape drive through gzip.
So you make gzip use blocks of 32 kB.
Do you also mean it is illegal to use blocksize 10 kB (default tar, no gzip) with a tape drive??
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]
In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
Quoted 2 lines · Geert Uytterhoeven
Do you also mean it is illegal to use blocksize 10 kB (default tar, no gzip) with a tape drive??
not at all. Infact, with the default settings of the st driver, any multiple of 512 bytes is ok. The additional dd step is just there to be sure everything is fine. If gzip always outputs multiple of 512 bytes then everything is fine. I do this as precaution, since on Solaris with an old Exabyte tape if you didn't do the extra dd you had various bizarre problems. Linux is much nicer, but ...
Now if you change st defaults to e.g. variable block mode, then it changes a bit the equation: you need to read exactly the same size of block (e.g. bs=32k) else you get an error.
Variable block mode is mt -f /dev/nst0 setblk 0.
Quoted 1 line · In article <[email protected]> you…
So you make gzip use blocks of 32 kB.
no, infact it really makes it using blocks of 4k (a PIPE_SIZE is 4k), so it is really equivalent to bs=4k. dd doesn't re-join blocks when they are smaller then bs=, unless you specify obs=32k.
I have been playing with buffer recently and mixed up both. buffer is really a nice tool.
But as I said, as long as you don't play with non-fixed block size you don't have problems.
sorry for mixup.
Quoted 1 line
tar cvf - . | gzip -9 | dd of=/dev/tapes/tape0 bs=32k
I have a tool which compresses individual files in a tar archive instead of the whole archive[1]. That one tries hard to write only in standard 10kb blocks to emulate tar's behavior towards the drive. I'll try in a few days (when I'm back from holidays) if I have this error on my scsi tape too (bad) and if the compression program affects it.
Olaf
[1] <URL:http://sites.inka.de/bigred/sw/tarmill-0.22.tar.gz>