bsdtar needs --ignore-zero & --ignore-failed-read

Andrew Sinclair syncman at optusnet.com.au
Sun Nov 28 14:55:56 PST 2004


This follows on from my post to questions at freebsd.org:
    Date: 16th Nov 2004   21:35
    Subject: Re: 5.3-RC2 tar breaks operation with "(null)"

    I've upgraded to 5.3-RC2 in November and have noticed that bsdtar is 
now the standard Tape Archiver. While I do appreciate the simplicity of 
the new interface, it does lack a couple of essential options; in 
particular, those dealing with failed media.

    I found this out when attempting to extract an archive from a CD-RW. 
It had a few bad blocks so the drive just returned blocks of zero where 
these occured. This was enough to stop the extract operation dead in its 
tracks. I copied this to disc with dd and ran the extract operation 
again but it could not read past the corrupt portion. I was able to work 
around it with gtar and the --ignore-zero and --ignore-failed-read 
options but I could not find an equivalent solution for bsdtar.

    My suggestion is to include these options in libarchive and to 
assert --ignore-zero in bsdtar by default on plain files (i.e. those not 
on sequential media, not on a character special device file but on a 
random access file system). In the case of a plain file extracted with 
tar, the complete contents should be read. I'm not aware of any case 
where people typically append anything other than TAR dumps to an 
archive. For other programs (pkg_add), it may be best to leave this 
turned off.


Regards,

    Andrew Sinclair.


More information about the freebsd-hackers mailing list