I think I've found a very serious bug in gtar 1.17 and I'm reporting it because the following web page mentions gtar 1.17 as good for current Amandas.

[URL="http://wiki.zmanda.com/index.php/FAQ:What_versions_of_GNU_Tar_are_Amanda-compatible%3F"]http://wiki.zmanda.com/index.php/FAQ:What_versions_of_GNU_Tar_are_Amanda-compatible%3F[/URL]

amanda@azati:test> /usr/sfw/bin/gtar --version
tar (GNU tar) 1.17
Copyright (C) 2007 Free Software Foundation, Inc.
License GPLv2+: GNU GPL version 2 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by John Gilmore and Jay Fenlason.

amanda@azati:test> uname -a
SunOS azati 5.10 Generic_141445-09 i86pc i386 i86pc

The problem is that archives created with gtar 1.17 from a ZFS filesystem with activated compression contain broken content. But the archive itself is correct and therefore Amanda doesn't notice that.


I've copied the same file to two ZFS filesystems.


amanda@azati:test> ls -la /a0/test/a0/file /a0/test/a1/file
-rw-r--r-- 1 amanda amanda 4499578880 Jul 24 17:17 /a0/test/a0/file
-rw-r--r-- 1 amanda amanda 4499578880 Jul 24 17:17 /a0/test/a1/file

The file is identical.

amanda@azati:test> cmp /a0/test/a0/file /a0/test/a1/file
amanda@azati:test> echo $?
0

But the one in /a0/test/a1 is comrpessed with ZFS compression.

amanda@azati:test> du -k /a0/test/a0/file /a0/test/a1/file
4397508 /a0/test/a0/file
3905079 /a0/test/a1/file

amanda@azati:test> df -h /a0/test/a0/file /a0/test/a1/file
Filesystem size used avail capacity Mounted on
a0/test/a0 3.6T 4.2G 694G 1% /a0/test/a0
a0/test/a1 3.6T 3.7G 694G 1% /a0/test/a1

amanda@azati:test> zfs get compression,compressratio a0/test/a0
NAME PROPERTY VALUE SOURCE
a0/test/a0 compression off default
a0/test/a0 compressratio 1.00x -
amanda@azati:test> zfs get compression,compressratio a0/test/a1
NAME PROPERTY VALUE SOURCE
a0/test/a1 compression on local
a0/test/a1 compressratio 1.12x -




Creating a tar archive, with the arguments used by Amanda, from the uncompressed ZFS filesystem works as expected.

amanda@azati:test> /usr/sfw/bin/gtar --create --file - --directory /a0/test/a0 --one-file-system --sparse --ignore-failed-read --totals --exclude-from /dev/null . > a0.gtar
Total bytes written: 4499589120 (4.2GiB, 108MiB/s)
amanda@azati:test> /usr/sfw/bin/gtar xvf a0.gtar
./
./file
amanda@azati:test> cmp file /a0/test/a0/file
amanda@azati:test> cmp file /a0/test/a1/file

But from the compressed ZFS filesystem it doesn't.

amanda@azati:test> /usr/sfw/bin/gtar --create --file - --directory /a0/test/a1 --one-file-system --sparse --ignore-failed-read --totals --exclude-from /dev/null . a1.gtar
Total bytes written: 4499578880 (4.2GiB, 103MiB/s)
amanda@azati:test> /usr/sfw/bin/gtar xvf a1.gtar
./
./file
amanda@azati:test> cmp file /a0/test/a0/file
file /a0/test/a0/file differ: char 1, line 1
amanda@azati:test> cmp file /a0/test/a1/file
file /a0/test/a1/file differ: char 1, line 1



I cannot reproduce this issue with gtar 1.26.