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!

Erase UNIX Tar file

Status
Not open for further replies.

dmccarthy

Programmer
May 12, 1999
14
IE
Silly question, just need to delete some tapes that have UNIX<br>tar files on them. Thought the command was tar -cvf/<br>but that doesn't work.<br><br>Any ideas ?
 
Never needed to do this - you can re-use a tape without having to erase it first.<br><br>I think that the command<br><br>dd if=/dev/null of=/dev/tapedevice<br><br>(where tapedevice is your real tape device)<br><br>would do the trick. <p>Mike<br><a href=mailto:michael.j.lacey@ntlworld.com>michael.j.lacey@ntlworld.com</a><br><a href= Cargill's Corporate Web Site</a><br>Please -- Don't send me email questions without posting them in Tek-Tips as well. Better yet -- Post the question in Tek-Tips and send me a note saying "Have a look at so-and-so in the thingy forum would you?"
 
A nice strong magnetic field works ;)<br><br>Many older shops used to have &quot;bulk erasers,&quot; which were just electro-magnetics with a powerful local field.&nbsp;&nbsp;Dangerous - have to keep anything you want to keep away. <p>Octalman<br><a href=mailto: > </a><br><a href= > </a><br>
 
Just a helpful reminder, the tar -cvf command is for extracting tar files, it will not delete the source tar file.<br><br>Mount the tape and manually delete the tar files:<br><br>rm -R *.tar <p> <br><a href=mailto: > </a><br><a href= > </a><br>Yahoo Messenger: coily2
 
Oops!&nbsp;&nbsp;The <FONT FACE=monospace>tar -cvf <i>filename</i></font> command will <b>erase</b> tar files or tape archives.<br><br><FONT FACE=monospace>tar -xvf <i>filename</i></font> command will <b>extract</b> archives.<br><br>Think &quot;c = Create&quot; and &quot;x = eXtract&quot;.<br><br>Don't know about mounting tapes, but if you want to delete a tar archive file then &quot;rm filename.tar&quot; will work.<br><br>Also, &quot;tar cvf /path/to/tape/device&quot; without any files specified will just write a new tar header to the tape.&nbsp;&nbsp;The original data will still be there.&nbsp;&nbsp;If you truly want to erase the tape, use a bulk eraser as Octal suggests.&nbsp;&nbsp;(As an alternative, you may be able to do something along the lines of &quot;<FONT FACE=monospace>dd if=/dev/null of=/path/to/tape/device</font>&quot;.&nbsp;&nbsp;Then sit back and wait while <FONT FACE=monospace>dd</font> writes \0's all over your tape...)<br><br>Hope this helps.
 
The &quot;dd if=/dev/null of=/path/to/tape/device&quot; trick will write an EOF to the tape - should work fine. <p>Mike<br><a href=mailto:michael.j.lacey@ntlworld.com>michael.j.lacey@ntlworld.com</a><br><a href= Cargill's Corporate Web Site</a><br>Please -- Don't send me email questions without posting them in Tek-Tips as well. Better yet -- Post the question in Tek-Tips and send me a note saying "Have a look at so-and-so in the thingy forum would you?"
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top