<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
        <META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=windows-1252">
        <TITLE></TITLE>
        <META NAME="GENERATOR" CONTENT="OpenOffice.org 2.0  (Win32)">
        <META NAME="CREATED" CONTENT="20070703;9512689">
        <META NAME="CHANGED" CONTENT="20070703;9520891">
        <STYLE>
        <!--
                P.text-body-indent-western { margin-left: 0.9in; font-family: "Courier New", monospace }
                P.text-body-indent-cjk { margin-left: 0.9in }
                P.text-body-indent-ctl { margin-left: 0.9in }
                H2 { color: #000000 }
                H2.western { font-family: "Albany", sans-serif; font-size: 15pt; font-style: italic }
                H2.cjk { font-family: "HG Mincho Light J"; font-size: 14pt; font-style: italic; font-weight: medium }
                H2.ctl { font-family: "Arial Unicode MS"; font-size: 14pt; font-style: italic }
        -->
        </STYLE>
</HEAD>
<BODY LANG="en-US" DIR="LTR">
<H1 STYLE="page-break-before: always">1Backups</H1>
<H2 CLASS="western"> 1.1 Create backup structure</H2>
<P>As described in the backup script (<CODE>/root/backup-slash-fs</CODE>),
the backup scheme is composed of seven steps:</P>
<OL>
        <LI><P>Create a FS snapshot using LVM</P>
        <LI><P>Mount the snapshot FS</P>
        <LI><P>Mount our backup file in a loop filesystem (we can guarantee
        the space will be present this way, and it allows selective recovery
        of files if need be)</P>
        <LI><P>rsync the differences between the snapshot FS and the backup
        FS</P>
        <LI><P>Unmount the backup FS</P>
        <LI><P>Unmount the snapshot FS</P>
        <LI><P>Delete the snapshot LVM (leaving it will degrade performance)</P>
</OL>
<P>For this script to function, though, the initial backup structure
must be made. The large portion that needs to be done manually is
creating the backup file, but in order to do so, most of the steps
outlined above will be performed.</P>
<P>First, create our backup file by touching
<CODE>/mnt/smb/userdata/root/FC6-Backup-File</CODE>, and also create
a the backup mount points at <CODE>/mnt/FC6-Snapshot</CODE> and
<CODE>/mnt/FC6-Backup</CODE>.  Next, start the backup process:</P>
<P CLASS="text-body-indent-western"># Create the file system
snapshot<BR>lvcreate -s -L40G -n FC6Backup /dev/System/fc6</P>
<P>This is where the manual steps come in.  Instead of mounting the
file systems and using rsync between them, we want to copy the
initial system, and conveniently we'll develop a file system large
enough within the backup file simultaneously using <STRONG>dd</STRONG>.</P>
<P CLASS="text-body-indent-western">dd if=/dev/System/FC6Backup
of=/mnt/smb/userdata/root/FC6-Backup-File bs=64k</P>
<P>Wait for the copy to complete (it'll be a while). When that is
done, confirm the file backed up the root file system, and then
delete the snapshot file system.</P>
<P CLASS="text-body-indent-western">mount -o loop
/mnt/smb/userdata/root/FC6-Backup-File /mnt/FC6-Backup<BR>ls
/mnt/FC6-Backup<BR>  ... # ls output<BR>umount
/mnt/FC6-Backup<BR>lvremove -f /dev/System/FC6Backup</P>
<H2 CLASS="western"> 1.2 Automatic Backups</H2>
<P>Enabling automatic backups is as easy as adding an entry in a cron
tab or placing a link in one of the special cron directories.  We
want to backup nightly, so we'll add a link to <CODE>/root/backup-slash-fs</CODE>:</P>
<P CLASS="text-body-indent-western">ls -s /root/backup-slash-fs
/etc/cron.daily/backup-slash-fs</P>
</BODY>
</HTML>