How to make tape backups

If you want to backup an entire file-system, which isn't a bad alternative given our model of allocating entire disks to specific individuals, you should probably use the dump command. Also, it's simpler than ftp'ing all of your files to buzzard and then taring them.


Using dump with 12GB drive

Machines: moorthy, dirt

The device for the tape drive is /dev/rsa0

Look at the FreeBSD web pages on backups, particularly dump. If you want to do a dump with the 12GB (the -B 12000000 reflects that) tapes, use:

moorthy# dump -0u -f /dev/rsa0 -B 12000000 file-system

You can also use the dump command to access dirt and moorthy's tape drives from our other lab machines.

Assuming you are going to dump to dirt's tape drive from auntbea, first be sure that auntbea can rsh to dirt as root. To do that, make sure "auntbea root" is in dirt:/root/.rhosts. Once you've done that bring up a window on auntbea. (NOTE: this window will need to leave the dump program running in the foreground for several hours because the program is interactive.) Then, as root you use the dump command, with the addition of the hostname of the tape-drive, using classic hostname:/file syntax. For example:

auntbea# dump -0u -f dirt:/dev/rsa0 -B 12000000 /usr
would backup the local machine's /usr file-system on dirt's tape-drive and write info about the dump to /etc/dumpdates (-u option).

Using dump with 40GB drive

Machine: oberon

The device for the tape drive is /dev/rsa0

Basically, the process is the same for dumping to the 40GB drive as with the 12GB drive. There are two exceptions: Change the size from 12000000 to 40000000 and add the -c option for cartridge tape drives. So, using the example from above, you should use:

auntbea# dump -0uc -f oberon:/dev/rsa0 -B 40000000 /usr

Time Required

More on doing backups with tar for a much faster way of doing this.

Restoring from dump

If you've made a tape using dump using the directions above, restoring is
pretty straight-forward.  If you're on dirt, for example, use 

restore -i -f /dev/rsa0

If you're somewhere else, you can use the hostname:file notation --

restore -i -f dirt:/dev/rsa0

This will give you an interactive restore.  Here's a list of useful
commands (man restore for more info):

cd <dir name>     - change to the directory to wish to restore
add <filename>    - add the file (or list of files, or directory) to the
                      list to extract 
delete <filename> - remove the file from the list to extract
extract           - extract the list of files
quit              - quit the restore

When you start the restore, it will ask you for the record to start at.  If
you've dumped an entire filesystem to one tape, enter 1. 

Note: Restore could take up to 90 minutes to restore just one file.  Be

Using tar on buzzard

Here's the instructions for using buzzard (which you should use if you 
are backing up something besides an entire file-system.)

Transfer your files to a partition accessible on buzzard.  Note: ftping files
to a local buzzard file-system is MUCH faster than going over NFS.  

Now create an archive on the tape:

tar -cfv /dev/rmt/0m <files_to_back_up>

(For example: cd /mydirectory; tar -cfv /dev/rmt/0m .) 

This could take up to an hour or more depending on how much you are
backing up.

Afterwards, I recommend you test your backup:

tar -tf /dev/rmt/0m

If it's something worth keeping, you may want to restore it (if you
can find room and do a diff to be sure it's a good backup):

(cd to a different directory)
tar -xf /dev/rmt/0m 

diff -r dir1 dir2

Note: both the test and the restore take quite a while (hour+).

For more info look at: 

	howto buzzard-8mm-tape
	howto tape-make

See the list of backups on the FAQ for the current tapes and add yours
to the list.

I generate the list of what's on the tape with: 

ls <files_to_back_up> > file.list

(hopefully the file names are descriptive!)  I also print out the list
from a departmental machine with:

enscript -1 -f Courier7 -Phplj156 file.list 

and then a bit of trimming and folding makes this a nice sized insert
into the tape case itself.

Other DiRT documents
Author: Mark Parris