problem with using 'dd' to copy 'tar' tapes
Joe Smith
jms at tardis.tymnet.com
Sun Nov 4 14:00:00 AEST 1990
In article <1990Oct7.230945.3387 at rice.edu> sdm7g at dale.acc.Virginia.EDU (Steve D. Majewski) writes:
>In trying to make a copy of a tar tape with dd, the copies don't seem to
>be exactly the same as the originals.
>
>The original, I can loop thru via: "dd if=/dev/nrst0" or "tar -tvf
>/dev/nrst0" and at the end, the tape is properly positioned at the start
>of the next file.
>
>Reading the copy, the tape sometimes ends up positioned at the end of the
>current file, rather than the beginning of the next.
That's strange. Every time I've tried reading an original tape with
multiple tar saves, it always stops before the start of next file. For
instance:
tar cvf /dev/nrst8 dir1
tar cvf /dev/nrst8 dir2
mt -f /dev/nrst8 rew
tar xvf /dev/nrst8 # restores dir1
tar xvf /dev/nrst8 # always says "unexpected EOF"
tar xvf /dev/nrst8 # restores dir2
This matches the man page for tar:
If there are multiple archive files on a tape, each is
separated from the following one by an EOF marker. tar does
not read the EOF mark on the tape after it finishes reading
an archive file because tar looks for a special header to
decide when it has reached the end of the archive. Now if
you try to use tar to read the next archive file from the
tape, tar does not know enough to skip over the EOF mark and
tries to read the EOF mark as an archive instead. The
result of this is an error message from tar to the effect:
tar: blocksize=0
This means that to read another archive from the tape, you
must skip over the EOF marker before starting another tar
command. You can accomplish this using the mt(1) command,
as in "mt -f /dev/nrst8 fsf 1"
So, I can't explain why you luck out on your originals.
Joe Smith (408)922-6220 | SMTP: jms at tardis.tymnet.com or jms at gemini.tymnet.com
BT Tymnet Tech Services | UUCP: ...!{ames,pyramid}!oliveb!tymix!tardis!jms
PO Box 49019, MS-C41 | BIX: smithjoe | 12 PDP-10s still running! "POPJ P,"
San Jose, CA 95161-9019 | humorous dislaimer: "My Amiga 3000 speaks for me."
More information about the Comp.sys.sun
mailing list