Lab Exercises for Backups
Note: before doing any of these exercises you will need make
sure the tape drive is properly connected to the system you are using.
Note for SGI users: Because of the tape drive we are using,
you will have to use an additional argument to the tar command
to specify the blocking factor to be used. You will want to add the
option b 20 to your tar commands, for example:
# tar cb 20 /file
Exercise 1
- Using the tar command, create a tape archive containing the
following files:
- /etc/passwd
- /stuff
- /usr/share/lib/terminfo
If you are using the Linux box this will be /usr/lib/terminfo.
- Once the backup is complete, write out a table of contents.
- Use dd to place the entire archive in /tmp.
- Check the contents of the stuff file.
- Remove the archive from /tmp.
- Using tar, restore the /stuff file from tape.
Exercise 2
- Using a non-rewinding tape device, recreate the archive of /stuff,
/etc/passwd, and /usr/share/lib/terminfo.
- Using cpio and find create a backup of
/etc/resolv.conf. Place this archive at the end of the previous
tar archive you created on the tape.
- cd into /etc and rename the resolv.conf file
old.resolv.conf.
- Restore /etc/resolv.conf from the tape.
Note: because there are two archives on the tape, it must be in the
proper position before you issue the commands to restore the file.
- Do an nslookup on usenet.ucs.indiana.edu to see if the
resolv.conf was restored properly.
- If the file was properly restored, remove old.resolv.conf.