Download presentation
Presentation is loading. Please wait.
Published byBritton Tate Modified over 9 years ago
1
Backups in Linux Ning Zhu Class presentation
2
Introduction The dump and restore commands are the most common way to create and restore from backups in Linux Some other programs also can be used to backup the files. Such as: tar, cpio and dd
3
Advantage of dump Backups can span multiple tapes Files of any type can be backed up and restored Permissions, ownerships, and modification times are preserved Files with holes are handled correctly Backups can be performed incrementally
4
Limitation of dump Every filesystem must be dumped individually Only filesystems on the local machine can be dumped
5
Features (dump) Support “incremental” backup. Backup level will be assigned to implement this. Don’t care about the length of the filenames.
6
flags to dump -u: causes dump to automatically update /etc/dumpdates when the dump completes. The date, dump level and filesystem name are recorded. -f: indicates where dump sends the output -B: tells dump what is the tape length can be used to dump the files. # dump -5u –B 800000 –f /dev/sto /work
7
Dump Schedule Simple schedule: Do level 0 dumps of every filesystem each day. Reuse a group of tapes, but every N days, keep the tape forever. Moderate schedule: assign a tape to each day of the week, each week of the month, and each month of the year. Every day, do a level 9 dump to the daily tape. Every week, do the level 5 dump. And every month, do a level 3 dump. Do a level 0 dump whenever the incrementals get too big to fit on one tape.
8
Restore the files using restore Restore individual files Restore entire filesystems
9
Restoring individual files Restore the file /users/rdeaton/lostfile from a remote tape drive for user Dr. Deaton: # mkdir /var/restore # cd /var/restore # rsh tapehost mt –f /dev/nst0 fsf 3 # rrestore –i –f tapehost:/dev/nst0 restore> ls restore> cd rdeaton restore> add lostfile restore> ls restore> extract
10
Restoring individual files (cont’) Give the file to rdeaton: # cd /var/restore # ls rdeaton # ls ~rdeaton # cp –p rdeaton/lostfile ~rdeaton/lostfile.restored # chown rdeaton ~rdeaton/lostfile.restored # rm –rf /var/restore # mail rdeaton Your file lostfile has been restored and has been placed in /users/rdeaton/lostfile.restored
11
Restoring entire filesystems Create and mount the target filesystem cd to the mount point of the new filesystem Put the most recent level 0 dump in the tape drive Type restore –r After the level 0 dump has been restored, mount and restore the incremental dumps.
12
Determine which dumps to restore 0 0 0 0 5 5 5 5 0 3 2 5 4 5 0 9 9 5 9 9 3 9 9 5 9 9 0 3 5 9 3 5 9
13
Restore expamle If the most recent dump was the first monthly after the annual level 0 in the “moderate” schedule, the commands to restore /home, residing on the physical device /dev/sda1 # /etc/mke2fs /dev/sda1 QUANTUM_PD1050S # /etc/mount /dev/sda1 /home # cd /home /* mount first tape of level 0 dump of /home */ # restore –r /* mount first tape of level 3 monthly dump */ # restore –r
14
Other Archiving Programs tar tar: package files tar reads multiple files or directories and packages them into one file, often a tape file. tar is useful way to back up any files whose near-term recovery you anticipate.
15
Other Archiving Programs cpio cpio: archiving utility from ancient times cpio is similar to tar in functionality. It’s rarely used today. Like tar, cpio can be used to move directory trees.
16
Other Archiving Programs dd dd: twiddle bits dd is a file copying and conversion program. dd just copies from its input file to its output file. If a user brings you a tape that was written on some non-Linux system, dd may be the only way to read it. dd was to create a copy of an entire system. However, restore and dump is a better option these days.
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.