This describes the basic procedure on how to use the command "dump" to make tape backups of a system. More information is in the man page for dump. The instructions are for Linux RedHat machines (but may work for other Unix systems?).
We want to use /dev/nst0 which is the non-rewinding tape drive. This way successive backups will not overwrite previous data.
General tape drive commands:
mt status - tells status
of tape drive
mt fsf 2
- fastforwards a specified number (2 in this case) of files/archives on
the tape
mt asf 3
-fastforwards to the specified file number (3 in this case)
mt rewind -rewinds the tape
to the beginning - use this only if you want to overwrite the data on the
tape
First time setup (I'm not sure if this is absolutely necessary):
First log in as root. Create a hard link so that dump will know which
tape device you are using.
# ln /dev/nst0 /dev/tape
Procedure to backup a whole disk drive:
Say you want to backup an entire disk drive. You have to decide how big you want the volumes (archives) to be because dump does not automatically know how large your tape is.
Login as root and type
/sbin/dump -0u /dev/sda1 -B 2000000
where /dev/sda1 is the disk drive name, 2000000=2GB file size, which you can change to make your volumes/archives the size you want. It is probably better not to use a huge archive size. So set the archive size to less than the size of the tape you have. After each archive is written, dump will prompt you for the next tape, since it thinks the tape only holds the size you give it. Just keep typing "yes" and it will continue writing to the current tape until it's full.
Using the command above generates a file which records the date and which drive was backed up: /etc/dumpdates. You can make a list of the files backuped yourself by using
find . /dev/sda1 > filelist.txt
Procedure to backup only certain directories:
Say you want to backup the directory /home/joe. Again you have to decide how big you want the volumes (archives) to be.
Login as root.
/sbin/dump -f /dev/nst0 -0 /home/joe -B 200000
This makes the archives 200 MB each. When you only backup a directory (and not the whole disk drive) a record of the backup will not be made automatically. You can make a list of the files backed up yourself by using
find /home/joe > filelist.txt
Recovering files from the tape:
To recover data from the tape, we use the command "restore". This will put you in a special interface to retrieve your files. Dump saves the directory structure of the directory or drives you have backed up. So it will allow you to navigate through the directories to find the files you want to recover. The prompt will be
restore>
Type "?" for a list of commands you can use. The most useful commands are "add" and "extract".
Use "cd" and "ls" as you normally would to find the files you want. Then use
restore> add filename
and a "*" will appear next to the name of that file. Continue to "add" all the files you want to recover. Then use
restore> extract
and all the "*"ed files will be copied to /var/adm/recover and you can
copy them to where you want afterwards.
The program will ask you to insert the proper tape for the volume/archive
where the files you want were stored.
That's it! Hope that helped...