restore command in Linux with Examples Last Updated : 04 Jun, 2024 Comments Improve Suggest changes 2 Likes Like Report restore command in Linux system is used for restoring files from a backup created using dump. The restore command performs the exact inverse function of dump. A full backup of a file system is being restored and subsequent incremental backups layered is being kept on top of it. Single files and directory subtrees can easily be restored from full or partial backups. Restore simply works across a network. Other arguments which need to be pass to the command are file or directory names specifying the files that need to be restored. Syntax: restore -C [-cdHklMvVy] [-b blocksize] [-D filesystem] [-f file] [-F script] [-L limit] [-s fileno] [-T directory] Example: It will be going to print the general syntax of the command along with the various options that can be used with the restore command. Options: restore -a: In -i o -x mode, restore will ask the user for the volume number on which the files needs to be extracted. The -a option simply disables this behavior and reads all the volumes starting with 1.restore -c: Normally, restore will try to determine dynamically whether the dump was made out of an old or from a new format file system. The -c flag simply disables this check, and it only allows reading a dump with the method of the old format.restore -d: The -d (debug) flag causes the restore to print all the debug information.restore -f: This option read the backup from the file that can be a special device file like /devfffrrr5/st0, /dev/sda1 (a disk drive) etc.restore -h: Extract the actual directory, rather than the files which is being referencing. This prevents the hierarchical restoration of complete subtrees from the dump.restore -C: This flag allows comparison of files from a dump. Restore command reads the backup and compares it's with the contents of files present on the disk.restore -i: This flag allows the interactive restoration of files from a dump. After reading the directory information from the dump, restore command provides a shell-like interface which simply allows the user to move around the directory tree selecting files to be extracted.restore -P file: Restore creates a new Quickly File Access file from an existing dump file without any kind of restoring its contents.restore -R: Restore requests a particular tape of the multi-volume set to restart a full restore (see the -r flag below). This is proven useful if the restore has been interrupted.restore -r: Restore a file system. The target file system needs to be made pristine with mke2fs(8), mounted, and the user cd’d into a pristine file system before starting the restoration of the initial level 0 backup.restore -t: The names of the specified files are being listed if they occur on the backup. If no file argument is already given, the root directory is listed by default.restore -x: The names of the files are read from the given media. If a named file matches a particular directory whose contents are on the backup and the -h flag is not specified, the directory is then recursively extracted.restore -k: Uses the Kerberos authentication when contacting the remote tape server (Only available if this option was already enabled when restore was compiled).restore -l: When we are doing remote restores, then assume the remote file is a regular file (instead of a tape device). If you’re supposed to be restoring a remote compressed file, then you will need to specify this option or restore will fail to access it correctly. restore -m: Extracted by the inode numbers rather than by file name. This is proven useful if only a few files are being extracted, and one wants to avoid the regenerating to be completed pathname to the file.restore -m: Simply enables the multi-volume feature (for reading dumps made using the -M option of dump). The name must be specified with -f which is treated as a prefix and restore tries to read in the sequence from 001, 002 etc.restore -N: The -N flag causes the restore to perform a full execution as requested by one of the -i, -R, -r, t or x command without actually writing any file on the disk.restore -o: The -o flag causes the restore to automatically restore the current directory permissions without asking for the operator whether he needs to do so in one of -i or -x modes. restore -Q file: Use the file in order to read the tape position.restore -u: Whenever certain types of files are created, restore may generate a warning diagnostic if they already exist in the target directory. To prevent this, the -u (unlink) flag can causes restore to remove the old entries before attempting to create new ones. restore -v: Normally restore does his work silently under the hood. The -v (verbose) flag causes it to type the name each of file it simply treats preceded by its file type.restore -V: Enables reading a multi-volume non-tape mediums like CDROMs.restore -y: Do not ask for the user whether to abort the restore in the event of an error. It always tries to skip over the bad block and then continue. Example: Let's create a dump sudo tar -xvpzf /home/server/backup.tar.gz -C / --numeric-ownerDump in progress. Let's restore from the dump file sudo tar -cvpzf backup.tar.gz --exclude=/home/server/backup.tar.gz --one-file-system /Restore under progress. Create Quiz Comment R rahulkumarmandal Follow 2 Improve R rahulkumarmandal Follow 2 Improve Article Tags : Linux-Unix linux-command Linux-file-commands Explore Getting Started with LinuxIntroduction to Linux Operating System7 min readLINUX Full Form - Lovable Intellect Not Using XP2 min readDifference between Linux and Windows7 min readLinux Distributions6 min readDifference between Unix and Linux6 min readInstallation with LinuxInstallation of Arch Linux in VirtualBox4 min readFedora Linux Operating System5 min readHow to install Ubuntu on VirtualBox?6 min readHow to Install Linux Mint?3 min readInstallation of Kali Linux in Virtual Machine2 min readHow to Install Linux on Windows PowerShell Subsystem?2 min readHow to Find openSUSE Linux Version?2 min readInstallation of CentOS2 min readLinux CommandsLinux Commands15+ min readEssential Unix Commands7 min readFind Command in Linux with Examples7 min readLinux File SystemLinux File System12 min readLinux File Hierarchy Structure5 min readLinux Directory Structure6 min readLinux KernelLinux Kernel4 min readKernel in Operating System3 min readHow Linux Kernel Boots?11 min readDifference between Operating System and Kernel3 min readLinux Kernel Module Programming: Hello World Program7 min readLinux Loadable Kernel Module7 min readLoadable Kernel Module - Linux Device Driver Development4 min readLinux Networking ToolsNetwork configuration and troubleshooting commands in Linux5 min readHow to configure network interfaces in CentOS?5 min readCommand-Line Tools and Utilities For Network Management in Linux8 min readLinux - Network Monitoring Tools4 min readLinux ProcessProcesses in Linux/Unix5 min readHow to Manage Process in Linux4 min readGetting System and Process Information Using C Programming and Shell in Linux2 min readProcess states and Transitions in a UNIX Process4 min readLinux FirewallLINUX Firewall7 min readiptables command in Linux with Examples7 min readHow to Configure your Linux Firewall - 3 Methods12 min readShell Scripting & Bash ScriptingIntroduction to Linux Shell and Shell Scripting7 min readUnderstanding Terminal, Console, Shell and Kernel3 min readHow to Create a Shell Script in linux7 min readShell Scripting - Different types of Variables4 min readBash Scripting - Introduction to Bash and Bash Scripting12 min readBash Script - Define Bash Variables and its types12 min readShell Scripting - Shell Variables6 min readBash Script - Difference between Bash Script and Shell Script4 min readShell Scripting - Difference between Korn Shell and Bash shell3 min readShell Scripting - Interactive and Non-Interactive Shell3 min readShell Script to Show the Difference Between echo â$SHELLâ and echo â$SHELLâ4 min readLinux Administrator SystemWhat is Linux System Administration?6 min readBeginner's Guide to Linux System Administration5 min readHow to Monitor System Usage, Outages and Troubleshoot Linux Servers6 min readLinux - Systemd and its Components3 min readBoot Process with Systemd in Linux3 min readHow to Control Systemd Services on Remote Linux Server2 min readHow to Start, Stop and Restart Services in Linux Using systemctl Command9 min read Like