1

I want to do a clean install of Ubuntu and then create an image that I can use to restore the system to a clean state after I've tested the installation and use of an app within Ubuntu.

But all I'm finding is cloning, which doesn't do what I want. I don't want to clone my drive. I want to be able to run a test and then restore from an image so that everything is exactly as it was before I started the test.

Basically this is what I need to do: Install Ubuntu 12.04. Create an image of 12.04 that I store somewhere else. Reformat the drive and install 14.04. Create an image of 14.04 that I store somewhere else.

Erase the hard disk and restore the 12.04 image. Install the application I'm testing to find issues. Erase the hard disk and restore the 12.04 image. Reinstall the application I'm testing to find issues during other install options. Erase the hard disk and restore the 12.04 image. Reinstall the application I'm testing to find issues that may arise from different application configurations. And repeat. And repeat. And repeat.

From what I'm reading, cloning is primarily for servers to allow you to have a copy of the disk you're using in the event of a failure. When it does fail, you switch to the clone to keep the server running while you're repairing the disk.

I want imaging because I need every starting state for each test to be identical to every other starting state so that I can figure out where problems are. If anything at all is different between the install of Ubuntu I start with during one test and the install of Ubuntu I start with during another, the test is invalid.

2 Answers 2

0

I've used RedoBackup, and it does just that. I have tested it with 14.04, and it works OK.

Using it, will restore everything back to the exact same condition prior to doing the image. And the beauty about it that you don't have to install it, you can either use a Live CD or USB.

0

You're vague about this "app" you want to test, so there could be several options.

One I can think of is for you to use a virtual machine to do your tests. Create a VM for 12.04 and another for 14.04. Install Ubuntu on those. Once finished, create a "snapshot" of each VM. Install your app and do your tests. When you need to "roll back" to the initial state, just restore the snapshot. This is very disk-efficient because snapshots only store the changes on top of the base image.

You can use VirtualBox for this (http://www.howtogeek.com/150258/how-to-save-time-by-using-snapshots-in-virtualbox/) or Qemu/KVM (http://wiki.qemu.org/Documentation/CreateSnapshot and http://kashyapc.com/2012/09/14/externaland-live-snapshots-with-libvirt/, the latter has some Fedora-specific commands but the main utility, virsh, is available in Ubuntu).

Another more lightweight technique is using an LXC container. It also allows creating a "base" image and "cloning" it using an incremental backingstore (-B overlayfs when running lxc-clone). Once the tests are finished the clone can just be deleted. Or you could use an ephemeral container, which is again a clone but it stores the changes in memory and self-destroys when stopped. See https://help.ubuntu.com/lts/serverguide/lxc.html#lxc-cloning and https://www.stgraber.org/2013/12/27/lxc-1-0-container-storage/. LXC containers are not entirely identical to a full-blown virtual machine, so they may or may not suit your purpose. I can't really tell without more information about your app.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .