The most recent version of Red Hat Enterprise Linux (RHEL) used in enterprise environments is RHEL 9.4 The `restore` command is still available and used in Red Hat Enterprise Linux (RHEL) 9.4. This command is part of the suite of utilities used for working with backups created by the `dump` command. The `restore` command allows you to extract files from these backups, making it a vital tool for system recovery and data restoration processes in RHEL. The functionality and usage of the `restore` command have remained consistent across various versions of RHEL, including the latest 9.4. The command is typically used in scenarios where you need to recover files from a backup tape or file created with `dump`.
To verify or learn more about specific commands like `restore`, you can always consult the official RHEL documentation or use the `man restore` command in your terminal to access the manual pages directly.
Without simple file recovery commands, backing up data would be useless. The restore command is a companion to dump and as its name implies, it recovers files and file systems after a loss.
- Recovering a entire file system:
To recover an entire file system from tape, use the restore command followed by the device. For example:
restore rf /dev/st0
restores from a backup located in /dev/st0:. Remember that you must create an empty partition using the mkfs command and run the restoration from the empty file system.
To recover individual files and directories, use the following syntax to open a restore session:
restore if /dev/st0
You can use the command `restore rf /dev/st0` to restore data from a backup located on a tape device like `/dev/st0`.
Here's a breakdown of the command:
- `restore`: This is the command used to restore files from a backup created by the `dump` command.
- `r`: This option tells `restore` to run in "restore" mode, which allows it to extract files from the backup.
- `f`: This option specifies the file or device from which to restore. In your case, `/dev/st0` is a typical device file for a tape drive.
When you run `restore rf /dev/st0`, the command will attempt to read the backup data from the tape drive located at `/dev/st0` and restore the files to the current directory (or to the specified directory if you include that as an argument).
Important Considerations:
- Permissions: Ensure that you have the necessary permissions to access the tape device and write to the target directory.
- Correct Tape Device: Confirm that `/dev/st0` is the correct tape device on your system. Some systems may use a different device name.
- Backup Consistency: Make sure the backup on the tape is consistent and has not been corrupted.
You can also use additional options with the `restore` command depending on your needs, such as interactive mode (`i`) to selectively restore files or verbose mode (`v`) to see more detailed output.
Some important commands available at the restore prompt:
- add: Selects files or directories for extraction
- delete: Removes files or directories from the extraction list
- extract: Performs the recovery of selected files and directories
- quit: Exits the restore session
The following section discusses the dump and restore commands in Red Hat.
This exercise asked you to use the dump command to create a full backup of all files altered in the /home file system, then to test the backup by recovering the entire file system to a temporary partition using the restore command. To perform the initial full backup, you used the dump
command: dump 0uf /dev/st0 /home.
The command syntax acts as the following: 0 specifies the dump level (full backup), u indicates that the backup should be recorded in the /etc/dumpdates file, and f allows the user to specify a device or file name. /dev/st0 is the name of the storage device and /home defines the file system to be archived.
To recover the file system /home, you used the restore command: restore if /dev/st0 /test.
The command syntax acts as the following: i specifies interactive mode and f indicates the name the user gives the dump archive.
/dev/st0
is the name of the dump archive from which to recover the files, and /test is the location to which to extract the files. Once in the restoration session, you used the interactive commands add, extract, and quit to add the /home file system to the extraction list, perform the extraction, and exit the program.
If you have ever suffered a hard drive crash, you know just how aggravating it can be.
You can lose irreplaceable data. You will likely spend countless hours reinstalling your operating system and applications.
It is not a fun experience and need happen only once for you to learn the importance of making regular backups of your critical data.
Today, larger and faster backup media can simplify the process of backing up your data. Fedora and RHEL support many different types of media, such as writable CD (CD-R and CD-RW), DVD (DVD-R, DVD+R, DVD+RW, and DVD-RW), and magnetic tape, for creating backups.
Using tools such as cron, you can configure backups to run unattended at scheduled times.
This chapter describes how to create a backup strategy and how to select media for backing up data on your Fedora or RHEL system. It tells you how to do automated backups and backups over a network. It also describes how to restore individual files, or entire file systems, using tools such as the restore command.
The next lesson describes tape backup applications.