Changes between Version 1 and Version 2 of jupiter/backup


Ignore:
Timestamp:
04/27/06 21:38:23 (21 years ago)
Author:
Daniel Kahn gillmor
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • jupiter/backup

    v1 v2  
    44
    55== preparing the removable media ==
     6
     7You should only need to prepare the removable media once.  DO NOT repeat this step on existing backup drives unless you want to destroy the backed-up data!
    68
    79in inserted an external iomega USB disk, and it showed up as `/dev/sdd`.  I prepared it (as root) with the following:
    … …  
    1315MAXEXTENTS=$(vgdisplay vgbackup0_jupiter | grep '^  Total PE' | awk '{print $3}')
    1416lvcreate --name backup0 --size $MAXEXTENTS vgbackup0_jupiter
     17 mkfs -t ext3 /dev/vgbackup0_jupiter/backup0
    1518}}}
    1619
    … …  
    1922since we should be rotating media, i expect that each volume group/logical volume will have an incrementing integer ID.  e.g., the next one should be `vgbackup1_jupiter/backup1`
    2023
     24== snapshotting the filesystem to back up ==
     25
     26we already have the `dm_snapshot` kernel module loaded.  So now we can snapshot the volume that the target filesystem resides on:
     27
     28{{{
     29## remember the date because it will be useful:
     30TODAY=$(date +%Y%m%d)
     31lvcreate --snapshot --size 100GB  --name calhome.$TODAY /dev/vghome_jupiter/calhome
     32}}}
     33
     34Note that if more than 100GB changes on `/dev/vghome_jupiter/calhome` while we have this snapshot in place, the original filesystem will choke!  So we shouldn't keep this around for much longer than it takes to run a backup, probably (though it would be nice to save it as a `.yesterday` directory and make it accessible for the users or something...  i'm not sure how to do that properly without risking breakage.  Also, i'm not sure how you'd be able to properly unmount it across machines.
     35
     36Next we mount the snapshotted volume:
     37
     38{{{
     39mkdir -p /var/local/backups/calhome.$TODAY
     40mount -o ro /dev/vghome_jupiter/calhome.$TODAY /var/local/backups/calhome.$TODAY
     41}}}
     42
     43== running the backup ==
     44
     45now that we have a snapshot, we can mount the removable LVM volume:
     46
     47{{{
     48mkdir -p /var/local/backups/calhome-target.$TODAY
     49mount /dev/vgbackup0_jupiter/backup0 /var/local/backups/calhome-target.$TODAY
     50mkdir -p /var/local/backups/calhome-target.$TODAY/srv/calfs/home
     51}}}
     52
     53and then run the actual backup:
     54
     55{{{
     56rsync -a /var/local/backups/calhome.$TODAY/ /var/local/backups/calhome-target.$TODAY/srv/calfs/home/
     57}}}