A sysadmin blog about Linux and cloud IaaS

What’s this about?
Data security and backups are very important aspects when you work with servers, especially if you are using cloud infrastructure. I am using AWS(Amazon Web Services) as my preferred IaaS, so the following how-to is tailored for Amazon EC2 instances using EBS as storage for the web sites files. On my instance I have Ubuntu 10.04 LTS installed and on top of it I run ISPConfig 3.0.4(latest version at the moment I write this article). Some of the programs required to run this setup were already installed, but it should be pretty obvious if you miss anything. If you need help you can either leave a comment or contact me via email.

The following setup will allow you to create an EBS using EXT4 as file system, with quota enabled on it(for ISPConfig) and weekly backups of the EBS. In case of instance failure you should be able to launch a new instance and attach the EBS, without losing any web sites files. In case of EBS failure you can recreate one from the most recent snapshot.

Create an EBS in the same zone as your instance and attach it to your instance as /dev/sdf. This can be easily done from AWS Management Console.

This should be all, you now have all your web sites on EBS, quota is enabled and weekly backups enabled. I think I pretty much nailed everything you need in order to perform this setup, but if there are any issues feel free to leave a comment. Also I love getting feedback so if you found this article useful leave a comment also 🙂

As explained when creating a new EBS:
Linux Devices: /dev/sdf through /dev/sdp
Note: Newer linux kernels may rename your devices to /dev/xvdf through /dev/xvdp internally, even when the device name entered here (and shown in the details) is /dev/sdf through /dev/sdp.

I’m using an EBS mounted as /mnt/data (/dev/xvdf /mnt/data/ ext4 defaults 0 0) and /var/www is symbolically linked to /mnt/data/www.
I do this because I am also symbolic linking a couple of files of /etc to /mtn/data/etc.
Do you think it’s bad practice?

I think another EBS just for /etc would be too much and with linking them onto my special /mnt/data I keep my configurations in one place.

Your tutorial is great and I’m gonna try out Snapshots which I wanted to do for a long time.
I am currently using duplicity to back up on S3 (full backup every 7d, incremental every night).
Any thoughts on that?

I don’t see any problem having multiple symbolic links pointing to the EBS.

Regading the issue of an EBS for /etc only I think that’s redundant, because the instance type I’ve used is EBS, thus is storing everything (including /etc) to an EBS. /dev/sda is an EBS and in the event of a crash you can detach that volume and reattach to another instance to recover data from it.