33.5. The dump backup program

Dump is completely different from tar, it is a program for backing up and restoring file system. It backups up the entire file system - not the files. Dump does not care what file system is on the hard drive, or even if there are files in the file system. It examines files on an ext2 file system, determines which ones need to be backed up, and copies those files to a specified disk, tape, file or other storage medium. It dumps one file system at a time quickly and efficiently. Unfortunately, it does not do individual directories, and so it eats up a great deal more storage space than tar. It is also written specifically for backups.

The restore command performs the inverse function of dump, It can restore a full backup of a file system. Subsequent incremental backups can then be layered on top of the full backup. Single files and directory sub trees may also be restored from full or partial backups. You can use dump if you need a procedure for both backing up file systems and restoring file systems after backups.

Dump has several levels of backup procedures. The levels range from 0 to 9, where level number 0 means a full backup and guarantees the entire file system is copied. A level number above 0, incremental backup, tells dump to copy all files new or modified since the last dump of the same or lower level. To be more precise, at each incremental backup level you back up everything that has changed since the previous backup at the same or a previous level.

What are the advantages and the reasons to create and use several levels to make a backup? I try to explain it with the following schemas:


0       3       2       5       4       7       6       9       8       9
|       |       |       |       |       |       |       |       |       |
0 means a full backup.  |       |       |
        |       |       |       |       |       |       |       |       |
       3 means copy all files new or modified since level 0, and 3.
        |       |       |       |       |       |       |       |
          2 means copy all files new or modified since level 0, and 2.
                |       |       |       |       |       |       |
                5 means copy all files new or modified since level 0, 3, and 5.
                        |       |       |       |       |       |
                   4 means copy all files new or modified since level 0, 3, and 4.
                        |       |       |       |       |
                      7 means copy all files new or modified since level 0, 3, 4, and 7.
                        |       |       |       |
                        6 means copy all files new or modified since level 0, 3, 4, and 6.
                        |       |       |
                           9 means copy all files new or modified since level 0, 3, 4, 6, and 9.
                                |       |
                              8 means copy all files new or modified since level 0, 3, 4, 6, and 8.
                                |
                                9 means copy all files new or modified since level 0, 3, 4, 6, 8, and 9.

The advantages and reasons for doing this are that with multiple levels, the backup history can be extended more cheaply. A longer backup history is useful, since deleted or corrupted files are often not noticed for a long time. Even a version of a file that is not very up to date is better than no file at all. Also, backup levels are used to keep both the backup and restore times to a minimum -low.

The dump manual page suggests a good scheme to take the full advantage of backup levels: 3, 2, 5, 4, 7, 6, 9, 8, 9, etc as described by the table below. The most you have to backup is two day's worth of work. The number of tapes for a restore depends on how long you keep between full backups.

Table 33-1. Dump scheme

Tape Level Backup days Restore tapes
1 0 N.A. 1
2 3 1 1, 2
3 2 2 1, 3
4 5 1 1, 2, 4
5 4 2 1, 2, 5
6 7 1 1, 2, 5, 6
7 6 2 1, 2, 5, 7
8 9 1 1, 2, 5, 7, 8
9 8 2 1, 2, 5, 7, 9
10 9 1 1, 2, 5, 7, 9, 10