Backing-Up To EC2 From ded

time required = f(instance and/or volume assigned by amazon)
  1. FUTURE CONSIDERATION: use nfs instead of ssh - would likely speed-up unison sync time...
  2. browse to http://console.aws.amazon.com/
  3. 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
  4. note the availability zone of the volume
  5. 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
  6. wait for the machine to come to life, which takes a little while, ~6 minutes without feedback
  7. copy the machine's public ip address info into ded:/etc/hosts, specifically including ec2.anoxymous.com as an alias
  8. attach the storage volume to the instance by right-clicking on the instance
    • make the volume device /dev/sdh
  9. ssh into the ec2 machine as root (fuck you) expecting the ssh warning
  10. mount /home (there's already an entry in /etc/fstab for it), which can take a while for some reason sometimes
  11. rm -rf .unison to nuke the previous attempt at making unison work with ec2
  12. ln -s /home .unison
  13. 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)
  14. edit /etc/resolv.conf and change search to "search anoxymous.com"
  15. 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!
  16. 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.
  17. sync
  18. df -h # note the free space on /dev/sdh
  19. umount /home (at this point a snapshot of the volume can be created, even without the instance running)
  20. shutdown the instance, which automagically detaches the volume (and takes a little while)
  21. 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)
  22. delete the volume and old snapshot
  23. pay a paltry 0.10$ per GB per month for wickedly redundant back-up :)