cp file from tape

John Summerfield debian at herakles.homelinux.org
Thu Nov 25 04:10:33 UTC 2004


On Thursday 25 November 2004 04:16, Thu Nguyen wrote:
> My backup tape has been corrupted. I used tar command
> to write the files into the tape. Is there any other
> command other than tar, or cpio I can use to copy a
> whole compressed tar file from the tape to my hard drive?

I don't believe there is any way to recover your tape if you can't read it 
properly. Skipping bad blocks will not work.

A tarball is a stream of bytes. At various places along that stream it is 
possible to recognise there 'here starts a new file."

Then the stream is passed through gzip or bzip which takes that stream, 
probably in blocks of some fixed size (we'll pretend that that is so) and 
applies its compression process to it.

>From that point it is no longer possible to recognise file boundaries. There 
are many compression algorithms which change the data so the boundaris betwen 
bytes in the compressed stream have no relationship to those between bytes in 
the uncompressed stream.

In contrast, afio (which I think is not shipped by Red Hat), when called on to 
compress its data, compresses individual files and writes those compressed 
files individually to the output file or tape.

To illustrate, take these files:
/home/summer/.gtkrc
/home/summer/.emacs
/home/summer/.gnome2/epiphany/session_gnome-6Zbj7l.xml
/home/summer/.gnome2/epiphany/ephy-history.xml

Tar would write them consecutively to its output. If you're compressing, that 
compressed output is input to gzip or bzip2.

afio would compress .gtkrc and write that, compress .emacs and write that, 
compress /home/summer/.gnome2/epiphany/session_gnome-6Zbj7l.xml and rite that 
and so on.

If you then have a bad tape, you have some prospects of skipping over 
corrupted files and recovering the later ones.

With a compressed tarball that is not possible.



-- 
Cheers
John




More information about the users mailing list