tar & tape problem

I have scsi LTO3 tape attached / OpenSUSE 11.1

what happens:

linux:~ # dd if=/dev/zero of=dummy_file bs=1M count=5
5+0 records in
5+0 records out
5242880 bytes (5.2 MB) copied, 0.132575 s, 39.5 MB/s

linux:~ # mt -f /dev/nst0 tell
At block 0.
linux:~ # tar cvzf /dev/nst0 dummy_file
dummy_file
linux:~ # mt rewind
linux:~ # mt tell
At block 0.

linux:~ # tar tvzf /dev/nst0

gzip: stdin: not in gzip format
tar: Child returned status 1
tar: Error exit delayed from previous errors
linux:~ #

But…
linux:~ # tar cvzf - dummy_file | cat > /dev/nst0
dummy_file
linux:~ # mt tell
At block 3.
linux:~ # mt rewind
linux:~ # tar tvzf /dev/nst0
-rw-r–r-- root/root 5242880 2009-11-03 02:29 dummy_file
linux:~ #

So, if I put it trough pipe it is working, otherwise not.
Anybody seen something like this?

Hi
Never tried with the z option only ever used cvf on both linux and
solaris. Don’t have a tape drive hooked up on this machine anymore :frowning:

What happens if you don’t use the z option?


Cheers Malcolm °¿° (Linux Counter #276890)
SUSE Linux Enterprise Desktop 11 (x86_64) Kernel 2.6.27.37-0.1-default
up 6:47, 3 users, load average: 1.35, 1.37, 1.12
GPU GeForce 8600 GTS Silent - CUDA Driver Version: 190.18

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Two things… what did mt tell show BEFORE the first mt rewind? That
command is used after on the failing example and before on the working
example so that doesn’t help much.

Also the ‘| cat >’ is redundant… just replace that whole thing with ‘>’
to write directly to the file.

Good luck.

jedancoek wrote:
> I have scsi LTO3 tape attached / OpenSUSE 11.1
>
> what happens:
>
> linux:~ # dd if=/dev/zero of=dummy_file bs=1M count=5
> 5+0 records in
> 5+0 records out
> 5242880 bytes (5.2 MB) copied, 0.132575 s, 39.5 MB/s
>
> linux:~ # mt -f /dev/nst0 tell
> At block 0.
> linux:~ # tar cvzf /dev/nst0 dummy_file
> dummy_file
> linux:~ # mt rewind
> linux:~ # mt tell
> At block 0.
>
> linux:~ # tar tvzf /dev/nst0
>
> gzip: stdin: not in gzip format
> tar: Child returned status 1
> tar: Error exit delayed from previous errors
> linux:~ #
>
> But…
> linux:~ # tar cvzf - dummy_file | cat > /dev/nst0
> dummy_file
> linux:~ # mt tell
> At block 3.
> linux:~ # mt rewind
> linux:~ # tar tvzf /dev/nst0
> -rw-r–r-- root/root 5242880 2009-11-03 02:29 dummy_file
> linux:~ #
>
> So, if I put it trough pipe it is working, otherwise not.
> Anybody seen something like this?
>
>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQIcBAEBAgAGBQJK76vjAAoJEF+XTK08PnB56EYP/AhrIpcans8jlks+jxBmQnwx
lG8sUluXDM5r4VQH9sXHrKfipzK+GfZ3tZcsrWyB75Q0aLs5ALsh68X4B49Z7UkY
FPQiBMIw+JPXje+eaFIvFfro/yEgT5JLA0tuWKaM7UecgQZ3qPc18YbgjwF38yqM
fw1/a7+BkQfvuCHDGHWHZOPbyAIYhngtmp7KD2bNds+CZE6tXHuxNvBM0gz5TTL8
OzZgrh8Ke7KP3VJGJXnRXSibeXOCikWqwuYkV/gk9iL1T5/gtxtXl50XgfWSk8OE
2dT//pHJHdfDQ9CYH6Ics0HpHEah/vRP1kTXFwurlEAjMGzSja+bGOroMKZqu+cH
yQ96VGsrJ54phd59pyMGO0dKAIs0EAANDGCqC+Gtmlfc5J9BW19tXhLeakD3WLmY
+k3RP2/aaeco6cd7/Gb6UhdK1SiEkuJn0OYmQlpDn/X4Kq7/x8Dlmzks0c/j3GO5
lXZljaywcLgYKxwzoW1qtccje74uZHoIj2ODVDDdvevAcaJKNobeS2a9l11dR9eQ
89/zrJqb+uVjKCsy185Zu/1L4q6B5z4AhgzWn/erD/fdEcHnnAHerx4xZ2iuEZjz
xQInxJFmV4b1HGDfLo2qoG34WEeIO9ODwdB4p2HtJwAVBvVKsuGpZ8Gap9+LoPYG
GNBw9r6rZ9Y5xzTdlzXd
=IDBk
-----END PGP SIGNATURE-----

thanx guys,

lets give more info about the subject:

  • “z” - for compression doesn’t make any difference, same behavior is with “cvf” also

  • with mt options I’ve tried not to be to verbose, thats why I didn’t paste them. Actually, they to show right blocks on the dev/nst0 device. I can move trough the tape forwards and backwards. All the way I can see file blocks position - so that part works.

What does not is the fact that this behavior is totally strange for me. On other boxes, e.g. with RHEL, this actually works as it is supposed to.