Ubuntu – Make a carbon copy of Ubuntu 14.04 and reinstall it later

14.04backupclonezilla

My Ubuntu set-up is quite complex and it requires few hours of installing software, changing bash configuration and creating a lot of symlinks. Since I often experiment with my system, it tends to get broken and I need to spend few hours configuring everything again.

  1. Is it possible to make copy of existing, working installation of Ubuntu, with everything configured, and in case of system failure or other issue, redeploy it on the same HDD/SSD/partition?
  2. Is the above possible with another partition, of new size and possibly on another device/HDD/SSD?

I hear about Clonezilla, but I am not sure it does what I described and I am not sure how to test if copy it creates works well.

Best Answer

You could simply use dd to dump your partition into a file, like so:

sudo dd if=/dev/sda1 of=dump.img

Then you can easily restore it by running the following command from a live DVD / USB stick:

sudo dd if=dump.img of=/dev/sda1

Replace /dev/sda1 with your root partition. Obviously, you will need to place the dump file to another partition.


Another method would be to create a duplicate partition. Use any partitioning tool (e.g. GParted) to create a partition the same size as your original, then use dd to clone your partition:

sudo dd if=/dev/sda1 of=/dev/sda2

Do the inverse to restore, using a live DVD / USB stick.