The purpose of this project is to practice creating a complete backup policy using a real scenario. You will also explore several commonly used tools used to perform backups.
You may work in small groups on this project, as long as the names of all groups members are included. Note each group member must submit an identical copy of the project.
Design a backup policy / strategy for
You need to take into account available backup hardware, however you
can recommend new hardware if you feel it is worth-while.
(In that case exact model name and number and prices, obtained from
the Internet, are required.)
You can contact HCC's
for any information you may need.
HCC's backup policies.)
Any information you get must be credited, that is you must say
who told you what, and when.
In addition, you can use your YborStudent account to run various
commands to examine the system,
See Backups and Archives for background information. Your backup policy must be very specific and detailed, and include the following information:
dump, or some specific commercial software) will be used?
For this part you will backup
/home on your assigned classroom computer,
after you have completed your post-install setup
You will use a variety of tools and techniques for this
including using LVM
(For more information please see
the LVM Guide.)
Since we lack backup hardware you should keep the backup archives in
Note you can always send the backup files as email attachments to
yourselfand then burn them to a CD.
(If your classroom computer includes a CD burner you can use
Perform the following steps and answer the following questions:
/tmphas enough free space to hold the backups! For now,
/tmpis part of your root partition and it would be a very bad thing to run that out of space. To estimate the size of the backups, calculate the size of
/etcdirectories. What command(s) did you use for this? What are the sizes? Note that compressed archives will take about 30% less space. However you will need to store one complete backup of
/homeand two backups of
/etc. What is the estimate of the total space required for your backups?
) ran out of space? It pays to create a separate partition or volume for
/tmp. If you had sufficient RAM you could use
tmpfs, a RAM disk designed for
/tmp. Since we don't have that option we will create a new LVM volume formatted with
/tmp. Note you will need to make the new partition a bit larger than just the size needed for backups, as other files are stored in there (and the filesystem itself uses an overhead of around 10%).
/tmpvolume, but also for a backup snap-shot volume, about 20% of the size of the
/homevolume. How much free disk space do you need altogether?
resize2fscommand. Next you can shrink the logical volume with
Here is a sample of reducing
/dev/VolGroup00/LogVol02) by 1 gigabyte:
df -h # show used and available space lvdisplay | less # show lv sizes vgdisplay # show vg free space umount /dev/VolGroup00/LogVol02 # volume for /home fsck -f /dev/VolGroup00/LogVol02 # required before resizing resize2fs -p /dev/VolGroup00/LogVol02 -1G # shrink filesystem by 1G lvreduce -L -1G /dev/VolGroup00/LogVol02 # shrink logical volumn by 1G mount /home vgdisplay # Note available space
What are the exact commands you used for this?
/tmpvolume, create a new logical volume and then format it as
ext4. Here is an example of creating a 1 gigabyte volume for
/tmp, using the name
vgdisplay # Note available space lvcreate -n LogVol04 -L 1G VolGroup00 mkfs -t ext4 /dev/VolGroup00/LogVol04 vi /etc/fstab # add entry for /tmp # Move old /tmp contents to new /tmp partition. This will # likely require a reboot before the new /tmp files get used. mv /tmp /oldtmp mkdir /tmp chmod 1777 /tmp mount /tmp cd /oldtmp cp -a $(/bin/ls -A) /tmp # Do this after the next reboot: rm -ri /oldtmp
findcommand which will find the names of all files and directories in
/etcthat have been modified in the past 24 hours? Make sure the list of names is depth-first (that is, the contents of a directory before the directory itself). What is the purpose of the
findoption, and why should you use it in a
production-qualityscript? What are the matching options for
cpio, to make an archive of the files found by
dump. Use a
level 0dump. Since we don't want to shut the system down to single user mode (or unmount
/home), we will make an LVM snapshot volume of
/homeand then use
dumpon that. The snap-shot volume typically needs about 15%–20% of the original filesystem's size. How large will you make the
Here is an example of creating, using, then removing an
LVM snap-shot of
/home (in this example
lvcreate --size 100m --snapshot --name home-snap /dev/VolGroup00/LogVol01 mkdir /mnt/home-snap mount -t auto -o ro /dev/VolGroup00/home-snap /mnt/home-snap dump ... /mnt/home-snap # read the man page for options to use umount /dev/VolGroup00/home-snap lvremove -v /dev/VolGroup00/home-snap rmdir /mnt/home-snap
What are the exact commands you used?
/etcusing a compressed
tararchive. What is the exact command(s) you used for this?
cpioarchive. Now compress the resulting archive using either
bzip2, whichever method you used for the
tararchive in the previous step. What are the exact commands you used for this step?
/etc? Do you think the difference is significant?
MD5checksum and store it in a file
tararchive backup of
/etcalong with the matching
MD5checksum file, to your home directory on the
scpcommand. What is the exact command(s) you used? Before running this command, check your quota on YborStudent and make sure you won't go over your hard limit!
cpioarchive backup of
/etc, along with the matching
MD5checksum file, to your home directory on the
rsynccommand. What is the exact command(s) you used? (Note by default a modern
rsyncuses a secure SSH tunnel, the same as
scp.) Before running this command, check your quota on YborStudent and make sure you won't go over your hard limit!
rsync -HavRuzc /var/www/html/ example.com:/var/www/html/
YborStudentand verify the integrity of the backup copies, using the
MD5checksum files. What are the exact commands to do that, and what are the results?
YborStudent, extract the file
to your home directory from the
tararchive. Then extract the file
to your home directory from the
cpioarchive. What are the exact commands needed for this? Be careful not to try to extract the absolute pathname or you will attempt to over-write
/etc/group. (Don't worry, you don't have permission to do that!)
pax backup utility is a POSIX
standard tool available on all Unix/Linux platforms.
(Although more popular,
rsync are not standard tools.)
This tool is based on
and can read and write a variety of archive formats.
POSIX has in recent years defined new formats
which in theory can backup ACLs
and extended attributes or
such as used for SELinux.
format is technically known as the
Standard Data Interchange format.
The successor to
ustar is the
POSIX-1003.1-2001 Standard Data Interchange format, commonly
star archive tool created by
is a nonstandard but widely used tool similar to
but able to handle a wider range of archive types than even the
Taking advantage of the extensible nature of the
format Jörg has defined
star tool can read/write and which does
star is currently (2010) the only archiving tool
for Fedora which does this.
However it won't use this format by default!
You must use the correct option(s) to force
For this optional part of the assignment you should make a full
archive of your home directory using
star and then
To make this interesting, add some ACLs and some
extended attributes to some files first.
After the archive is made, delete those files.
Finally attempt to restore the files from the archive, including
all attributes (date/time, modes, ACLs, and
Also see if you can recover the
star by using the
What were the exact commands you used?
Were the restore attempts successful?
After reading the man pages (really!) try something similar to the commands used in this star and pax session typescript.
A good site to check for backup hardware is NewEgg.com.
Be careful not to exceed your disk quota while doing this
If necessary use the
man (and / or
pages to see how to exclude some directories from the archives when you
(This won't affect the learning benefit from this assignment, but of
course in real life you do need to backup everything.)
/etc/gconf/ and a few other directories in
/etc can be quite large.
You can use
tail depending on your
sort options) to find the largest few directories
If necessary copy the
tar archive first, then delete it
before copying over the
A fancy shell script to backup
/etc can be found
Try it using the
ACLs and EAs only work for some filesystem
ext* types) and then only if the
mount options are used.
Look at the
mount options for
on YborStudent to see an example.
A copy of your YborStudent backup policy, and a copy of your journal pages showing the steps you have taken and the answers to the questions for this assignment. Don't turn in your whole journal, you will need to add to it every day in class! It is common in fact to keep the journal as a text file on the system (with a paper backup of course). You can send as email to (preferred). Please see your syllabus for more information about submitting projects.