Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

tar command problem 1

Status
Not open for further replies.

mcardleg

MIS
Jan 5, 2001
10
US
In the last 2 month I have received 2 tape with the same problem.

The first file on the tape is a tar file which contains a backup of the files on the rest of the tape. The tar file has overlayed the orginal file and I have lost the backup. As I said this has happen twice and was wondering if anyone else has and how to prevent it from happening again.
 
What command did you use to do the original tar and what command for the second tar? Did your first command tell it not to rewind the tape prior to writing? Did your second command go to the next free sector prior to writing? d3funct
borg@pcgeek.net
The software required `Windows 95 or better', so I installed Linux.

 
tar -cvf /dev/rmt/1n /export/home

then do not eject the tape ... or ...

mt /dev/rmt/1n eom; tar -cvf /dev/rmt/1 /export/home

n means 'norewind' device ...

the mt command winds the tape to the end before starting the new tar ...
 
The command I used was tar cvfp /dev/rmt/0 *. Nothing out of the ordinary. The strange thing is the first file on the tape was a tar file with the same name as the data file that should have been on the tape.
 
imagine each tar dump as a 'file' stored on the dat tape; You cannot see the contents of the tar file without reading the whole tar file, so you cannot tell the individual files within it ...

at the end of the tar file it writes an EOF to the tape, this is a seperator as far as the DAT tape is concerned ...

mt -f /dev/rmt/0n eom will place you at the end of the tape
mt -f /dev/rmt/0n fsf 1 will move you one 'EOF' further forward on the tape.
mt -f /dev/rmt/0 rewind will place tape at the begining

and so on ... if you look at these commands it is possible not to overwrite the current position on the tape, and therefore not overwrite the previous tar file ...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top