Backing up and restoring using the DAT Tape

The worst thing is a full harddrive. So how to you get files onto a tape without special software. Unix provides all the core tools for operating a DAT band even without special programs. If you can use a normal a tape recoder then you will find a DAT band is not much different. So pop in a band - I'll assume your system configured.

Mount the tape and rewind it.

The -nst0- is the device (st0 -> scsi tape 0) the nst means that it should not be rewind after doing anything. This is like when you play a song on a cassette and then it automatically rewinds to the start after the songs finished.

mt -t /dev/nst0 rewind

What if I wanted to hear the next song?

Mount the tape and fast forward 1 track.

mt -t /dev/nst0 fsf 1

Copy the files onto the tape

Use tar tools to backup. Basically it reads all the files, glues them together in a big long file (like a zip file thats not compressed) and write this on the the tape (and this in effect the song).

tar cvf /dev/nst0 *

Get a list of the files that are on the tape

After its finished the tape stays at the end. If we want to know what is on it (and this is the names of the file not the actual content in the files saved), we will need to rewind it. We can even make a list and store it in a text file. A bit like making a paper inlay with all the names of the songs for reference.

mt -t /dev/nst0 rewind; tar tf /dev/nst0 > backup_report.txt;

Eject the tape and put it somewhere safe.

And rewind and eject

mt -t /dev/nst0 rewoff;

Restoring.

To restore the files when you have lost your data - because that was the point of backing them up. It is important that the list in the txt file is in the same order as they are saved on the DAT. When you start playing the song you have to listen to the whole song. You can't cue backward and backward durng a song.

tar xvf /dev/nst0 --files-from=backup_report.txt

Backup Tips.

  • Remember: EVERYBODY wants to restore but NOBODY wants to backup
  • Understand the difference between Backup and Archiving
  • Physically seperate from backup media (tapes) and orginal data source (server)
  • Do not leave or expose magnetic tapes to heat (while transporting them to you banksafe in the car boot on a hot day)
  • Watch out for overhead pylons etc - magnetic disturbance
  • Flash memory may well be resistant to magnetic disturbance - but the controller microprocesser (the other chip on the board) inside is not.
  • Practice restoring the data - so you no roughly what to expect on the worst day of your life.
  • As tape device gets used the heads physcially wear and shift. After a while, you may not be able to restore older data. Regulary check that the older tapes can still be read and restored from.