Linux dump Backup Command for Data Loss Protection
The `dump` command in Linux is a backup utility used to back up filesystems at a block level. In Red Hat Enterprise Linux (RHEL) 9.2, you can use the `dump` command to protect data by creating full or incremental backups of your filesystems. Here's how to use it for enabling data loss protection:
Check Filesystem Compatibility
The dump command works with ext2, ext3, and ext4 filesystems. Confirm the filesystem type of the partition you want to back up:
df -T
Install the dump Package
If the dump utility is not installed, you can install it:
The dump command offers a more extensive set of backup options by allowing fine-grained incremental as well as full dumps to be performed. System administrators responsible for maintaining backups of large quantities of moderately volatile data will find this extremely useful.
With incremental dumps, time-intensive full backups can be performed less often with shorter incremental dumps used to "fill in the blanks."
The dump command:
The following series of images illustrates several examples:
dump backup command
Backing Up Files with dump
The dump command was historically one of the most commonly used tools for performing backups on UNIX systems. This command traces its history back to the early days of UNIX and thus is a standard part of nearly every version of UNIX. Likewise, the dump package is included in Fedora and Red Hat Enterprise Linux. If it was not installed by default when you first set up your Linux system, you can install it from the dump RPM file located on the Fedora installation DVD.
Note: The dump and restore commands, while widely used for many years, are not considered to be particularly reliable or robust backup and restore tools these days. Also, they can be used only on ext2 and ext3 file system types and it is safest to use dump and restore on unmounted file systems. Descriptions of those tools are included here to support those with legacy backup media and automated scripts that still use those commands. The dump package actually consists of several commands. You can read online man pages for more information about them. Table 4-5 provides a short description of the programs.
Table 4-5: Programs in the dump Package
Command
Description
dump
Creates backup archives of whole disk partitions or selected directories.
restore
Can be used to restore an entire archive or individual files from an archive to the hard drive.
rmt
A program used by the dump and restore commands to copy files across the network. You should never need to use this command directly.
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
Scheduling dumps
The appropriate dump schedule depends on whether you wish to reduce the size of the dumps or the number of restores necessary to recover. To decrease the size of the incremental dumps, use a dump schedule in which the level increases every day. If you wish to minimize the number of restores needed to recover a file system, you should use a dump schedule in which the dump level decreases every day. For example, a dump schedule of zero on Sunday, six on Tuesday, four on Thursday, and two on Saturday would be an appropriate schedule for a stable system with little alteration to the files. In this scenario, only two restores would be needed to reinstate the system: a full restore layered with the incremental restore. The next lesson examines the restore command.
[1]RPM: An acronym for Red Hat Package Manager, an RPM is a group of files stored in a single portable file.