From 2f6459be06d6dee96107410099e6dff27b54635e Mon Sep 17 00:00:00 2001 From: "Justin C. Sherrill" Date: Tue, 1 Jun 2004 20:01:21 +0000 Subject: [PATCH] Corrected command snippets, text. Corrections-from: Matt Dillon --- en/books/usersguide/backups/chapter.sgml | 86 +++++++++++++++++++++++------ 1 files changed, 68 insertions(+), 18 deletions(-) diff --git a/en/books/usersguide/backups/chapter.sgml b/en/books/usersguide/backups/chapter.sgml index 1b5ad0e..ead61e2 100644 --- a/en/books/usersguide/backups/chapter.sgml +++ b/en/books/usersguide/backups/chapter.sgml @@ -1,5 +1,5 @@ @@ -25,17 +25,18 @@ $DragonFly: doc/en/books/usersguide/backups/chapter.sgml,v 1.1 2004/05/05 18:38: gzip 1 - (compresses faster) or - - bzip2 - 1 - (compresses smaller) to save on disk space or bandwidth used. + to save on disk space or bandwidth used. Save the resulting file somewhere other than on the disk that contains the original files. - This works for grouped, similar data like mail files, but will - not work on special files, or whole filesystems, or handle incremental - backups. For this, the tools + + cpdup + 1 + can be used to backup/mirror an entire directory + structure to a different disk. + + Special files, whole filesystems, and incremental + backups all require more specialized tools. For this, the tools dump 8 @@ -44,24 +45,73 @@ $DragonFly: doc/en/books/usersguide/backups/chapter.sgml,v 1.1 2004/05/05 18:38: restore 8 - will handle almost - any eventuality. dump() will copy a complete filesystem to the location - specified; restore() will replace that filesystem into a completely - clean partition. It is possible to completely reformat a hard drive that - has been backed up with dump(), and then use - restore() to bring that drive - back completely to its original state. + will handle almost any eventuality. dump() will copy a + complete filesystem to the location specified; restore() + will replace that filesystem into a clean partition. It is possible + to completely reformat a hard drive that has been backed up with + dump(), and then use restore() to + bring that drive back completely to its original state. + + dump() can dump a mounted disk to a single file: + + + &prompt.root; dump 0af filename mountpoint + + + restore() can then recreate that data from the dumpfile: + + + &prompt.root; restore rf filename + + + + When using the -r option, restore() rebuilds the filesystem + described by the dumpfile. Only restore files using -r in an empty directory or + clean mountpoint. Otherwise, any existing data could be overwritten. + + + The dumped data can be automatically placed in a compressed file, and restored + while decompressing. + + + &prompt.root; dump 0af - / | gzip > root.dump.gz + &prompt.root; gunzip root.dump.gz | restore rf - + + + It's also possible to selectively restore files from a dump: + + + &prompt.root; restore xf filename files_to_restore + + - Backups Media + Backup Media The "classical" method of data storage has always been tape drives. A number of SCSI and IDE tape drives are supported under DragonFly; no compatibility list exists at this point, though devices supported on FreeBSD-4 should work. Tape backup has several advantages: it is stable, relatively cheap, and can hold a large quantity of data. However, tape - media is accessed in linear fashion, and so it can take some time to + media is accessed in linear fashion, and so it can may take some time to retrieve data. + + Tape speed can be improved by using larger block sizes. The + 'b' option controls block size while using dump() or + restore. + + + &prompt.root; dump 0abf 64 /dev/tapedevice / + &prompt.root; restore rbf 64 /dev/tapedevice + + + dd can be used to reshape data passing to and from a + tape drive. + + + &prompt.root; tar czf - / | dd obs=64k of=/dev/tapedevice + &prompt.root; dd ibs=64k | tar xvzpf - + More recently, recordable optical media have become a viable option for backup media. The shelf life and price per megabyte of saved data is not -- 1.7.7.2