Archiving the Backup Files to Tape

The /backup filesystem on piemonte, which lives on an external hard drive, holds backup files from all the Suns. Periodically, we can archive this all to tape.

Capacity

The tape drive on piemonte holds about 12 GB, which is less than the /backup filesystem capacity. However, if you keep only two backup files per Solaris machine on the /backup filesystem, they will all fit on one tape.

A good reason not to let /backup get too full is that the backup files are all gzipped. If you want to extract anything out of a backup file, you must gunzip it first, meaning an entire computer's worth of files will be there, uncompressed. (They are all together in one tar file, but they still take their normal amount of space.) So leaving 5G or so of spare capacity on /backup is essential if you ever intend to remove anything from a tar backup file.

Archiving Backup Files to Tape

Log in as root on piemonte and use ufsdump to copy /backup to the tape, like this:

# ufsdump 0cfu /dev/rmt/0 /backup & (Wait for several hours.)
# mt -f /dev/rmt/0 offline (To eject the tape. Or just push the button.)

The program ufsdump is a UCB backup utility. It is a bit more sophisticated than tar , allowing you to interactively inspect inside of the backup files it creates and extract from them. It also supports incremental backups.

The ufsdump options we use are as follows:
0 "Dump level 0", means full copy (not incremental).
f Name of output file to follow, in this case /dev/rmt/0 .
c Writing to a cartridge drive.
u Record this operation in the /etc/dumpdates file.

Inspecting and Restoring Backup Files from an Archive Tape

In general, the /backup filesystem on piemonte contains the last two backup files for each Sun. You can examine and extract from a backup tar file that is resident on /backup.

If you want to use an older backup file, you extract it from an archive tape to the /backup filesystem, gunzip it, and untar the files you want.

Put the tape in the piemonte, then use ufsrestore in interactive mode, like this:

# ufsrestore if /dev/rmt/0

In interactive mode, ufsrestore allows you to inspect and extract files from the ufsdump archive tape. The basic model is:

The backup files on tape have names like monviso-020405.tar.gz , meaning 2002-April-5.

The ufsdump/ufsrestore utilities can handle "multivolume" files, meaning archive files that are bigger than one tape. When restoring, ufsrestore may ask for for a volume number. For a single-tape archive, the volume number is 1.

Warning: when you restore a file off of the tape archive, it searches through potentially the entire tape to find the file. Some time is needed. It makes you select with add commands all the files you want, then extract , so it will not need to search the tape multiple times.

The Obvious Question

The obvious question is: if ufsdump and ufsrestore are more sophisticated than tar for backups, why are we tar -ing each Sun instead of using the more sophisticated utility?

The answer is that ufsdump is supposed to run when nothing else is happening on the computer, preferably in single-user mode. It is easier to just use tar .

Home

Last Revised: 17 May 2002
Michael Glass