bug-tar
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug-tar] tar --append corrupts ustar-format archive


From: Adye, TJ \(Tim\)
Subject: [Bug-tar] tar --append corrupts ustar-format archive
Date: Thu, 10 Feb 2005 14:53:25 -0000

Hi,

Thanks to Sergey's fix to my problem with tar --append [1], I have been
happily using GNU tar to archive our data. I have been using the ustar
format in case we need to read it back with Solaris tar (I found that
the default GNU format isn't compatible when there are long filenames).
That has worked fine archiving many millions of files, but unfortunately
with some recent data, I think I have found a bug.

The bug seems to occur when appending to an archive, with files names of
a particular length. Fortunately I found this little example that shows
the problem without having to reproduce my dataset.

#!/bin/sh
tar="tar-1.15.1 -Hustar -f tarfile.tar"
dir=groups/skims/isPhysicsEvents/0000/9900/P10.2.3gV06fb/00009974/cb001/
Skim1044cObjy/P0000/Kanga1046cAllEvents/P0000/KangaIndexSkim1240g/P0000/
BC
file=BCMuMuKanga-skim.root
set -x
mkdir -p $dir
touch $dir/${file}1 $dir/${file}2
$tar -c $dir/${file}1
$tar -r $dir/${file}2
$tar -tv

This runs up to the final command, which shows that the archive was
corrupted by the tar -r (--append).

+ tar-1.15.1 -Hustar -f tarfile.tar -tv
tar-1.15.1: This does not look like a tar archive
tar-1.15.1: Skipping to next header
-rw-r--r-- adye/bfactory     0 2005-02-10 14:37:22
groups/skims/isPhysicsEvents/0000/9900/P10.2.3gV06fb/00009974/cb001/Skim
1044cObjy/P0000/Kanga1046cAllEvents/P0000/KangaIndexSkim1240g/P0000/BC/B
CMuMuKanga-skim.root2
tar-1.15.1: Error exit delayed from previous errors

This example can be made to work by, eg. removing the initial "groups/"
from the directory name, by using the default GNU format (removing the
-Hustar option), or by archiving a larger file (eg. 10k instead of
0-bytes - though I have occasionally seen the problem with the larger
files of my dataset). Unfortunately I can't pick and choose my filenames
or the file sizes, and I am keen to maintain Solaris tar compatibility.

I see this problem with GNU tar 1.14.1 and 1.15.1 on RedHat Linux 7.2
and Scientific Linux 3.0.3. I can try some more tests if you can't
reproduce the problem, but I'm guessing that it's not OS-specific.

Can someone help?

Thanks,
Tim.

[1] http://lists.gnu.org/archive/html/bug-tar/2004-05/msg00029.html

==============================  cut here  ==============================
Tim Adye, BaBar Group, Particle Physics Dept.,             _   /|
          Rutherford Appleton Laboratory, UK.              \'o.O'   Oop!
e-mail:   address@hidden                                =(___)=  Ack!
WWW:      http://hepwww.rl.ac.uk/Delphi/Adye/homepage.html    U  Thphft!




reply via email to

[Prev in Thread] Current Thread [Next in Thread]