Unix dump
Line 26: | Line 26: | ||
* [https://github.com/bitsgalore/unix-dump-magic Unix dump format] - includes some minimal sample files, created for testing magic patterns | * [https://github.com/bitsgalore/unix-dump-magic Unix dump format] - includes some minimal sample files, created for testing magic patterns | ||
+ | |||
+ | == Restoring the contents of a dump file == | ||
+ | |||
+ | To restore the contents of a dump file on a Unix system, first the install the "restore" tool. On Debian-based systems: | ||
+ | |||
+ | <code>sudo apt install dump</code> | ||
+ | |||
+ | Then go through the following steps: | ||
+ | |||
+ | <ol> | ||
+ | <li><p>Create an empty directory, and go to that directory in the command terminal:</p> | ||
+ | <code><p>mkdir extracted</p></code> | ||
+ | <code><p>cd extracted</p></code> | ||
+ | <li><p>Run <code>restore</code> in interactive mode on the dump file you want to extract<ref><p>If you don't run <code>restore</code> as sudo, extraction results in a flood of <code>chown: Operation not permitted</code> messages (the files ''are'' extracted though).</p></ref>:</p> | ||
+ | <code>sudo restore -if ../../tapes-DDS/1/file000002.dd</code></li> | ||
+ | <li><p>Inspect the contents of the dump file:</p> | ||
+ | <code>restore > ls</code> | ||
+ | <p>Result:</p> | ||
+ | <pre> 5bin/ diag/ kvm/ mdec share/ ucbinclude | ||
+ | 5include/ dict/ lddrv/ net spool ucblib | ||
+ | 5lib/ etc/ lib/ nserve src xpg2bin/ | ||
+ | adm export/ local old/ stand xpg2include/ | ||
+ | bin/ games/ local-/ openwin/ sys xpg2lib/ | ||
+ | boot hosts/ lost+found/ pub tmp | ||
+ | demo/ include/ man sccs/ ucb/</pre></li> | ||
+ | <li><p>Use the <code>add</code>command to add directories that are to be extracted to the directory list. To extract everything:</p> | ||
+ | <code>restore > add .</code></li> | ||
+ | <li><p>Run the <code>extract</code> command:</p> | ||
+ | <code>restore > extract</code> | ||
+ | <p>This results in the following prompt:</p> | ||
+ | <pre> You have not read any volumes 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 # (none if no more volumes):</pre></li> | ||
+ | <li><p>Now enter <code>1</code>. Response:</p> | ||
+ | <pre>set owner/mode for '.'? [yn]</pre></li> | ||
+ | <li><p>Enter <code>n</code> <ref><p>This needs further investigation, as the implications of this setting are not 100% clear to me.</p></ref></p></li> | ||
+ | <li><p>When the extraction is finished, exit the interactive restore session:</p> | ||
+ | <code>restore > q</code></li></ol> | ||
== References == | == References == |
Revision as of 17:17, 29 January 2019
dump is an archive format that is written by Unix dump, which is a backup program that was popular in the '90s (reference?). Dump files were often written to tape. Dump files can be read using the restore tool. It appears that no specifications exist.
Contents |
Variants
There are a number of variants to the Unix dump format.
The file(1) magic definition of the format makes a distiction between 'old' and 'new' filesystem variants. Each of these can be big-endian or little endian. In addition a 16-bit subtype of the 'old' variant exists. Finally there is also a ufs2 variant (which again can be big-endian or little endian). In total this results in 7 variants of the format. According to the restore documentation, the dump file format changed in version 4.4 (of the dump tool?).
Software
Documentation
Sample files
- Unix dump format - includes some minimal sample files, created for testing magic patterns
Restoring the contents of a dump file
To restore the contents of a dump file on a Unix system, first the install the "restore" tool. On Debian-based systems:
sudo apt install dump
Then go through the following steps:
Create an empty directory, and go to that directory in the command terminal:
mkdir extracted
cd extracted
Run
restore
in interactive mode on the dump file you want to extract[1]:sudo restore -if ../../tapes-DDS/1/file000002.dd
Inspect the contents of the dump file:
restore > ls
Result:
5bin/ diag/ kvm/ mdec share/ ucbinclude 5include/ dict/ lddrv/ net spool ucblib 5lib/ etc/ lib/ nserve src xpg2bin/ adm export/ local old/ stand xpg2include/ bin/ games/ local-/ openwin/ sys xpg2lib/ boot hosts/ lost+found/ pub tmp demo/ include/ man sccs/ ucb/
Use the
add
command to add directories that are to be extracted to the directory list. To extract everything:restore > add .
Run the
extract
command:restore > extract
This results in the following prompt:
You have not read any volumes 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 # (none if no more volumes):
Now enter
1
. Response:set owner/mode for '.'? [yn]
Enter
n
[2]When the extraction is finished, exit the interactive restore session:
restore > q
References
- Wikipedia:Dump_(program)
- Is dump really deprecated?
- Using Dump for Linux/Unix data backup
- Restore Linux Commands
- How to Restore UFS Files Interactively
- file(1) magic for dump file format (also includes patterns for extraction of header fields)
Cite error:
<ref>
tags exist, but no <references/>
tag was found