[plug] Erasing a file from the end of a tape

Ryan ryan at is.as.geeky.as
Tue Oct 19 21:28:28 WST 2004


On Tue, 2004-10-19 at 17:22, Steve Baker wrote:
> Ryan wrote:
> > The intended result is that when I read the tape back to list its
> > contents (involving lots of runs of tar), I want it to hit what is
> > currently the EOF marker for the second last file and then on the next
> > listing request report end of data or i/o error - as would normally
> > occur if that EOF was the last thing ever written to tape.  So I just
> > want to nullify the final file from the tape.
> 
> I checked http://www.die.net/doc/linux/man/man1/mt.1.html, but I also 
> found http://www.mcsr.olemiss.edu/cgi-bin/man-cgi?mt+1 which mentions 
> that mt erase will erase from current position to eot, rather than the 
> entire tape.  This might be for other platforms than linux though.
> 
> If erase is not supported properly by either Linux or your tape drive or 
> doesn't do what you want perhaps you can write an EOF (mt weof) at the 
> right spot so you get an empty file when reading after incomplete_file-1.

It seems the linux implementation of the erase command takes out the
entire tape.  I used weof after seeking past the last complete file and
it has worked.  It gives me an empty file which is enough for now,  I'll
just make my scripts aware of it.

Thanks,

Ryan




More information about the plug mailing list