Backing-Up To EC2 From ded
time required = f(instance and/or volume assigned by amazon)
- FUTURE CONSIDERATION: use nfs instead of ssh - would likely speed-up unison sync time...
- browse to http://console.aws.amazon.com/
- create a new volume of size 72GB from the existing snapshot; as of 2010.09.14, the volume
has 4.9GB of free space. The volume MUST be the same size as the previous back-up. If more space is needed:
- create the volume with more space and note the volume size in these instructions
- attach it as /dev/sdh to a running instance
- run resize2fs -f -p /dev/sdh # without -f you have to run e2fsck which takes waaaaay
too long; with it the resize takes 75 seconds; there's no need to specify the new size because the resize consumes
all space by default
- note the availability zone of the volume
- on the "AMIs" page, launch an new instance with these values:
- ami = ami-0d7d9a64 (custom rolled image)
- aki = aki-a71cf9ce (fc8, i386)
- ari = ari-a51cf9cc
- availability zone as noted above
- wait for the machine to come to life, which takes a little while, ~6 minutes without feedback
- copy the machine's public ip address info into ded:/etc/hosts, specifically including
ec2.anoxymous.com as an alias
- attach the storage volume to the instance by right-clicking on the instance
- make the volume device /dev/sdh
- ssh into the ec2 machine as root (fuck you) expecting the ssh warning
- mount /home (there's already an entry in /etc/fstab for it), which can take a while for some reason sometimes
- rm -rf .unison to nuke the previous attempt at making unison work with ec2
- ln -s /home .unison
- copy the machine's public ip address info into ec2:/etc/hosts, specifically including
ec2.anoxymous.com as an alias (/etc/hosts had to be created as of 2010.09.14)
- edit /etc/resolv.conf and change search to "search anoxymous.com"
- rsync heavy stuff from ded into ec2
- check out ded:/root/.unison/home for what's ignored and/or considered heavy
- /home/dave/journal is ignored, so it's heavy - rsync it
- as of 2009.09.14, /home/archive/home/zabigo needs to be ingored or pruned!
- nice unison (through vncviewer) on ded as root to take care of the rest
- the archive info on ec2 is stored in /home/ar79f3a5a9be151ab0920ff7773d9873fa
- ec2:/root/.unison is a symlink to /home, so ar79f3a5a9be151ab0920ff7773d9873fa is persisted; it's the key
to the operation because the info is stored in the storage volume, not the root filesystem, which is not
persisted from instance invocation to instance invocation.
- sync
- df -h # note the free space on /dev/sdh
- umount /home (at this point a snapshot of the volume can be created, even without the instance running)
- shutdown the instance, which automagically detaches the volume (and takes a little while)
- create a snapshot of the volume and add the free space as a description (it took ~22 minutes as of
2010.01.29, but took a LOT longer previously)
- delete the volume and old snapshot
- pay a paltry 0.10$ per GB per month for wickedly redundant back-up :)