Next pass through this chapter.
Clarified text in File System Backups Redid examples in Directory Backups to show how 3 utils differ when creating similar backups. New examples are aimed at what a new user is likely to do. More complex examples should be added. Next pass will finish this section, to be followed by white space fix-ups. Sponsored by: iXsystems
This commit is contained in:
parent
a2f0cd2ed9
commit
1f12522bb7
Notes:
svn2git
2020-12-08 03:00:23 +00:00
svn path=/head/; revision=43698
1 changed files with 113 additions and 99 deletions
|
@ -1123,12 +1123,12 @@ cd0: Attempt to query device size failed: NOT READY, Medium not present - tray c
|
|||
|
||||
<note>
|
||||
<para>In order to support working files larger than 4.38GB, an
|
||||
UDF/ISO-9660 hybrid filesystem must be created by passing
|
||||
UDF/ISO-9660 hybrid file system must be created by passing
|
||||
<option>-udf -iso-level 3</option> to &man.mkisofs.8; and
|
||||
all related programs, such as &man.growisofs.1;. This is
|
||||
required only when creating an ISO image file or when
|
||||
writing files directly to a disk. Since a disk created this
|
||||
way must be mounted as an UDF filesystem with
|
||||
way must be mounted as an UDF file system with
|
||||
&man.mount.udf.8;, it will be usable only on an UDF aware
|
||||
operating system. Otherwise it will look as if it contains
|
||||
corrupted files.</para>
|
||||
|
@ -1610,7 +1610,7 @@ cd0: Attempt to query device size failed: NOT READY, Medium not present - tray c
|
|||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para>Filesystem snapshots, which are useful for restoring
|
||||
<para>File system snapshots, which are useful for restoring
|
||||
deleted files or previous versions of files.</para>
|
||||
</listitem>
|
||||
|
||||
|
@ -1650,24 +1650,20 @@ cd0: Attempt to query device size failed: NOT READY, Medium not present - tray c
|
|||
<primary><command>restore</command></primary>
|
||||
</indexterm>
|
||||
|
||||
<para>The traditional &unix; backup programs are
|
||||
<command>dump</command> and <command>restore</command>. They
|
||||
operate on the drive as a collection of disk blocks, below the
|
||||
abstractions of files, links and directories that are created
|
||||
by the file systems. Unlike other backup software,
|
||||
<command>dump</command> backs up an entire file system on a
|
||||
device. It is unable to backup only part of a file system or
|
||||
a directory tree that spans more than one file system.
|
||||
<command>dump</command> does not write files and directories,
|
||||
but rather writes the raw data blocks that comprise files and
|
||||
directories. When used to extract data,
|
||||
<command>restore</command> stores temporary files in
|
||||
<filename>/tmp/</filename> by default. When using a recovery
|
||||
disk with a small <filename>/tmp</filename>, set
|
||||
<envar>TMPDIR</envar> to a directory with more free space in
|
||||
order for the restore to succeed.</para>
|
||||
<para>The traditional &unix; programs for backing up a file
|
||||
system are &man.dump.8;, which creates the backup, and
|
||||
&man.restore.8;, which restores the backup. These utilities
|
||||
work at the disk block level, below the
|
||||
abstractions of the files, links, and directories that are created
|
||||
by file systems. Unlike other backup software,
|
||||
<command>dump</command> backs up an entire file system and
|
||||
is unable to backup only part of a file system or
|
||||
a directory tree that spans multiple file systems.
|
||||
Instead of writing files and directories, <command>dump</command>
|
||||
writes the raw data blocks that comprise files and
|
||||
directories.</para>
|
||||
|
||||
<note>
|
||||
<note>
|
||||
<para>If <command>dump</command> is used on the root
|
||||
directory, it will not back up <filename>/home</filename>,
|
||||
<filename>/usr</filename> or many other
|
||||
|
@ -1675,39 +1671,34 @@ cd0: Attempt to query device size failed: NOT READY, Medium not present - tray c
|
|||
file systems or symbolic links into those file
|
||||
systems.</para>
|
||||
</note>
|
||||
|
||||
<para>When used to restore data,
|
||||
<command>restore</command> stores temporary files in
|
||||
<filename>/tmp/</filename> by default. When using a recovery
|
||||
disk with a small <filename>/tmp</filename>, set
|
||||
<envar>TMPDIR</envar> to a directory with more free space in
|
||||
order for the restore to succeed.</para>
|
||||
|
||||
<para><command>dump</command> has quirks that remain from its
|
||||
<para>When using <command>dump</command>, be aware that some quirks remain from its
|
||||
early days in Version 6 of AT&T &unix;,circa 1975. The
|
||||
default parameters are suitable for 9-track tapes (6250 bpi),
|
||||
not the high-density media available today (up to 62,182
|
||||
ftpi). These defaults must be overridden on the command line
|
||||
to utilize the capacity of current tape drives.</para>
|
||||
default parameters assume a backup to a 9-track tape, rather than
|
||||
to another media or the high-density tapes available today.
|
||||
These defaults must be overridden on the command line.</para>
|
||||
|
||||
<indexterm>
|
||||
<primary><filename>.rhosts</filename></primary>
|
||||
</indexterm>
|
||||
<para>It is also possible to backup data across the network to a
|
||||
tape drive attached to another computer with
|
||||
<command>rdump</command> and <command>rrestore</command>.
|
||||
Both programs rely upon &man.rcmd.3; and &man.ruserok.3; to
|
||||
access the remote tape drive. Therefore, the user performing
|
||||
the backup must be listed in <filename>.rhosts</filename> on
|
||||
the remote computer. The arguments to
|
||||
<command>rdump</command> and <command>rrestore</command> must
|
||||
be suitable to use on the remote computer. For example, to
|
||||
<command>rdump</command> from a &os; computer to an Exabyte
|
||||
tape drive connected to a host called
|
||||
<systemitem>komodo</systemitem>, use:</para>
|
||||
<para>It is possible to backup a file system across the network to a
|
||||
another system or to a tape drive attached to another computer.
|
||||
While the &man.rdump.8; and &man.rrestore.8; utilities can be
|
||||
used for this purpose, they are not considered to be secure.</para>
|
||||
|
||||
<screen>&prompt.root; <userinput>/sbin/rdump 0dsbfu 54000 13000 126 komodo:/dev/nsa8 /dev/da0a 2>&1</userinput></screen>
|
||||
|
||||
<para>There are security implications to allowing
|
||||
<filename>.rhosts</filename> authentication, so use
|
||||
with caution.</para>
|
||||
|
||||
<para>It is also possible to use <command>dump</command> and
|
||||
<command>restore</command> in a more secure fashion over
|
||||
<command>ssh</command>.</para>
|
||||
<para>Instead, one can use <command>dump</command> and
|
||||
<command>restore</command> in a more secure fashion over an
|
||||
<acronym>SSH</acronym> connection. This example creates a
|
||||
full, compressed backup of the <filename>/usr</filename> file
|
||||
system and sends the backup file to the specified host over a
|
||||
<acronym>SSH</acronym> connection.</para>
|
||||
|
||||
<example>
|
||||
<title>Using <command>dump</command> over
|
||||
|
@ -1717,7 +1708,9 @@ cd0: Attempt to query device size failed: NOT READY, Medium not present - tray c
|
|||
targetuser@targetmachine.example.com dd of=/mybigfiles/dump-usr-l0.gz</userinput></screen>
|
||||
</example>
|
||||
|
||||
<para>Or, use the built-in <envar>RSH</envar>:</para>
|
||||
<para>This example sets <envar>RSH</envar> in order to write the
|
||||
the backup to a tape drive on a remote system over a
|
||||
<acronym>SSH</acronym> connection:</para>
|
||||
|
||||
<example>
|
||||
<title>Using <command>dump</command> over
|
||||
|
@ -1738,60 +1731,73 @@ cd0: Attempt to query device size failed: NOT READY, Medium not present - tray c
|
|||
|
||||
<para>Several built-in utilities are available for backing up
|
||||
and restoring specified files and directories as needed.</para>
|
||||
|
||||
<para>&man.tar.1; also dates back to Version 6 of AT&T
|
||||
&unix;, circa 1975. <command>tar</command> operates in
|
||||
cooperation with the file system and writes files and
|
||||
directories to tape. <command>tar</command> does not support
|
||||
the full range of options that are available from
|
||||
&man.cpio.1;, but it does not require the unusual command
|
||||
pipeline that <command>cpio</command> uses.</para>
|
||||
|
||||
<para>A good choice for making a backup of all of the files in a
|
||||
directory is &man.tar.1;. This utility dates back to Version 6 of AT&T
|
||||
&unix; and by default assumes a recursive backup to a local tape
|
||||
device. Switches can be used to instead specify the name of
|
||||
a backup file.</para>
|
||||
|
||||
<indexterm><primary><command>tar</command></primary></indexterm>
|
||||
|
||||
<para>To <command>tar</command> to an Exabyte tape drive
|
||||
connected to a host called
|
||||
<systemitem>komodo</systemitem>:</para>
|
||||
<para>This example creates a compressed backup of the current
|
||||
directory and saves it to
|
||||
<filename>/tmp/mybackup.tgz</filename>. When creating a
|
||||
backup file, make sure that the backup is not saved to the
|
||||
same directory that is being backed up.</para>
|
||||
|
||||
<screen>&prompt.root; <userinput>tar cf - . | rsh komodo dd of=tape-device obs=20b</userinput></screen>
|
||||
<example>
|
||||
<title>Backing Up the Current Directory With
|
||||
<command>tar</command></title>
|
||||
|
||||
<screen>&prompt.root; <userinput>tar czvf /tmp/mybackup.tgz . </userinput></screen>
|
||||
</example>
|
||||
|
||||
<para>When backing up over an insecure network, instead use
|
||||
<command>ssh</command>.</para>
|
||||
<para>To restore the entire backup, <command>cd</command> into
|
||||
the directory to restore into and specify the name of the
|
||||
backup. Note that this will overwrite any newer versions of
|
||||
files in the restore directory. When in doubt, restore to a
|
||||
temporary directory or specify the name of the file within the
|
||||
backup to restore.</para>
|
||||
|
||||
<example>
|
||||
<title>Restoring Up the Current Directory With
|
||||
<command>tar</command></title>
|
||||
|
||||
<screen>&prompt.root; <userinput>tar xzvf /tmp/mybackup.tgz</userinput></screen>
|
||||
</example>
|
||||
|
||||
<para>There are dozens of available switches which are described
|
||||
in &man.tar.1;. This utility also supports the use of exclude
|
||||
patterns to specify which files should not be included when
|
||||
backing up the specified directory or restoring files from a
|
||||
backup.</para>
|
||||
|
||||
<indexterm>
|
||||
<primary>backup software</primary>
|
||||
<secondary><command>cpio</command></secondary>
|
||||
</indexterm>
|
||||
|
||||
<para>&man.cpio.1; is the original &unix; file interchange tape
|
||||
program for magnetic media. <command>cpio</command> includes
|
||||
options to perform byte-swapping, write a number of different
|
||||
archive formats, and pipe the data to other programs. This
|
||||
last feature makes <command>cpio</command> an excellent choice
|
||||
for installation media. <command>cpio</command> does not know
|
||||
how to walk the directory tree and a list of files must be
|
||||
provided through <filename>stdin</filename>.</para>
|
||||
<para>To create a backup using a specified list of files and
|
||||
directories, &man.cpio.1; is a good choice. Unlike
|
||||
<command>tar</command>,
|
||||
<command>cpio</command> does not know
|
||||
how to walk the directory tree and it must be provided the list of files
|
||||
to backup.</para>
|
||||
|
||||
<indexterm>
|
||||
<primary><command>cpio</command></primary>
|
||||
</indexterm>
|
||||
<para>For example, a list of files can be created using
|
||||
<command>ls</command> or <command>find</command>. This example
|
||||
creates a recursive listing of the current directory which is
|
||||
then piped to <command>cpio</command> in order to create an
|
||||
output backup file named
|
||||
<filename>/tmp/mybackup.cpio</filename>.</para>
|
||||
|
||||
<para>Since <command>cpio</command> does not support backups
|
||||
across the network, use a pipeline and <command>ssh</command>
|
||||
to send the data to a remote tape drive.</para>
|
||||
|
||||
<screen>&prompt.root; <userinput>for f in directory_list; do</userinput>
|
||||
<userinput>find $f >> backup.list</userinput>
|
||||
<userinput>done</userinput>
|
||||
&prompt.root; <userinput>cpio -v -o --format=newc < backup.list | ssh user@host "cat > backup_device"</userinput></screen>
|
||||
|
||||
<para>Where <replaceable>directory_list</replaceable> is the
|
||||
list of directories to back up,
|
||||
<replaceable>user</replaceable>@<replaceable>host</replaceable>
|
||||
is the user/hostname combination that will be performing the
|
||||
backups, and <replaceable>backup_device</replaceable> is where
|
||||
the backups should be written to, such as
|
||||
<filename>/dev/nsa0</filename>).</para>
|
||||
<example>
|
||||
<title>Using<command>ls</command> and <command>cpio</command>
|
||||
to Make a Recursive Backup of the Current Directory</title>
|
||||
|
||||
<screen>&prompt.root; <userinput>ls -R | cpio -ovF /tmp/mybackup.cpio</userinput></screen>
|
||||
</example>
|
||||
|
||||
<indexterm>
|
||||
<primary>backup software</primary>
|
||||
|
@ -1801,16 +1807,24 @@ cd0: Attempt to query device size failed: NOT READY, Medium not present - tray c
|
|||
<indexterm><primary>POSIX</primary></indexterm>
|
||||
<indexterm><primary>IEEE</primary></indexterm>
|
||||
|
||||
<para>&man.pax.1; is the IEEE/&posix; answer to
|
||||
<command>tar</command> and <command>cpio</command>. Over the
|
||||
years the various versions of <command>tar</command> and
|
||||
<command>cpio</command> have become slightly incompatible. So
|
||||
rather than fight it out to fully standardize them, &posix;
|
||||
created a new archive utility. <command>pax</command>
|
||||
<para>A backup utility which tries to bridge the features provided by
|
||||
<command>tar</command> and <command>cpio</command> is &man.pax.1;. Over the
|
||||
years, the various versions of <command>tar</command> and
|
||||
<command>cpio</command> became slightly incompatible. &posix;
|
||||
created <command>pax</command> which
|
||||
attempts to read and write many of the various
|
||||
<command>cpio</command> and <command>tar</command> formats,
|
||||
plus new formats of its own. Its command set more resembles
|
||||
<command>cpio</command> than <command>tar</command>.</para>
|
||||
plus new formats of its own.</para>
|
||||
|
||||
<para>The <command>pax</command> equivalent to the previous
|
||||
examples would be:</para>
|
||||
|
||||
<example>
|
||||
<title>Backing Up the Current Directory With
|
||||
<command>pax</command></title>
|
||||
|
||||
<screen>&prompt.root; <userinput>pax -wf /tmp/mybackup.pax .</userinput></screen>
|
||||
</example>
|
||||
</sect2>
|
||||
|
||||
<sect2 xml:id="backups-programs-amanda">
|
||||
|
@ -1929,7 +1943,7 @@ cd0: Attempt to query device size failed: NOT READY, Medium not present - tray c
|
|||
Select the correct country, then choose
|
||||
<guimenuitem>Fixit -- Repair mode with CD-ROM/DVD/floppy or
|
||||
start a shell.</guimenuitem> then select
|
||||
<guimenuitem>CD-ROM/DVD -- Use the live filesystem
|
||||
<guimenuitem>CD-ROM/DVD -- Use the live file system
|
||||
CD-ROM/DVD</guimenuitem>.
|
||||
<command>restore</command> and the other needed programs
|
||||
are located in <filename>/mnt2/rescue</filename>.</para>
|
||||
|
@ -3588,13 +3602,13 @@ Device 1K-blocks Used Avail Capacity
|
|||
reports 0 bytes of <literal>dirty</literal> extents.</para>
|
||||
|
||||
|
||||
<para>The next step is to create a filesystem on the
|
||||
<para>The next step is to create a file system on the
|
||||
<filename>/dev/hast/test</filename>
|
||||
GEOM provider and mount it. This must be done on the
|
||||
<literal>primary</literal> node, as
|
||||
<filename>/dev/hast/test</filename>
|
||||
appears only on the <literal>primary</literal> node. Creating
|
||||
the filesystem can take a few minutes, depending on the size
|
||||
the file system can take a few minutes, depending on the size
|
||||
of the hard drive:</para>
|
||||
|
||||
<screen>&prompt.root; <userinput>newfs -U /dev/hast/test</userinput>
|
||||
|
|
Loading…
Reference in a new issue