How to Use Clonezilla Live to Back Up Your Hard Drive
This tutorial is going to show you how to use Clonezilla Live to back up your hard drive. Clonezilla is a free open-source and reliable tool for bare metal backup and recovery of disk drives.
Clonezilla Features
- You can create an image of the current disk or partition (disk imaging), and restore the image to disk at any time.
- Allows you to clone directly between two disks (disk cloning), without creating a disk image.
- The disk image can be encrypted with ecryptfs, and saved to or read from local disk, SSH server, Samba server, NFS server, WebDAV server or AWS S3 storage.
- The disk image can be compressed with GZIP or ZSTD algorithm.
- Supports lots of file systems like ext4, XFS, Btrfs, F2FS, FAT32, NTFS, HFS+, UFS.
- Supports MBR and GPT partition table.
- Supports BIOS and UEFI firmware.
- Clonezilla Server Edition allows you to do massive system deployment over the network.
- Unattended mode: Almost all steps can be done via commands and options.
What You Need
- A thumb drive to create a Clonezilla live USB
- A hard drive that you want to make a backup of
Clonezilla is included in the repository of many Linux distributions, such as Debian, Ubuntu, Arch Linux, so why do we need to create a Clonezilla live USB? Can’t we just install Clonezilla on the operating system? This is because Clonezilla currently doesn’t support online imaging/cloning. The partition to be imaged or cloned has to be unmounted.
If you have a Debian, Ubuntu, or Arch Linux live USB, you can install Clonezilla on your current live USB, then launch Clonezilla from the live USB (sudo clonezilla
). But for the purpose of this tutorial, I will show you how to create and use Clonezilla live USB.
Note: I use a hard drive in this tutorial, but you can use any storage media (HDD, SSD, SD card, etc).
Step 1: Download Clonezilla Live ISO Image
There are three types of Clonezilla:
- Clonezilla live: for single disk imaging and cloning.
- Clonezilla lite server: for massive deployment.
- Clonezilla SE (server edition): for massive deployment. A DRBL server is required.
If you just want to back up a single disk, choose Clonezilla live. Go to the Clonezilla live download page. There are two stable versions of Clonezilla live:
- stable: based on Debian with no proprietary software. It may not work with the latest hardware.
- alternative stable: based on Ubuntu with proprietary software for better hardware support.
I personally use the alternative stable version.
Then select the CPU architecture, file type and repository. You should choose ISO as the file type. If you use the ZIP file type, you might see the “missing partition table” error when creating Clonezilla live USB.
Step 2: Create a Clonezilla live USB
Note: If there are files in your thumb drive, I recommend backing up your files before creating the live USB.
Linux
If you use Linux on your computer, then you can use the dd
command to create Clonezilla live USB. First, insert your thumb drive to your computer. Then open up a terminal window and run the following command to get the device name of your thumb drive.
parted -l
As you can see, the device name of my thumb drive is /dev/sdb
. Next, run the following command to create Clonezilla live USB.
sudo dd if=/path/to/clonezilla-iso-file of=/dev/sdX status=progress
To make sure every bit of information is written to your thumb drive, run the sync
command.
sync
Now you can boot your computer from the USB thumb drive.
Windows
If you use Windows on your computer, then you can use the Etcher tool to create Clonezilla live USB. It’s very simple to use. Install the software on your computer, then launch Etcher. It automatically selects your USB thumb drive. Select the Clonezilla ISO file and click Flash button.
Then wait for it to finish flashing your thumb drive.
Once it’s done, boot your computer from the USB thumb drive.
Step 3: How to Use Clonezilla Live to Back Up Your Hard Drive
Once your computer is booted up from the USB thumb drive, you will be greeted by the Clonezilla Live boot menu. Choose the first item to boot Clonezilla live.
Once it starts, you have the option to choose a language.
And you can change the keyboard layout. (I use the default US keyboard.)
Then, it asks you if you want to use the Clonezilla wizard (which is easy for beginners) or use the command-line interface. Choose the first option to start the Clonezilla wizard.
Next, select a mode. This tutorial selects the first mode.
- device-image: create an image of the current disk or partition
- device-device: clone directly between two disks, without creating a disk image.
After that, choose where the Cloned image will be saved. You have many options: local device, SSH server, Samba server, etc. This tutorial selects a local device. If you choose one of the other options, please follow the instructions to set up the network connection.
If you choose local device and want to store the image on an external USB hard drive, then insert the USB hard drive to your computer now and press Enter.
Then Clonezilla will scan your storage devices. As you can see, it detected my 31 GB USB thumb drive. Press Ctrl+C
to exit the scanning window.
On the next screen, choose your USB drive.
Then you can choose if you want to check and repair the file system on your USB drive. I choose no-fsck because my USB drive is totally fine.
Next, choose a directory to store the Clonezilla image. By default, it’s stored on the root directory of the storage device. Press Tab
key and choose Done
.
Then, it will show you how much free space your storage medium has. Press Enter
to continue.
Next, choose between beginner and expert mode. If you are a Clonezilla beginner, then choose the beginner mode.
In the next screen, you can choose to save an entire disk as an image or save a specific partition as an image. This tutorial chooses the first one (savedisk
).
Then give the image a name.
And choose which disk you want to make a backup of.
If you have a software RAID setup, then Clonezilla will give you several options, including the RAID device (md0
, md1
). You just need to choose one of the real disks, such as sda
.
Next, choose which compression algorithm you want to use to compress the image.
After that, choose if you want to check the disk file system before backing it up.
And choose if you want to check the image is restorable.
In the next screen, you have the option to encrypt the image, which is useful if you save the image on a network location. Since I will store the image on my local USB drive, I choose not to encrypt the image.
And choose which action to take when everything is finished.
Now Clonezilla kindly gives you the equivalent command-line, so you can enter this one-liner next time you make a backup without going through all the questions again. Press Enter to continue.
Press y
to start saving your disk to an image.
Once Clonezilla finishes its job, you can power off your computer. If the process failed, you can check the /var/log/partclone.log
file.
How to Restore a Clonezilla Image to Disk
The restoration process is very similar to creating a backup. I won’t explain every step but show a few key steps.
After booting up your computer from the Clonezilla live USB, choose your language, keyboard layout and start the Clonezilla wizard, choose the device-image
mode to restore the image to disk.
Then select where the image will be read from. If the image is on a USB hard drive, you need to select the USB hard drive and mount it as /home/partimag
. Note that when you select a directory for the image repository, you should not choose the directory tagged with CZ_IMG.
After that, you should be able to choose the restoredisk
mode to restore an image to local disk.
And follow the rest of the instructions.
Create Clonezilla Recovery ISO Image
If your disk image is stored on a remote network location, but you want to restore the image on a machine without Internet connection, you can restart Clonezilla and create a bootable ISO image after you create an image backup for your disk. This allows you to boot other machines and restore the disk without an Internet connection. (You need to save the disk as an image first, then you can choose the image file to create an ISO file.)
Select device-image
mode and then recovery-iso-zip
.
Choose the disk image file to create an ISO file from.
When asked which device to be restored, enter ask_user
, so you will be able to choose the destination device when restoring the image to disk.
And follow the rest of the instructions.
Clonezilla will ask you to choose a file format for the ISO image:
- iso file: for CD/DVD
- zip file: for USB flash drive
Actually, the .iso
file format works for both CD/DVD and USB flash drive. On Linux, you can use the dd utility to create a bootable USB flash drive from the iso file.
Once you have a bootable USB flash drive, you can use it to restore the image on your orignal computer or on another computer if you want to.
One disadvantage of Clonezilla recovery ISO is that it can’t automatically convert hard disk name such as /dev/vda
to /dev/sda
. This will become a problem if you use the recovery ISO file on another computer that doesn’t use the same hard disk name. So in this case, you should not use a recovery ISO. The default Clonezilla image is able to convert hard disk names.
Unable to Boot
If your computer isn’t bootable after restoring from a Clonezilla image, you might need to:
- boot the computer from a Linux live ISO image and reinstall the GRUB boot loader to your hard disk.
- Make sure the
/etc/fstab
file contains the correct partition name.
Here’s how to reinstall GRUB boot loader for a BIOS computer. In the Linux live environment, find the name of your OS partition.
sudo fdisk -l
For example, my OS partition is /dev/sda2
. Then mount this OS partition.
sudo mount /dev/sda2 /mnt/
Next, run the following command to reinstall GRUB boot loader.
sudo grub-install --boot-directory /mnt/boot/ /dev/sda
If your computer uses the new UEFI firmware and the GPT parition table, then you need to find the ESP partition.
sudo parted -l
For example, my ESP partition is /dev/sda1
. Then mount this ESP partition.
sudo mount /dev/sda1 /mnt/
Next, run the following command to reinstall GRUB boot loader.
sudo grub-install --boot-directory /mnt/ /dev/sda
Clonezilla Drawbacks
While Clonezilla is reliable, it does have some drawbacks that limit its usage.
- It doesn’t support online disk cloning/imaging. The disk has to be unmounted.
- It can’t do incremental backup.
Backing Up Individual Files and Directories
If you just want to back up individual files and directories, not the entire disk, then you can use a tool like Duplicati to automatically back up your files to cloud storage. Duplicati can encrypt your files to prevent prying eyes.
Usually, I use Clonezilla to do a disk image backup twice a year and use Duplicati to automatically back up individual files and folders every day.
Wrapping Up
I hope this tutorial helped you use Clonezilla live to back up your disk drive. As always, if you found this post useful, then subscribe to our free newsletter to get more tips and tricks. Take care 🙂
Don’t forget about Rescuezilla (https://github.com/rescuezilla/rescuezilla ) and Redo Rescue (http://redorescue.com/). Both are great alternatives to Clonezilla and they have a GUI.
To me, the Ncurses-based menu-driven wizard in Clonezilla is a GUI 🙂
Excellent tutorial, thank you.
Tom
Tumbarumba NSW AU.
(Snowy Mountains)
‘Widsom From High In The Mountains’
As always, thanks for easy-to-follow guide.
How much capacity is needed in the thumb drive in order to make it a bootable Clonezilla live USB stick? If I want to dedicate a thumb drive to it, I don’t necessarily want to use one which will have extra unused capacity….
1 GB
有没有中文教程啊?英文看着好累啊
This site is English only. I don’t publish articles in Chinese.
Hello Xiao Guoan,
Your article is great, as always.
Do you know of any solution(s) that does online disk cloning/restoring? I can’t shutdown any of my servers, and I’ve been looking for a reliable solutions…
I know there’s one called Veeam, but I have never tried it.
Hi,
Thanks for the article, is pretty descriptive.
I have had an error, and it is that, after creating the IMG … in fact it is not a IMG, its a folder, with lots of files into it, and one gzip file for each partition, with separate img for each partition I think …
What can i have made wrong?
Thanks a lot!
This is not an error. Please read the entire article to learn how to create ISO file.
Hello,
Thank you for your very good description. Following these steps leaves me with a folder in the end. Could you please tell me if CloneZilla is able to make it into an .iso so that it can be run from another machine? Is it disk cloning I should do or?
Thank you in advance!
Yes, it can. You just need to read the rest of this article to learn how to create ISO file.
You can also clone a partition on one disk to another partition of another disk. Make sure the size of the target partition is larger than that of the source partition.