Ever wished you had kept a copy of some important data or carefully copied those vacation pictures over to some safe place but only realized that things are too late and the damage is done! Accidental deletes, folder overrides, malfunctioned hard drives, fresh os install are few of several reasons where you end up with lost data and kept wondering how you would ever get it back. Losing data is horrifying. Only you know the true value of it and so its really up to you to keep it safe.
There are several data back up softwares like Deja Dup, which aim to sync some folder on your hard drive and do incremental backups of changes. This makes its easy to retrieve a singe file or bunch of folders when you need them.
But when it comes to backing up of your existing system installation or making an exact replica of your setup on another machine, Clonezilla proves helpful beyond imagination. I keep it handy in case anything goes wrong and I have to restore a previously working state of my OS. My recent debacle with Deepin proves its worthiness.
There are so many tutorials to using Clonezilla and trying to run by them a couple of times will make you a semi-pro at it. This article isn’t for the ‘how’ of clonezilla but for the ‘why’ of using it.
A fresh OS install pretty much robs you of all the additional software you ever installed to get by your daily computing needs. Any problem with the OS and you could see yourself starting from scratch. The best way to avoid this pitfall is to do a system backup as soon as your shiny new installation is ready for use. That would be the base milestone which you can restore back to. Much better than having a fresh install with no softwares of your use. Then as and when you keep adding new things to your setup you keep making new backup copies. A simple strategy of taking backups once a month or once every two months will let you fall back to the most recent working state. The frequency of backup is really a factor of how frequently you are making system changes/upgrades/adding new softwares to your system. Taking a backup just before trying out a new distro is also a good idea. Clonezilla allows to mount a folder on external HDD as the destination for backup. So all the images will be available on external disk for later restoration.
As and when you keep taking back ups you could let go of older copies. So keeping last three backups makes sense. Anything older isn’t the right candidate to restore.
Now for some hard facts about Clonezilla. It allows for backup of entire disk as well as parts. So if the installation has different mounted drives for root (/) /home etc, you could plan to make backups of respective parts as per your need. Ideally a separate /home is not really affected by system changes, installs etc so the data is intact anyway, but good to have a complete data back up once a while. For backups of files folders that you work on daily basis and do not want any data loss use of Deja Dup will be more helpful.
Clonezilla does not allow restoring of a backup to drive of a smaller size. This means you should be aware of the partition size, it’s used and free space available when making/restoring images. For e.g. say you have a 10GB partition of which 3GB is used. You take a back up of this, which is really just the 3GB worth of data/system files. But clonezilla will not allow you to restore this to a new partition of say 5GB. This is currently a limitation on how clonezilla works. It however allows restoration to partition sizes which are larger than original. So the same image will be easily restored to a new partition of say 15GB.
There is a work around for this. The commonly accepted solution on several forums for this is to use Gparted to resize the partition to be restored and do away with all of the unused space. Then create a backup image of the new resized partition, which is essentially only the data/files you want to back up. Now it is possible to restore is to any size partition which is greater than the actual backup size. To illustrate, resize the 10GB partition from above example to 3GB (or 3.2GB to keep some buffer) and backup the resized partition. The new image can now be safely cloned to disk sizes greater than 3.2GB. So cloning it onto 5GB is possible. And then use Gparted again to increase the size of the partition to include the free space back in to it.
Clonezilla provides two modes of operations. Beginner mode caters to most needs perfectly. Using Clonezilla in its advanced mode take some amount of practice and understanding of whats being done. I stick to its beginner mode for most of my needs, but it would help to explore and learn more about different options to effectively use this awesome software.
Hope I have discussed important details and insight into using Clonezilla. Few takeaways from this would be
- Use Clonezilla for contingencies. You should have a recent backup when it matters the most.
- Plan frequency of backups and stick to the schedule. Label them by OS name, hostname and date to make restoration easier and confusion free. Older backups aren’t of much use. Delete them to recover precious space.
- If restoration is planned on the same machine with same partition sizes, do not bother with resizing partitions everytime you take a backup.
- If restoring to new machine whose destination partition size is not known, it makes sense to take that extra step of resizing partition.
- Restoring image is just a matter of selecting the source backup and destination partition on drive. Rest is taken care by Clonezilla.
Its fast and easy, just needs some amount of practice.