dump: Linux Command/Unix Command

Use 'dump' to find files that require backup on a Linux filesystem

The dump command in Unix and Linux examines files on an ext2 filesystem and determines which files need to be backed up. These files are copied to a disk, tape, or another storage medium for safekeeping. A dump that is larger than the output medium is broken into multiple volumes.

This command is old and arcane, optimized for tape backup units. For modern desktop Linux environments, use an alternative backup tool.

Software developers at work.
gilaxia / Getty Images


The command takes the following form:

dump [-0123456789ackMnqSu [-A file ] ] [-Brecords ] [-b blocksize ] [-d density ] [-e inode numbers] [-E file ] [-f file ] [-F script ] [-h level ] [-I nr errors ] [-j compression level ] [-L label ] [-Q file ] [-s feet ] [-Tdate ] [-z compression level ] files-to-dump

Supported Options

The command accepts the following options:

  • -0-9: Dump levels. A level 0, full backup, guarantees the entire file system is copied (see also the -h option). A level number above 0, incremental backup, tells dump to copy all files new or modified since the last dump of a lower level. The default level is 9.
  • -a: Bypass all tape length calculations, and write until an end-of-media indication is returned. This works best for most modern tape drives and is the default. Use this option when appending to an existing tape, or using a tape drive with hardware compression (where you can't be sure about the compression ratio).
  • -A archive_file: Archive a dump table-of-contents in the specified archive_file to be used by restore to determine whether a file in the dump file is being restored.
  • -b blocksize: The number of kilobytes per dump record. Since the IO system slices all requests into chunks of MAXBSIZE (typically 64 kB), it isn't possible to use a larger blocksize without having problems later with restore. Therefore, dump constrains writes to MAXBSIZE. The default blocksize is 10.
  • -E file: Read a list of inodes to be excluded from the dump from the text file: file. The file file should be an ordinary file containing inode numbers separated by newlines.
  • -f file: Write the backup to filefile may be a special device file like /dev/st0 (a tape drive), /dev/rsd1c (a floppy disk drive), an ordinary file, or ' - ' (the standard output). Multiple file names may be given as a single argument separated by commas. Each file is used for one dump volume in the order listed. If the dump requires more volumes than the number of names given, the last filename is used for the remaining volumes after prompting for media changes.
  • -F script: Run a script at the end of each tape. The device name and the current volume number are passed on the command line. The script must return 0 if dump should continue without asking the user to change the tape, or return 1 if dump should continue but ask the user to change the tape. Any other exit code causes dump to abort. For security reasons, dump reverts to the real user ID and the real group ID before running the script.
  • -h level: Honor the user nodump flag Dp Dv UF_NODUMP only for dumps at or above the given level. The default honor level is 1 so that incremental backups omit such files, but full backups retain them.
  • -I nr errors: By default, dump ignores the first 32 read errors on the file system before asking for operator intervention. You can change this using this flag to any value. This is useful when running dump on an active filesystem where read errors indicate an inconsistency between the mapping and dumping passes.
  • -j compression level: Compress every block to be written on the tape using bzlib library. This option works only when dumping to a file or pipe, or when dumping to a tape drive if the tape drive is capable of writing variable length blocks.
  • -L label: The user-supplied text string label is placed into the dump header, where tools like restore(8) and file(1) can access it. This label is limited to be at most LBLSIZE (currently 16) characters, which must include the terminating '\0'.
  • -M: Enable the multi-volume feature. The name specified with -is treated as a prefix, and dump writes in sequence to 001, 002, and so on. This can be useful when dumping to files on an ext2 partition, to bypass the 2 GB file size limitation.
  • -n: Whenever dump requires operator attention, notify all operators in the group ''operator'' by means similar to a wall(1).
  • -q: Make dump abort immediately whenever operator attention is required, without prompting in case of write errors, tape changes, and similar actions.
  • -Q file: Enable the Quick File Access support.
  • -z compression level: Compress every block to be written on the tape using zlib library. This option works only when dumping to a file or pipe, or when dumping to a tape drive if the tape drive is capable of writing variable length blocks.

Consult the manpage for dump for additional options.

Conditions of Dump

Dump requires operator intervention on these conditions: end of tape, end of dump, tape write error, tape open error, or disk read error (if there is more than a threshold of nr errors). In addition to alerting all operators implied by the -n key, dump interacts with the operator on dump's control terminal at times when dump can't proceed, or if something is wrong. All questions dump poses must be answered by typing Yes or No appropriately.

Since making a dump involves time and effort for full dumps, dump checkpoints itself at the start of each tape volume. If writing that volume fails for some reason, dump will, with operator permission, restart itself from the checkpoint after the old tape is rewound and removed, and a new tape is mounted.

Dump tells the operator what is going on at periodic intervals, including usually low estimates of the number of blocks to write, the number of tapes it will take, the time to completion, and the time to the tape change. The output is verbose so that others know that the terminal controlling dump is busy, and will be for some time.

Dump Backups

In the event of a catastrophic disk event, the time required to restore the necessary backup tapes or files to disk can be kept to a minimum by staggering the incremental dumps.

On media that cannot reliably return an end-of-media indication—such as some cartridge tape drives—each volume is of a fixed size. The actual size is determined by specifying the cartridge media, or via the tape size, density or block count options. By default, the same output file name is used for each volume after prompting the operator to change the media.

Use the man command (% man) to see how a command is used on your computer.

Was this page helpful?