JS Ext

Wednesday, May 7, 2014

Make a Backup Before Upgrading Ubuntu

I am a little obsessive about backing up my data.  I use ZFS with RAID-Z to prevent data loss due to silent data corruption.  Since ZFS can be problematic due to its licensing, I also have a USB hard disk that contains a copy of all my data.  In the event that my house gets destroyed, all my data is backed up to an EC2 micro instance.  My EC2 instance runs Owncloud with the data stored on a ZFS volume.  Since the EC2 instance is outside of my home, I try to keep it up to date.  During the last update, serious problems occurred.

After upgrading my EC2 instance to Ubuntu 14.04, my ZFS volume disappeared.  Since there was a kernel upgrade, I assumed the zfs module just needed to be recompiled.  Finding the instructions on how to do this was pretty painful, but that is a rant for another day.  The recompile of the zfs module failed, however.  The zfs module won't compile against the 3.12 version of the Linux kernel.  I would have to patch my kernel to get it to work.  I decided to try and roll back the kernel, but that just made things worse.

This is where I wished I took a backup.  Not a backup of my data.  A backup of the Ubuntu OS.  Now that 14.04 is out, I am having a hard time finding Ubuntu AMIs for older versions that work.  I fired up another EC2 instance using Gentoo.  Gentoo is the distro I use at home, and I know ZFS works well with it.  I used this instance to import the ZFS pool and copy the data to an ext4 volume.  I will create a new Ubuntu 14.04 instance that will use the ext4 volume for Owncloud.

This experience has showed that I did a few things right.  First, my data was on a different EBS volume.  I did backup the Mysql database, but not with enough frequency.  The software I installed was pretty minimal and minimally customized.  This makes it a lot easier to create a new instance and get running.

I definitely have a few things that I know I need to do in the future.  First, I need to take snapshots of the OS.  Second, I need to keep the configuration backed up as well.  That way, if I need to create a new instance, I can more easily recover.  Finally, I should back up the Mysql data to the data volume.

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.