I have a pile of old unencrypted backup tapes I want to discard, and I'm looking for a really simple and free erase method.
I have previously used the following method to zero hard drives on linux. There's no progress indicator, but it runs as fast as possible:
cat /dev/zero > /dev/hda
(minutes pass.....)
cat: No space left on device
Is this just as effective on tape devices, since linux treats everything as a block device?
Booting the old server with Knoppix 7.4, I see:
/dev/tape/by-path/pci-0000:02:05.0-scsi-0:0:5:0
/dev/tape/by-path/pci-0000:02:05.0-scsi-0:0:5:0-nst
This is a Quantum DLT-V4 half-height SCSI drive.
I don't know which of the two device names I should use for wiping, but I assume it's the non-rewind "-nst" device.
Is it good enough to insert a tape to kill, and type:
cat /dev/urandom > /dev/tape/by-path/pci-0000:02:05.0-scsi-0:0:5:0-nst
Then when done (no space left on device), just eject and discard the tape?
Is it "just that easy", or am I overlooking something?
===FOLLOWUP===
I don't know how this website expects replies to comments to be handled. So I'm editing the question..
Time to wipe: To me, there is no issue setting up a wipe job for hours and changing the tape the next day or whatever. The server in question has been sitting unused and powered down for two years, so it really does not matter how long wiping takes.
I am not doing any device setup before writing so it may have hardware compression enabled, but overwriting with urandom pretty much guarantees the compression will be ineffective and the overwrite will be fast.
Rewinding: When a DLT tape is freshly loaded, isn't it already fully rewound? If not, issuing a "mt rewind" only takes a minute.
mt erase: The documentation of this command is ridiculously short. "Erases the tape." Okay, how? Zeroes the tape? Or overwrites with random data? No additional info seems to be available, and I don't know how to find out. Does it erase just a couple blocks at the front to make it appear empty, or the entire tape? Would I have to look at the command's source code to know?
Just destroy the tapes if you're disposing of them...
They can be shredded, crushed, burned (don't really) or just sent away to the same place that handles your document storage/destruction.
Would you really want to sit around and wait for this to complete tape by tape? Plus being DLT, there's a manual intervention aspect to the load-eject-load cycle.
To answer your question about the devices, tape drives are presented as character devices in Linux. The distinction between the SCSI tape device, /dev/st0 and /dev/nst0 is that "n" specifies that the device not be rewound to the beginning before proceeding. The latter would be be used for something like multiple backup jobs being written to the same tape.
If you want every bit of data scrubbed from the drive,
mt erase
(long erasure) is the way to go. If you can accept the minimal risk of someone with specialized hardware reading your tapes, a short erase (mt erase 1
) will do. A short erasure is functionally equivalent to a rewind followed by weof.As for how erase works? That will be device (manufacturer) dependent. Some drives have an electromagnet used to erase data -- thus it drags the entire data holding part of the tape over a magnet. Others execute a write-full-tape procedure using all zeros, all ones, or some random pattern.
(Note: It takes special "recovery" systems to bypass the end-of-data mark to attempt to read any remaining data on the tape.)