RESTORE(8)
๐ RESTORE(8) ๐
system management commands, but make it a group chat ๐ซถ
okay bestie, sit DOWN, because this one is the absolute crown jewel of disaster recovery and i need you to be so fr fr locked in for it. it's restore, from section 8 of the manual (that's the sysadmin zone, the grown-up zone ๐
), and it's basically dump(8)'s other half. the comeback arc. the "girl, we can fix this" energy. โจ
โจ NAME โจ
restore โ restore files or filesystems from backups made with dump
like. the whole point. the entire vibe. no cap. ๐
๐ธ SYNOPSIS ๐ธ
restore -C [-cdHklMqvVy] [-b blocksize] [-D filesystem] [-f file] [-F
script] [-L limit] [-s fileno] [-T directory]
restore -i [-acdhHklmMNoquvVy] [-A file] [-b blocksize] [-f file] [-F
script] [-Q file] [-s fileno] [-T directory]
restore -P file [-acdhHklmMNquvVy] [-b blocksize] [-f file] [-F script]
[-s fileno] [-T directory] [-X filelist] [ file ... ]
restore -R [-cdHklMNquvVy] [-b blocksize] [-f file] [-F script] [-s
fileno] [-T directory]
restore -r [-cdHklMNquvVy] [-b blocksize] [-f file] [-F script] [-s
fileno] [-T directory]
restore -t [-cdhHklMNquvVy] [-A file] [-b blocksize] [-f file] [-F
script] [-Q file] [-s fileno] [-T directory] [-X filelist] [ file ... ]
restore -x [-adchHklmMNoquvVy] [-A file] [-b blocksize] [-f file] [-F
script] [-Q file] [-s fileno] [-T directory] [-X filelist] [ file ... ]
look at all those flags. it's giving โจoptionsโจ. every single one of them matters and we're gonna get to every single one, don't you worry ๐
๐ DESCRIPTION ๐
restore does the inverse function of dump(8). read that again. it's the undo button. the uno reverse card. ๐ฆ
so here's the tea:
- a full backup of a filesystem can be restored, and then subsequent incremental backups get layered on top of it. lasagna style. ๐
- you can also just grab single files and directory subtrees out of full or partial backups. you don't have to take the whole thing, she's flexible.
restoreworks across a network โ for that, peep the-fflag down below, it's the one that makes it happen.- any other arguments to the command are file or directory names specifying the files that are to be restored.
- and unless the
-hflag is specified (again, see below, bestie), when you name a directory, it means the files and (recursively) subdirectories of that directory. so like. the whole tree. the full bloodline. ๐ญ
๐ exactly one. ONE. of the following flags is required ๐
not two. not zero. exactly one. this is the vibe check and you WILL pass it or restore will be so disappointed in you ๐
-C
this mode lets you compare files from a dump. restore reads the backup and compares its contents with the files that are actually present on the disk. it first changes its working directory to the root of the filesystem that was dumped, and then it compares the tape with the files in its new current directory. also go look at the -L flag described below, it's her partner in crime. ๐ฏ
-i
the interactive one. the main character mode. ๐ after reading in the directory information from the dump, restore gives you a little shell-like interface so you can move around the directory tree and hand-pick which files get extracted. it's like shopping but for your own data, iconic.
the available commands are below โ and for those commands that need an argument, the default is the current directory. ๐๏ธ
โจ the interactive commands โจ
add [arg]
the current directory, or the argument you specified, gets added to the list of files to be extracted. if you name a directory, then it and all its descendants get added to the extraction list (unless the -h flag was specified on the command line, obviously). files that are on the extraction list get a โ*โ prepended to them when they're listed by ls. little star. little celebrity. โญ
cd arg
change the current working directory to the specified argument. classic. we love her. ๐ถโโ๏ธ
delete [arg]
the current directory, or the argument you specified, gets deleted from the list of files to be extracted. and yeah, if it's a directory, then it and all its descendants come off the extraction list (unless, once again, the -h flag was specified on the command line).
okay and here's the pro tip from the ancestors: the most expedient way to extract most of the files from a directory is to add the directory to the extraction list and then delete those files that are not needed. add everything, remove the crumbs. so efficient. ๐
extract
all files on the extraction list are extracted from the dump. restore will ask you which volume you wish to mount. and the fastest way to extract a few files is to start with the last volume and work toward the first volume. backwards and unbothered. ๐
help
list a summary of the available commands. your little cheat sheet. your safety net. ๐ซถ
ls [arg]
list the current or specified directory. entries that are directories get a โ/โ appended. entries that have been marked for extraction get a โ*โ prepended. and if the verbose flag is set, the inode number of each entry also gets listed. receipts. ๐งพ
pwd
print the full pathname of the current working directory. where am i. who am i. what is a filesystem. ๐
quit
restore immediately exits, even if the extraction list is not empty. she does not do lingering goodbyes. she's gone. ๐จ
setmodes
every directory that's been added to the extraction list gets its owner, modes, and times set; nothing is extracted from the dump. this is for cleaning up after a restore has been prematurely aborted. the "okay we're not doing this today" command. ๐
verbose
toggles the sense of the -v flag. when it's set, the verbose flag causes the ls command to list the inode numbers of all entries. it also causes restore to print out information about each file as it is extracted. she narrates. she's a talker. ๐ฃ๏ธ
-P file
restore creates a new Quick File Access file file from an existing dump file, without restoring its contents. just the index, no main event. ๐
-R
restore requests a particular tape of a multi-volume set on which to restart a full restore (see the -r flag below). this is useful if the restore has been interrupted. we've all been interrupted. it's fine. resume. ๐
-r
restore (rebuild) a filesystem.
okay so listen carefully because this one has RULES. the target filesystem should be made pristine with mke2fs(8), mounted, and the user should cd into the pristine filesystem before starting the restoration of the initial level 0 backup. if the level 0 restores successfully, the -r flag may be used to restore any necessary incremental backups on top of the level 0.
and now, the warning, said dramatically because it is dramatic:
the -r flag precludes an interactive file extraction and can be detrimental to one's health (not to mention the disk) if not used carefully. ๐จ๐
an example, so you don't have to guess:
mke2fs /dev/sda1
mount /dev/sda1 /mnt
cd /mnt
restore -r -f /dev/st0
note that restore leaves a file restoresymtable in the root directory to pass information between incremental restore passes. this file should be removed when the last incremental has been restored. don't leave her hanging around, she's done her job. ๐
restore, in conjunction with mke2fs(8) and dump(8), may be used to modify filesystem parameters such as size or block size. glow-up your filesystem. โจ
-t
the names of the specified files are listed if they occur on the backup. if no file argument is given, the root directory is listed, which results in the entire content of the backup being listed, unless the -h flag has been specified.
also note that the -t flag replaces the function of the old dumpdir(8) program. she's the new girl and she's doing it better. ๐
see also the -X option below. and ooo, if the -0 flag is used, the output separator is the null character (instead of the newline character). null. the quiet one. ๐
-x
the named files are read from the given media. if a named file matches a directory whose contents are on the backup and the -h flag is not specified, the directory is recursively extracted. the owner, modification time, and mode are restored (if possible โ no promises, bestie ๐ซถ).
if no file argument is given, the root directory is extracted, which results in the entire content of the backup being extracted, unless the -h flag has been specified.
see also the -X option below. yes, again. she's that important. ๐
โจ OPTIONS โจ
okay so here's the extra stuff you can tack on, bestie ๐
-a,--no-ask-volumeโ so when you're in-ior-xmode,restoreliterally pops the question and asks you which volume number the files you want are on (the whole point being it only reads the interesting volumes, so it's faster). This flag says "no thank u, no questions" and just reads every volume starting from 1. Which is the move when you genuinely have no idea which volume has your files, or when you'd rather sit through a longer run that doesn't need you, instead of a shorter run that keeps bugging you. unattended mode >> interactive mode, lowkey. ๐โโ๏ธ-A,--archive-filearchive_file โ read the table of contents out of archive_file instead of off the media itself. Team it up with-t,-i, or-xand you can check whether files are even on the media without mounting the media. no mounting, no drama. ๐-b,--block-sizeblocksize โ how many kilobytes go in each dump record. Skip this flag andrestorewill try to figure out the media block size dynamically, like the icon it is. โจ-c,--old-formatโ normallyrestorevibes it out on its own and detects whether the dump came from an old (pre-4.4) or new format filesystem. This flag turns that check off and only lets you read a dump in the old format. that's the whole personality. ๐-d,--debugโ makesrestorespill debug information. talkative king. ๐ฃ๏ธ-D,--filesystem-namefilesystem โ lets you name the filesystem when you're runningrestorewith the-Coption to check the backup.-f,--input-filefile โ read the backup from file. and file can be honestly whatever: a special device file like/dev/st0(tape drive) or/dev/sda1(disk drive), a plain ordinary file, or-which means standard input. If the name looks likehost:fileoruser@host:file,restorereads that named file off the remote host usingrmt(8). remote bestie behavior fr fr ๐-F,--sot-scriptscript โ run script at the beginning of every single tape. the device name and the current volume number get passed in on the command line. the script has to return0ifrestoreshould keep going without asking you to swap the tape, or1ifrestoreshould keep going but do ask you to swap the tape. literally any other exit code andrestoreaborts, no discussion. and for security reasons,restorereverts back to the real user ID and the real group ID before it runs the script. safety first, always. ๐-h,--no-hierarchical-restoreโ extract the actual directory itself, not the files it references. this blocks hierarchical restoration of complete subtrees from the dump. one layer, that's it.-H,--hash-sizehash_size โ use a hashtable with the number of entries you pick for storing the directory entries, instead of a linked list. this hashtable speeds up inode lookups a lot (you really notice it in interactive mode when you're adding/removing files from the restore list) โ but the price is much more memory usage. the default value is1, which means no hashtable at all. trade-offs, bestie. ๐-k,--kerberosโ use Kerberos authentication when you contact the remote tape server. (only available if this option was enabled whenrestorewas compiled โ so it might just not exist for you, rip.)-L,--max-miscompareslimit โ lets you set a maximal number of miscompares when you're usingrestorewith the-Coption to check the backup. hit that limit andrestoreaborts with an error message. a value of0(the default) disables the check entirely. ๐-m,--extract-by-inodeโ extract by inode numbers instead of by filename. this one's for when you're only pulling out a few files and you want to dodge regenerating the complete pathname for the file. efficiency, periodt. โก-M,--multivolumeโ turns on the multi-volume feature (for reading dumps that were made using the-Moption ofdump). the name you gave with-fgets treated as a prefix, andrestoretries to read in sequence from<prefix>001,<prefix>002and so on. so many volumes, so little time ๐ผ-N,--no-writeโrestoredoes a full execution exactly as requested by one of the-i,-R,-r,-tor-xcommands, but without actually writing any file on disk. purely a rehearsal, no consequences. ๐-o,--set-curr-dir-permsโ automatically restores the current directory permissions, no asking the operator whether to do it in one of-ior-xmodes. it just does it. โจ--no-set-curr-dir-permsโ leaves the current directory permissions unchanged, and also doesn't ask the operator whether to do it in one of-ior-xmodes. and btw, if you give both this and--set-curr-dir-perms, this flag takes priority. it wins. ๐-q,--abort-on-interventionโ aborts immediately the instant operator attention is needed. no prompting for read errors, no prompting for tape changes, none of it. if it needs you, it's out. ๐-Q,--QFAfilefile โ use the file file to read the tape position as stored using thedumpQuick File Access mode, in one of-i,-xor-tmode.
okay genuine heads-up bestie, this one has lore. it's recommended that you set up thestdriver to return logical tape positions rather than physical ones before you calldump/restorewith the-Qparameter. because not all tape devices support physical tape positions, and those devices will return an error duringdump/restorewhen thestdriver is sitting on its default physical setting. check thest(4)man page, the optionMTSETDRVBUFFER, or themt(1)man page for how to set the driver to return logical tape positions. and before you callrestorewith-Q, always make sure thestdriver is set to return the same type of tape position that was used during the call todump. otherwiserestoremay get confused. ๐ญ
this option works when you're restoring from local or remote tapes (see above) or from local or remote files.
-s,--read-from-tape-filenofileno โ read from the fileno you specify on a multi-file tape. file numbering starts at1. not zero, bestie, one. ๐-T,--tmp-dirdirectory โ lets you pick a directory to use for storing temporary files. default value is/tmp. this flag is most useful when you're restoring files after having booted from a floppy โ because there might be little or no space on the floppy filesystem, but another source of space might exist somewhere else. ๐ธ-u,--unlink-existingโ when it's creating certain types of files,restoremay throw a warning diagnostic if those files already exist in the target directory. to stop that, the-u(unlink) flag makesrestoreremove the old entries before it tries to create the new ones. out with the old, in with the new ๐ฅ-v,--verboseโ normallyrestoredoes its work silently, like a mystery. the-v(verbose) flag makes it print the name of each file it treats, preceded by its file type. narration on ๐๏ธ-0,--zero-terminatorโ the (zero terminated) flag makes the output lines zero terminated instead of line feed terminated. this flag is only recognized for-t(listing). just the one job. ๐ฏ-V,--multi-volume-non-tape-mediumโ enables reading multi-volume non-tape media, like CDROMs. ๐-X,--extractlist-filefilelist โ read a list of files to be listed or extracted out of the text file filelist, on top of whatever you already put on the command line. you can use this together with the-tor-xcommands. filelist should contain filenames separated by newlines. and filelist can be an ordinary file or-(the standard input). ๐ซถ-y,--no-abort-on-errorโ don't ask the user whether to abort the restore when an error happens. just always try to skip over the bad block(s) and keep going. we persist. ๐ค--ignore-compression-flag-for-0.4b45-dumpsโ v0.4b45 ofdumphad a bug, and what that bug meant is that while the tape recorded that compression had been selected, the tape was actually written uncompressed. this option tellsdumpto ignore the compression flag and assume the dump is uncompressed.
โ ๏ธ this option is only useful for reading these old corrupted dumps, and it will cause errors reading any other compressed dump. so like, don't just leave it on, bestie. ๐
(The 4.3BSD option syntax is implemented for backward compatibility but is not documented here.)
๐ DIAGNOSTICS ๐
so restore will complain if it gets a read error. if the -y flag has been specified, or if the user responds y, restore will attempt to continue the restore. ๐
if a backup was made using more than one tape volume, restore notifies the user when it's time to mount the next volume. and if the -x or -i flag has been specified, restore will also ask which volume the user wishes to mount. pro tip from the source material: the fastest way to extract a few files is to start with the last volume and work toward the first volume. backwards is bestie behavior. ๐
there are numerous consistency checks that can be listed by restore. most of them are self-explanatory or "can never happen" (famous last words ๐). the common errors are given below:
Converting to new filesystem formatโ a dump tape created from the old filesystem has been loaded. it's automatically converted to the new filesystem format. glow up complete โจ<filename>: not found on tapeโ the specified filename was listed in the tape directory, but it wasn't found on the tape. this happens because of tape read errors while looking for the file, and from using a dump tape created on an active filesystem. ๐ญexpected next file <inumber>, got <inumber>โ a file that was not listed in the directory showed up. this can occur when you're using a dump created on an active filesystem.Incremental dump too lowโ when you're doing an incremental restore, this means a dump that was written before the previous incremental dump, or that has too low an incremental level, has been loaded. ๐Incremental dump too highโ when you're doing an incremental restore, this means a dump that does not begin its coverage where the previous incremental dump left off, or that has too high an incremental level, has been loaded. ๐Tape read error while restoring <filename>Tape read error while skipping over inode <inumber>Tape read error while trying to resynchronize
โ a tape (or other media) read error has occurred. if a filename is specified, its contents are probably partially wrong. if an inode is being skipped or the tape is trying to resynchronize, no extracted files have been corrupted, though files may not be found on the tape. ๐
resync restore, skipped <num> blocksโ after a dump read error,restoremay have to resynchronize itself. this message lists the number of blocks that were skipped over. counting the casualties fr fr ๐งฎ
๐ฅ EXIT STATUS ๐ฅ
okay bestie, here's the vibe check on how restore says goodbye:
- exit code 0 โ we ate, no crumbs, success ๐
- exit code 1 โ tape errors ๐ญ the tape said no
- exit code 2 โ only in compare mode (
-C): this means some files were modified or deleted since the dump was made, i.e. your live filesystem said "not the same queen" ๐
๐ธ ENVIRONMENT ๐ธ
if these environment variables exist, restore will absolutely utilize them, no cap:
TAPEโ if you didn't pass-f,restoreuses the device you set here as the dump device.TAPEcan be shaped liketapename,host:tapename, oruser@host:tapenameโจTMPDIRโ the directory you put here gets used instead of/tmpfor storing temp files ๐RMTโ this one tellsrestorethe pathname of the remotermt(8)program ๐ซถRSHโrestorereads this to figure out which remote shell command to use for a network restore (rsh,sshetc.). if it's not set,rcmd(3)gets used instead โ but then only root can do a network restore ๐
๐ FILES ๐
/dev/st0โ the default tape drive, the classic ๐พ/tmp/rstdir*โ file containing directories on the tape ๐๏ธ/tmp/rstmode*โ owner, mode, and timestamps for directories ๐./restoresymtableโ info passed between incremental restores, the little messenger ๐ฆ
๐ SEE ALSO ๐
dump(8), mount(8), mke2fs(8), rmt(8)
go read those too, they're all part of the same cinematic universe fr fr ๐
๐ BUGS ๐
okay so this is the part where we keep it real, and some of it is genuinely spooky, so listen up:
restorecan get confused when doing incremental restores from dumps that were made on active filesystems. it's giving chaos ๐- a level 0 dump must be done after a full restore. why? because
restoreruns in user code, so it has no control over inode allocation. that means you have to do a full dump to get a fresh set of directories reflecting the new inode numbering โ even though the content of the files is unchanged. yes really, the content is the same, but the inodes moved, and that's the whole point ๐ค - the temp files
/tmp/rstdir*and/tmp/rstmode*get generated with a unique name based on the date of the dump and the process ID (seemktemp(3)) โ except when-ror-Ris used. because-Rlets you restart a-roperation that may have been interrupted, the temp files should be the same across different processes. in all other cases the files are unique, because it's possible to have two different dumps started at the same time, and separate operations shouldn't conflict with each other ๐ค - to do a network restore, you have to run
restoreas root or use a remote shell replacement (see theRSHvariable). this is due to the previous security history ofdumpandrestore. and listen:restoreis written to be setuid root, but we are not certain all bugs are gone from the code โ run setuid at your own risk ๐จ - at the end of restores in
-ior-xmodes (unless the-ooption is in use),restorewill ask the operator whether to set the permissions on the current directory. if the operator confirms this action, the permissions on the directory from whererestorewas launched get replaced by the permissions on the dumped root inode. although this behaviour isn't really a bug, it has proven itself to be confusing for many users, so it's recommended to answer'no'โ unless you're performing a full restore and you do actually want to restore the permissions on'/'๐ - and one more thing: because
restoreruns in user space, it sees only the files that the kernel exposes when invoked with the-Coption, whereasdumpsees all files on the underlying filesystem. this can lead to confusion when comparing a dumped filesystem with a live one in which part of the original tree is obscured by another filesystem mounted on top of it ๐ซ
bestie, that last one is the "two filesystems, one mount point" jump scare. if your compare is acting weird, check what's mounted where ๐
โ๏ธ AUTHOR โ๏ธ
the dump/restore backup suite was ported to Linux's Second Extended File System by Remy Card <card@Linux.EU.Org>. he maintained the initial versions of dump (up to and including 0.4b4, released in January 1997) ๐ซก
starting with 0.4b5, the new maintainer is Stelian Pop <stelian@popies.net> ๐
since release 0.4b49 the new maintainer is Tim Woodall <debianbugs@woodall.me.uk> ๐
๐ฆ AVAILABILITY ๐ฆ
the dump/restore backup suite is available from https://dump.sourceforge.io โ go get it, it's right there ๐
๐ HISTORY ๐
the restore command appeared in 4.2BSD. ancient. iconic. still here. periodt ๐
and that's the whole page, bestie!! ๐ this one came from the BSD family of man pages โ it's version 0.4b55 of 10 Jun 2026 for RESTORE(8) ๐ ngl, a manual page that ships exit codes, a whole set of env vars, and a bug list with setuid warnings in it? that's main character energy fr ๐ฆ now go make that backup, your filesystem is counting on you ๐ซถโจ
๐ฆ where this page comes from
- ubuntu stonking: dump 0.4b55-3 ยท BSD-3-Clause
- Copyright (c) 1985, 1991, 1993 The Regents of the University of California. All rights reserved
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms