From owner-svn-doc-head@FreeBSD.ORG Thu Jan 30 21:06:20 2014 Return-Path: Delivered-To: svn-doc-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B3207AD7; Thu, 30 Jan 2014 21:06:20 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9DBE61597; Thu, 30 Jan 2014 21:06:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id s0UL6Ka6034023; Thu, 30 Jan 2014 21:06:20 GMT (envelope-from dru@svn.freebsd.org) Received: (from dru@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id s0UL6KVB034022; Thu, 30 Jan 2014 21:06:20 GMT (envelope-from dru@svn.freebsd.org) Message-Id: <201401302106.s0UL6KVB034022@svn.freebsd.org> From: Dru Lavigne Date: Thu, 30 Jan 2014 21:06:20 +0000 (UTC) To: doc-committers@freebsd.org, svn-doc-all@freebsd.org, svn-doc-head@freebsd.org Subject: svn commit: r43698 - head/en_US.ISO8859-1/books/handbook/disks X-SVN-Group: doc-head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-doc-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the doc tree for head List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Jan 2014 21:06:20 -0000 Author: dru Date: Thu Jan 30 21:06:20 2014 New Revision: 43698 URL: http://svnweb.freebsd.org/changeset/doc/43698 Log: 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 Modified: head/en_US.ISO8859-1/books/handbook/disks/chapter.xml Modified: head/en_US.ISO8859-1/books/handbook/disks/chapter.xml ============================================================================== --- head/en_US.ISO8859-1/books/handbook/disks/chapter.xml Thu Jan 30 19:00:09 2014 (r43697) +++ head/en_US.ISO8859-1/books/handbook/disks/chapter.xml Thu Jan 30 21:06:20 2014 (r43698) @@ -1123,12 +1123,12 @@ cd0: Attempt to query device size failed 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 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. @@ -1610,7 +1610,7 @@ cd0: Attempt to query device size failed - Filesystem snapshots, which are useful for restoring + File system snapshots, which are useful for restoring deleted files or previous versions of files. @@ -1650,24 +1650,20 @@ cd0: Attempt to query device size failed restore - The traditional &unix; backup programs are - dump and restore. 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, - dump 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. - dump does not write files and directories, - but rather writes the raw data blocks that comprise files and - directories. When used to extract data, - restore stores temporary files in - /tmp/ by default. When using a recovery - disk with a small /tmp, set - TMPDIR to a directory with more free space in - order for the restore to succeed. + 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, + dump 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, dump + writes the raw data blocks that comprise files and + directories. - + If dump is used on the root directory, it will not back up /home, /usr or many other @@ -1675,39 +1671,34 @@ cd0: Attempt to query device size failed file systems or symbolic links into those file systems. + + When used to restore data, + restore stores temporary files in + /tmp/ by default. When using a recovery + disk with a small /tmp, set + TMPDIR to a directory with more free space in + order for the restore to succeed. - dump has quirks that remain from its + When using dump, 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. + 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. .rhosts - It is also possible to backup data across the network to a - tape drive attached to another computer with - rdump and rrestore. - 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 .rhosts on - the remote computer. The arguments to - rdump and rrestore must - be suitable to use on the remote computer. For example, to - rdump from a &os; computer to an Exabyte - tape drive connected to a host called - komodo, use: - - &prompt.root; /sbin/rdump 0dsbfu 54000 13000 126 komodo:/dev/nsa8 /dev/da0a 2>&1 - - There are security implications to allowing - .rhosts authentication, so use - with caution. - - It is also possible to use dump and - restore in a more secure fashion over - ssh. + 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. + + Instead, one can use dump and + restore in a more secure fashion over an + SSH connection. This example creates a + full, compressed backup of the /usr file + system and sends the backup file to the specified host over a + SSH connection. Using <command>dump</command> over @@ -1717,7 +1708,9 @@ cd0: Attempt to query device size failed 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 <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> + + <example> + <title>Backing Up the Current Directory With + <command>tar</command> + + &prompt.root; tar czvf /tmp/mybackup.tgz . + + + To restore the entire backup, cd 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. + + + Restoring Up the Current Directory With + <command>tar</command> - &prompt.root; tar cf - . | rsh komodo dd of=tape-device obs=20b + &prompt.root; tar xzvf /tmp/mybackup.tgz + - When backing up over an insecure network, instead use - ssh. + 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. backup software cpio - &man.cpio.1; is the original &unix; file interchange tape - program for magnetic media. cpio includes - options to perform byte-swapping, write a number of different - archive formats, and pipe the data to other programs. This - last feature makes cpio an excellent choice - for installation media. cpio does not know - how to walk the directory tree and a list of files must be - provided through stdin. - - - cpio - - - Since cpio does not support backups - across the network, use a pipeline and ssh - to send the data to a remote tape drive. - - &prompt.root; for f in directory_list; do -find $f >> backup.list -done -&prompt.root; cpio -v -o --format=newc < backup.list | ssh user@host "cat > backup_device" - - Where directory_list is the - list of directories to back up, - user@host - is the user/hostname combination that will be performing the - backups, and backup_device is where - the backups should be written to, such as - /dev/nsa0). + To create a backup using a specified list of files and + directories, &man.cpio.1; is a good choice. Unlike + tar, + cpio does not know + how to walk the directory tree and it must be provided the list of files + to backup. + + For example, a list of files can be created using + ls or find. This example + creates a recursive listing of the current directory which is + then piped to cpio in order to create an + output backup file named + /tmp/mybackup.cpio. + + + Using<command>ls</command> and <command>cpio</command> + to Make a Recursive Backup of the Current Directory + + &prompt.root; ls -R | cpio -ovF /tmp/mybackup.cpio + backup software @@ -1801,16 +1807,24 @@ cd0: Attempt to query device size failed POSIX IEEE - &man.pax.1; is the IEEE/&posix; answer to - tar and cpio. Over the - years the various versions of tar and - cpio have become slightly incompatible. So - rather than fight it out to fully standardize them, &posix; - created a new archive utility. pax + A backup utility which tries to bridge the features provided by + tar and cpio is &man.pax.1;. Over the + years, the various versions of tar and + cpio became slightly incompatible. &posix; + created pax which attempts to read and write many of the various cpio and tar formats, - plus new formats of its own. Its command set more resembles - cpio than tar. + plus new formats of its own. + + The pax equivalent to the previous + examples would be: + + + Backing Up the Current Directory With + <command>pax</command> + + &prompt.root; pax -wf /tmp/mybackup.pax . + @@ -1929,7 +1943,7 @@ cd0: Attempt to query device size failed Select the correct country, then choose Fixit -- Repair mode with CD-ROM/DVD/floppy or start a shell. then select - CD-ROM/DVD -- Use the live filesystem + CD-ROM/DVD -- Use the live file system CD-ROM/DVD. restore and the other needed programs are located in /mnt2/rescue. @@ -3588,13 +3602,13 @@ Device 1K-blocks Used Av reports 0 bytes of dirty extents. - The next step is to create a filesystem on the + The next step is to create a file system on the /dev/hast/test GEOM provider and mount it. This must be done on the primary node, as /dev/hast/test appears only on the primary 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: &prompt.root; newfs -U /dev/hast/test