dump - Linux Command - Unix Command

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

Software developers at work in an office

gilaxia/Getty Images

Dump examines files on an ext2 filesystem and determines which files need to be backed up. These files are copied to the given disk, tape or other storage medium for safe keeping. 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.

Synopsis

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 (but see also the -h option below). 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 of this option is particularly recommended when appending to an existing tape, or using a tape drive with hardware compression (where you can never 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 is in the dump file that is being restored.
  • -b blocksize: The number of kilobytes per dump record. Since the IO system slices all requests into chunks of MAXBSIZE (typically 64kB), it is not possible to use a larger blocksize without having problems later with restore. Therefore dump will constrain writes to MAXBSIZE. The default blocksize is 10.
  • -E file: Read 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 file—file 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 will be used for one dump volume in the order listed; if the dump requires more volumes than the number of names given, the last file name will be used for all remaining volumes after prompting for media changes.
  • -F script: Run 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, 1 if dump should continue but ask the user to change the tape. Any other exit code will cause dump to abort. For security reasons, dump reverts back 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 will ignore 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 simply 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 will work 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. Note that 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 etc. This can be useful when dumping to files on an ext2 partition, in order to bypass the 2GB 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 etc.
  • -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 will work 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 no longer proceed, or if something is grossly wrong. All questions dump poses must be answered by typing ''yes'' or ''no'' appropriately.

Since making a dump involves a lot of 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 has been rewound and removed, and a new tape has been 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.

In the event of a catastrophic disk event, the time required to restore all 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 cartridge media, or via the tape size, density and/or block count options below. By default, the same output file name is used for each volume after prompting the operator to change media.

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