7

What does

mt -f /dev/st0 erase

do exactly with a (LTO-6) tape drive at /dev/st0?

It takes hours and seems to write many times. Does it write random data on the tape several times to delete the contents in a secure way? Will it delete the magnetic servo tracks?

Jonas Stein
  • 3,898
  • 4
  • 34
  • 55
  • 2
    With QIC tapes it would basically degauss the tape, i.e. not write random data but use a alternating current through the head to wipe the magnetism. It would sometimes help if writing to a tape gave errors. I have no experience what happens with LTO when erasing. – wurtel Apr 23 '15 at 07:30
  • I think it is doing so called long erase - writes zeros to the whole tape. I think with LTO it wouldn't degauss the tape as per [wikipedia](http://en.wikipedia.org/wiki/Linear_Tape-Open): _Using a bulk eraser (or otherwise exposing the cartridge to a strong magnetic field) will erase the servo tracks along with the data tracks, rendering the cartridge unusable_. – taliezin Apr 23 '15 at 13:56

1 Answers1

5

It depends on the version of mt-st, however, this repository performs long erase. Your mt-st also performed this, considering the amount of time.

Here is a quote from man page:

Erase the tape. Note that this is a long erase, which on modern (high-capacity) tapes can take many hours, and which usually can't be aborted.

First, long erase sets EOD to the current position, according to LTO SCSI Reference. Then, it writes Data Set Separator (DSS) pattern from the new EOD to the end of the current partition (EOP). DSS is a repeated binary pattern 100 000 000, according to LTO Specification from ECMA.

Thus, if you invoke mt -f /dev/st0 erase at BOT position and there is only one partition in the tape, then the drive writes EOD at BOT position and then start to over-write data with binary pattern of 100 000 000 100 000 000 100 000 000 ... until EOP. This can take many hours depending on capacity and transfer rate. For example, LTO-6 native capacity is 2.5TB and write speed is 160MB/sec. It will take (2,500,000MB/160MB/sec) = 15,625sec = 4.3h to complete.

Kevin Nakamoto
  • 136
  • 1
  • 6