Restore

Used to restore partitions on OpenBSD made with dump.

To restore from the dump file to the current directory, first check the size of the dump:

$ du -sh home.dmp
29G   home.dmp

We will need at least 29G of disk space in order to restore home.dmp.

WARNING: restore will overwrite the current directory! Double check your current working directory with pwd before proceeding.

$ doas restore -rf home.dmp

-r restores the file system and -f reads it from the file home.dmp.

NOTE: It is recommended that you restore on a newly created filesystem, see the man page for details.

Interactive Restore

You can start restore in interactive mode. This gives you limited shell capabilities to navigate the backup to find the files you wish to restore. You start it with -i for interactive. Note your prompt changes to restore >.

doas restore -if var.dmp
restore >

You can use cd and ls to view the files. When you find a file or directory you wish to restore you use the add command to add it to the extraction list. Once you have all the files selected you wish to extract you run the extract command

# Extract current directory and everything under it
restore > add
# list files in the www/logs dir
restore > ls www/logs
./www/logs:
access.log      access.log.2.gz error.log.0.gz  error.log.3.gz  error.log.6.gz
access.log.0.gz access.log.3.gz error.log.1.gz  error.log.4.gz
access.log.1.gz error.log       error.log.2.gz  error.log.5.gz
restore > add www/logs/access.log
restore > extract
You have not read any tapes yet.
Unless you know which volume your file(s) are on you should start
with the last volume and work towards the first.
Specify next volume #: 1
set owner/mode for '.'? [yn] y
restore > q

dump and restore were created for tape backup systems so expect your backup is on multiple volumes. If you backed up to a file, it'll always be 1 unless you specified a blocksize causing it to break the backup into multiple volumes. See the man page for details.