A 6: Data backup with "dump" and "restore"
Under UNIX, hard disks are usually subdivided into partitions, each being allocated to a particular logical device. The "2" partition usually specifies the entire disk. Information on disk partitioning can be displayed with a UNIX program (e.g. "format" under Solaris 2.x), and the corresponding logical devices can be determined by inspecting the "vfstab" file. The "df" (disk free) program shows how much of the disk space is already allocated:
/dev/dsk/c0t0d0s0 /dev/rdsk/c0t0d0s0 / ufs 1 no
/dev/dsk/c0t0d0s3 /dev/rdsk/c0t0d0s3 /space ufs 2 yes
Filesystem kbytes cap. Mounted on
/dev/dsk/c0t0d0s0 1984230 79% /
/dev/dsk/c0t0d0s3 6484885 34% /space
To improve data throughput, "dump" should be called without disk caching. Accordingly, in the following example, which backs up the entire "2" partition to the tape streamer "/dev/rmt/0", the "/dev/rdsk" prefix has been placed in front of the device name:
$ dump 0ucstbf 560 12 126 /dev/rmt/0 /dev/rdsk/c0t0d0s0
Note: The program name "dump" originates from BSD-style UNIX . Under Solaris 2, the appropriate command is ufsdump, under AIX backup. For the appropriate commands on other UNIX architectures refer to your UNIX documentation.
You can use "cron" to automate data backup with "dump". Please refer to your UNIX documentation for details.
The easiest way to use "restore" is in interactive mode, which you call as follows:
You are presented with restore's interactive prompt, which looks similar to the following:
Use standard UNIX directory related commands like "cd" and "ls" to find the files and directories you want to restore; use wildcards "*" and "?" in the usual way. Use the "add" command to add files or directories to the list of things you want to restore, e.g.
add helios* adds all files and directories in the current directory which start with the string "helios". For Macintosh files, do not forget to restore the resource files too, for example:
Use the "extract" command when you have finished choosing. Files are extracted into the current directory, so usually you will want to use the "cd" command to switch first to the same directory from which you made the backup.
"restore" does not accept file name specifications containing spaces or accented characters (Umlauts). You can get round this limitation by using wildcards.