I've got an error when listing or extracting files from a multivolume
archive of POSIX format with a GNU volume label. The error message looks
like :
"tar: This volume is out of sequence (10737418240 - 7516203008 !=
3221207552)"
When archiving the same source data with different volume lengths, the
extracting error is probabilistic in nature. But the delta (10737418240 -
7516203008 - 3221207552) stays the same at 7680 bytes. It seems to me that
it's somehow connected with 512-bytes headers.
Latest GNU tar v1.35 used. To reproduce this error ...
0) prepare source data (use hardlinks to minimize file system usage)
# dd if=/dev/zero of=./dd-00.file bs=1024K count=10240
# ln ./dd-00.file ./dd-01.file
# ln ./dd-00.file ./dd-02.file
# ln ./dd-00.file ./dd-03.file
# ln ./dd-00.file ./dd-04.file
# ln ./dd-00.file ./dd-05.file
1) create archive
# tar -c -f archive.tar -M --posix -L 3145728 -V ARC -F ./new-volume-script
--hard-dereference dd-0*
2) list archive contents
# tar -t -M -f archive.tar -F ./new-volume-script
tar: This volume is out of sequence (10737418240 - 7516203008 != 3221207552)
tar: This volume is out of sequence (10737418240 - 7516203008 != 3221207552)
.... <endless loop>
3) extract archive
# tar -x -M -f archive.tar -F ./nvs.sh
tar: This volume is out of sequence (10737418240 - 7516203008 != 3221207552)
tar: This volume is out of sequence (10737418240 - 7516203008 != 3221207552)
.... <endless loop>
Simple new-volume-script is taken from GNU tar documentation:
#!/bin/bash
name=`expr $TAR_ARCHIVE : '\(.*\)-.*'`
case $TAR_SUBCOMMAND in
-c) ;;
-d|-t|-x) test -r ${name:-$TAR_ARCHIVE}-$TAR_VOLUME || exit 1
;;
*) exit 1
esac
echo ${name:-$TAR_ARCHIVE}-$TAR_VOLUME >&$TAR_FD