When making a file system backup using the dump command, you must supply parameters specifying the dump level, the backup media, and the file system to back up. You can also supply optional parameters to specify the size of the backup media, the method for requesting the next tape, and the recording of file system dump times and status.
The first parameter to dump is always a list of single-letter option codes. This is followed by a space-separated list of any arguments needed by those options. The arguments appear in the same order as the options that require them. The final parameter is always the file system or directory being backed up.
# dump options arguments filesystem
Dump Options Description
(0-9) The dump level. Selecting a dump level of 0 backs up all files (a full dump). A higher number backs up only those files modified since the last dump of an equal or lower number (in essence, an incremental dump). The default dump level is 9.
(-B records) The number of dump records per volume. Basically, the amount of data you can fit on a tape. This option takes a numeric argument.
(-b kbperdump) The number of kilobytes per dump record. Useful in combination with the -B option. This option takes a numeric argument
(-h level) Files can be marked with a nodump attribute. This option specifies the dump level at or above which the nodump attribute is honored. This option takes a numeric argument of 1-9.
(-f file) The name of the file or device to write the dump to. This can even be a file or device on a remote ma0chine.
(-d density) Sets the tape density. The default is 1600 bits per inch. This option takes a numeric argument.
(-n) When a dump needs attention (such as to change a tape), dump will send a message to all of the users in the operator group. This option takes no arguments.
(-s feet) Specifies the length in feet of the dump tape. This calculation is dependent on tape density (option d) and the dump record (options B and b). This option takes a numeric argument.
(-u) Record this backup in the /etc/dumpdates file. It is a good idea to use this option, especially if you create incremental backups.
(-t date) Specify a date and time on which to base incremental backups. Any files modified or added after that time will be backed up. This option causes dump to ignore the /etc/dumpdates file. It takes a single
argument, a date in the format specified by the ctime man page.
(-W) This option causes dump to list the file systems that need to be backed up. It does this by looking at the /etc/dumpdates file and the /etc/fstab file.
(-w) This works like the W option but lists the individual files that should be backed up
Thus, a typical dump command may look similar to the following:
This command results in dump performing a level zero (full) backup of the /dev/sda6 file system, storing the backup on the tape drive /dev/qft0, and recording the results in /etc/dumpdates. The B option is used to increase the expected tape block count to 500000; otherwise, dump would prompt for a new tape far earlier than required. The dump command prints status messages to the screen, letting you know how far along the backup has progressed and estimating how much time it will take to complete. The output looks similar to this:
# dump 0uBf 500000 /dev/qft0 /dev/sda6
DUMP: Date of this level 0 dump: Sat Apr 23 23:33:37 2013
DUMP: Dumping /dev/sda6 (/home) to /dev/qft0
DUMP: Exclude ext3 journal inode 8
DUMP: Label: /home
DUMP: mapping (Pass I) [regular files]
DUMP: mapping (Pass II) [directories]
DUMP: estimated 93303 tape blocks on 0.19 tape(s).
DUMP: Volume 1 started with block 1 at: Sat Apr 23 23:33:47
DUMP: dumping (Pass III) [directories]
DUMP: dumping (Pass IV) [regular files]
DUMP: Closing /dev/qft0
DUMP: Volume 1 completed at: Sat Apr 23 23:35:35 2013
DUMP: Volume 1 94360 tape blocks (92.15MB)
DUMP: Volume 1 took 0:01:48
DUMP: Volume 1 transfer rate: 873 kB/s
DUMP: 94360 tape blocks (92.15MB) on 1 volume(s)
DUMP: finished in 108 seconds, throughput 873 kBytes/sec
DUMP: Date of this level 0 dump: Sat Apr 23 23:33:37 2013
DUMP: Date this dump completed: Sat Apr 23 23:35:35 2013
DUMP: Average transfer rate: 873 kB/s
DUMP: DUMP IS DONE
Understanding dump levels
The dump command can back up all files on a file system, or it can selectively back up only those files that have changed recently. The dump level parameter is used to specify this behavior. A dump level of 0 results in a full backup of all files on the file system. Specifying a higher number (1-9) backs up only those files that have been changed or added since the most recent dump of the same or lower dump level. I recommend you use dump levels to implement a full and incremental backup schedule .
Day of Week Dump Level
Sunday Level 0 (full dump). Eject the tape when done.
Monday Level 9 (incremental dump).
Tuesday Level 8 (incremental dump).
Wednesday Level 7 (incremental dump).
Thursday Level 6 (incremental dump).
Friday Level 5 (incremental dump).
Saturday Level 4 (incremental dump).
Note that after the full backup on Sunday, a level 9 incremental dump is done the next day, and a successively lower dump level is done each day after that. This results in all the files that have changed since Sunday being backed up on every single incremental backup. Each incremental backup is thus larger than the previous one; the backup contains all of the files from the previous incremental backup plus any files that have changed since then. This may seem wasteful of storage space on the backup tape, but it will save a lot of time and effort should there be a need to restore the file system. (This is referred to as a differential backup.)
For example, imagine that your hard drive crashed on Friday. After replacing the hard drive, you can restore the entire file system in two steps:
Restore the full backup from the prior Sunday, and then the most recent incremental backup from Thursday. You can do this because Thursday’s backup contains all of the files from Monday, Tuesday, and Wednesday’s tape as well as the files that changed after that. If the dump levels had progressed in positive order (level 1 for Monday, level 2 for Tuesday, and so on), all of the incremental backups would have to be restored in order to restore the file system to its most current state.