cmsc 691x, summer 1999 honglin su, csee umbc1 chapter 11, backups honglin su csee, umbc...

Post on 01-Apr-2015

214 Views

Category:

Documents

1 Downloads

Preview:

Click to see full reader

TRANSCRIPT

CMSC 691X, Summer 1999

Honglin Su, CSEE UMBC 1

Chapter 11, Backups

Honglin Su

CSEE, UMBC

hosu@cs.umbc.edu

CMSC 691X, Summer 1999

Honglin Su, CSEE UMBC 2

Agenda

• Introduction• Backup Devices and Media• Incremental Backup• Backup Rules• Restoring from Dumps• Dumping and Restoring from Upgrades• Other Archiving Programs• Summary

CMSC 691X, Summer 1999

Honglin Su, CSEE UMBC 3

Introduction

• Information stored on computers is worth more than the computers themselves– Consider your accounts stored in Banks

• Hundreds of ways to lose data.– Accidental file removal, External/Internal failures

• Backup - The most efficient and convenient way to protect your data

• Backup must be done carefully and on a strict schedule

CMSC 691X, Summer 1999

Honglin Su, CSEE UMBC 4

Backup Devices and MediaMedium Capacity Cost Cost/MB Type Reuse Random

FloppyDisk

2.8 MB $0.5 17.60 c M Yes Yes

QIC 150 MB $20 13.30 c M Yes No

Nine-track

160 MB $10 6.25 c M Yes No

Floptical 200 MB $15 7.50 c M/O Yes Yes

WCD-ROM

600MB $10 1.67 c B/O No Yes

Exabyte(8mm)

5 GB+ $9 <0.18 c M Yes No

DAT(4mm)

5 GB+ $7 <0.14 c M Yes No

CMSC 691X, Summer 1999

Honglin Su, CSEE UMBC 5

Backup Devices and Media

• Most media use magnetic particles to store their data, these media are subject to damage by electrical and magnetic fields.

• New Trends– Larger capacity devices, such as Tape libraries, using

robot; others, e.g. Jukeboxes and Stackers

– Higher speed: 12 MB/s

CMSC 691X, Summer 1999

Honglin Su, CSEE UMBC 6

Incremental Backup

• dump: builds a list of files that have been modified since a previous dump, then packs those files into a single large file to archive to an external device.– Backups can span multiple tapes

– Files of any type (even devices) can be backed up and restored

– Permission, ownerships, and modify times can be restored

– Files with holes are handled correctly

– Backups can be performed incrementally

CMSC 691X, Summer 1999

Honglin Su, CSEE UMBC 7

Incremental Backup

• Limitation of dump: – Every filesystem must be dumped individually

• If you have a disk that is partitioned , you must dump each section of the disk separately

– The other limitation is that only filesystems on the local machine can be dumped

• You can not dump an NFS filesystem, however, rdump can dump a local filesystem to a remote tape drive

CMSC 691X, Summer 1999

Honglin Su, CSEE UMBC 8

Incremental Backup

Maintenance Commands ufsdump(1M) NAME ufsdump - incremental file system dump SYNOPSIS /usr/sbin/ufsdump [options] [arguments] files_to_dump DESCRIPTION ufsdump backs up all files specified by files_to_dump (nor- mally either a whole file system or files within a file sys- tem changed after a certain date) to magnetic tape, diskette, or disk file. When running ufsdump, the file sys- tem must be inactive; otherwise, the output of ufsdump may be inconsistent and restoring files correctly may be impos- sible. A file system is inactive when it is unmouned or the system is in single user mode. A file system is not con- sidered inactive if one tree of the file system is quiescent while another tree has files or directories being modified.

Solaris LinuxDUMP(8) UNIX System Manager's Manual DUMP(8) NAME dump - filesystem backup SYNOPSIS dump [0123456789BbhfusTdWn [argument ...]] filesystem dump [0123456789BbhfusTdWn [argument ...]] directory DESCRIPTION Dump examines files on a filesystem and determines which files need to be backed up. These files are copied to the given disk, tape or other stor- age medium for safe keeping (see the f option below for doing remote backups). A dump that is larger than the output medium is broken into multiple volumes. On most media the size is determined by writing until an end-of-media indication is returned. On media that cannot reliably return an end-of-media indication (such as some cartridge tape drives) each volume is of a fixed size; the actual size is determined by the tape size and density and/or block count options below. By default, the same output file name is used for each volume after prompting the operator to change media.

CMSC 691X, Summer 1999

Honglin Su, CSEE UMBC 9

Incremental Backup

• Backup level 0 ~ 9– A level zero backup places the entire filesystem on the

tape

– A level N dump backs up all files that have changed since the last dump level less than N.

– To restore files from several sets of backup tapes to reset a filesystem to its exact state during the last backup.

• dump does not care about the length of filename.

CMSC 691X, Summer 1999

Honglin Su, CSEE UMBC 10

Incremental Backup

• Dump sequences and schedule– The schedule that is right for you depends on

• The activity of your filesystems

• The capacity of your dump device

• The amount of redundance you want

• The number of tapes you want to buy

CMSC 691X, Summer 1999

Honglin Su, CSEE UMBC 11

Backup Rules

• Perform all dumps from one machine– using rdump, there is a performance penalty, while the

ease of administration makes it worthwhile.

• Label your tapes: exalabel• Pick a reasonable backup interval

– The more often backups are done, the smaller the amount of data that can be lost in a crash

• Choose filesystems carefully

CMSC 691X, Summer 1999

Honglin Su, CSEE UMBC 12

Backup Rules

• Make daily dumps fit on one tape• Make filesystems samller than your dump device• Keep tapes off-site• Limit Activity during dumps• Check your tapes

– Verify that the tape contains the expected files

• Prepare for the worst

CMSC 691X, Summer 1999

Honglin Su, CSEE UMBC 13

Restoring from Dumps

• Restoring individual files– restore x filename

– use rrestore to extract files from rdump.

– If multiple files on a single tape, use mt to position the tape at the correct dump file before running restore

• Interactive restore– If your version of restore supports the i option.

• Restore entire filesystems– restore r

CMSC 691X, Summer 1999

Honglin Su, CSEE UMBC 14

Dumping and Restoring for Upgrades

• When you perform an OS upgrade, all filesystems must be backed up with a level zero dump.

• Be sure to back up and restore any system-specific files that are in / or /usr, such as /etc/passwd, /usr/local, etc.

• Your should do a complete set of level zero dumps immediately after an upgrade.

CMSC 691X, Summer 1999

Honglin Su, CSEE UMBC 15

Other Archiving Programs

• tar: Package Files• cpio: ATT-ish Archiving, copy file archives in and

out, similar to tar• dd: Twiddle Bits

– % dd if=/dev/rmt0 of=/dev/rmt1 cbs=16b

• volcopy: Duplicate Filesystems

CMSC 691X, Summer 1999

Honglin Su, CSEE UMBC 16

Other Archiving Programs

• tarUser Commands tar(1) NAME tar - create tape archives and add or extract files SYNOPSIS tar c [bBefFhiklnopPqvwX [ 0-7 ]] [ block ] [ tarfile ] [ exclude-file ] { -I include-file | -C directory file | file } ... tar r [ bBefFhiklnqvw [ 0-7 ]] [ block ] { -I include-file | -C directory file | file } ... tar t [ BefFhiklnqvX [ 0-7 ]] [ tarfile ] [ exclude-file ] { -I include-file | file } ... tar u [ bBefFhiklnqvw [ 0-7 ]] [ block ] [ tarfile ] file ... tar x [ BefFhiklmnopqvwX [ 0-7 ]] [ tarfile ] [ exclude-file ] [ file ... ]

actaeon.cs.umbc.edu[130] tar cvf tmp.tar tmpa tmp/ 0Ka tmp/yt.hm 12Ka tmp/review1.txt 2Ka tmp/email 2Ka tmp/Map.ppt 31Ka tmp/bob.c 1Kactaeon.cs.umbc.edu[132] tar xvf tmp.tarx tmp, 0 bytes, 0 tape blocksx tmp/yt.hm, 11360 bytes, 23 tape blocksx tmp/review1.txt, 1163 bytes, 3 tape blocksx tmp/email, 1201 bytes, 3 tape blocksx tmp/Map.ppt, 31232 bytes, 61 tape blocksx tmp/bob.c, 61 bytes, 1 tape blocks

CMSC 691X, Summer 1999

Honglin Su, CSEE UMBC 17

Using multiple files on a single tape

• mt command– rew - rewind the tape to the beginning

– offl - put the tape off-line

– status - show the status of the tape drive

– fsf [count] - fast-forwards the tape

– bsf [count] - backspace count files

actaeon.cs.umbc.edu[137] mtusage: mt [ -f device ] command [ count ]

CMSC 691X, Summer 1999

Honglin Su, CSEE UMBC 18

Summary

• Related chapters– Chapter 4, The filesystem

– Chapter 7, Devices and drivers

– Chapter 9, Adding a disk

– Chapter 10, Periodic Processes

– Chapter 17, NFS

• For more information– http://www.admin.com/

– http://wwwhost.cc.utexas.edu/cc/services/unix/index.html

• Q & A

• Thank you!

top related