Summary:Deleting one record from DLT

From: Sudheesh Krishnankutty <>
Date: Thu Jan 09 2003 - 23:33:35 EST
Dear Sunmanagers,

Thank you for the replies.

Everyone agrees that it is risky to try any script for erasing the
contents.  I express my thanks to the following persons; also their
answers are included.  I don't know whether i have missed any answers.

* Olivier Kaloudoff gave me a script.  Even I had a similar idea but 
 very scared to try it out.  Since I am unable to make a copy of the
 tape and try the same.  Even Mark gives me the same idea. *

But one more doubt.  After delivering the project, if we are not supposed
to retain any contents related to that project, we have to delete it from
the tape.  This should be a normal requirement right?.  The best part is
I have only a single DLT drive for taking the backups.  
From: "Peter Stokes" <>

It is not normal, nor practical to erase a section of tape. Just ignore it.

From: Steve Mickeler <>
No real easy way to do that.

You'll be safer to just dump the data back to disk, delete what you need
and then re-backup to tape
From: Chris Hoogendyk <>

that would require shuffling things around.

you can start writing to a tape at any point, but that destroys
everything after that.

so, to delete the nth, you basically have to copy the n+1 through last
to somewhere else, and then copy them back beginning at the nth.

easier, just copy the tape, piece by piece and don't copy the nth. the
new tape is the one you want. confirm it. then erase the old one.

requires adequate disk space to hold the pieces or two tape heads for
reading and writing two tapes at once.

From: Bernhard Sadlowski <sadlowsk@Mathematik.Uni-Bielefeld.DE>
I am afraid, but I don't think this is possible, because at the end of
write Tapedrives write a End-Of-Tape marker (I think this are 2 or 3
EOF's). You won't be able to skip over this marker with a normal DLT

You would have to read back the date and rearchive it on a new tape and
then delete the original one.


From: "Olivier Kaloudoff" <>
yes, of course.

* use the non - auto rewind device for your tape
* go to the beginning of the data you need to erase
* do a mt status and get the block size   -> TAPE_BS
* do a mt status and get the block number -> START_BLOCK
* go to the next file on the tape
* do a mt status and get the block number -> END_BLOCK


* mt seek START_BLOCK
* let FILE_LENGTH=((echo $END_BLOCK - $START_BLOCK | bc))
* dd if=/dev/zero of=/dev/tape bs=BS count=FILE_LENGTH

That's it :)

Olivier Kaloudoff

No, the "mt erase" command works on the physical media and does not respect EOF 
marks. There's no "delete" command, but you could get a count of the number of
bytes in data set 2, then write that much data to the tape. It would be 
something like:
	mt rewind
	mt fsf 1
	dd if=/dev/tape of=/dev/null
		{now, take note of how many records dd reports having read}
	mt rewind
	mt fsf 1
	dd if=/dev/null count={previous count} of=/dev/tape

This method has the significant risk of over-writing data3 if there's any error 
in the count, or corrupting other datasets if there's any error with the tape 

The other alternative would be to copy the contents of data1, data3, data4...
to disk (or another tape), erase the first tape, then write the data (without 
data set 2).


From: Darren Dunham <>

Whenever you write to a DLT tape, all data following the write is
unreadable.  The data is of course on the tape, but it would take a
recovery house to read it.  The drive itself will tell you that the data
stops at the end of your last write.

sunmanagers mailing list
Received on Thu Jan 9 23:32:46 2003

This archive was generated by hypermail 2.1.8 : Thu Mar 03 2016 - 06:43:01 EST