How To: Tape backup and recovery

If you need data recovered from old tapes, get in touch!

Backing up to tape

  • Use mbuffer to buffer contents in RAM before writing to high-speed tape (such as LTO):
tar cvf - /dir1 /dir2 /dir3 | mbuffer -m 4G -L -P 80 > /dev/nst0
  • Throw in compression into the mix:
tar cvf - /dir1 /dir2 /dir3 | lbzip2 | mbuffer -m 4G -L -P 80 > /dev/nst0

Dumping data from tapes

  • Remember that block sizes written to tapes can be variable, so it’s usually good practice to set the driver to variable block length:
sudo mt -f /dev/nst0 setblk 0
  • When dumping data from a tape, give dd a generous enough block size so that the largest block sizes can be accounted for:
sudo dd if=/dev/nst0 of=foo.bin conv=noerror,sync bs=64k
  • If dd reports an error like “Cannot allocate memory” or even “Input/output error”, it usually means the block size is too small, or set to a fixed number instead of variable (0).

Working with the ftape driver

  • Load the ftape driver when using a floppy (FDC) connected tape drive:
    sudo modprobe zftape
  • Dump data from ftape media:
sudo dd if=/dev/nqft0 of=data.bin conv=sync,noerror &
  • Dump raw data from ftape media (for dumping everything including the tape header):
sudo dd if=/dev/rawqft0 of=data.bin bs=10240 conv=sync,noerror &
  • Navigate back and forth between file records:
sudo mt -f /dev/nqft0 fsf 1
sudo mt -f /dev/nqft0 bsf 1

Specific software

  • QIC-80 and QIC-40 tapes thankfully have a very well-documented format that was shared widely between various tools of the era. This format is part of my swiss army knife recovery tools. Another good way to read these tapes is using a parallel-port version of a Ditto-branded drive (which is compatible with Ditto tapes and QIC-80 tapes), and use the Ditto Tools software on a plain old Windows 98 laptop. (Ditto Tools is just a rebranded version of the old Colorado tools.)
  • TapeMate: identified by the presence of the string !NSURE! at the start of the first sector. This software has a proprietary format, but it helpfully has a driver that backs-up and restores from a DOS disk instead of tape. When configured to restore from a disk, it looks for a file called NSUREARC.FIL in the root directory of the configured drive. This file has the same formatting as a tape dump, so you can use TapeMate in an emulator, with an emulated disk drive containing NSUREARC.FIL as the tape dump. The dump file should consist of two file records: a 512-byte “header” record, and the next record containing the backup. But how is the tape “file marker” represented in the NSUREARC.FIL dump, you ask? With a 512-byte “marker” sector in between records. The marker sector has the string FILEMARK at the beginning, with all the other bytes set to 0xFF.