How to clone and restore harddisk using Clonezilla

To use clonezilla to backup and restore the OS for both windows and Linux systems

Clonezilla allows the user to clone and restore the entire storage media/ a portion of the media to a separate storage. The cloned data is stored as an image file. It can be either stored on an external harddisk or on network shares. The procedure to clone and restore the OS using clonezilla is explained in this article.

For this setup I have taken two Hardisk (One with CentOS and the other is Empty) and an USB device.


To clone a harddisk

Download clonezilla from its official website
http://clonezilla.org/downloads.php

and boot it to the USB device.

Select the USB drive from the boot screen.

The main clonezilla page appears. Click enter to proceed further.

Select the Language and click OK.

Click enter to start the Clonezilla.

Select the " device-image" to start cloning the device.

Choose the storage type, where the backup image is to be stored.


Select the disk where the image to be mounted. Here we are Choosing sda1.

Choose the directory and Click enter.

Again click enter to proceed further.

Choose the operation mode(backup/restore). Here, we are selecting " Savedisk" to clone the local disk.


Enter a name for the image to be cloned.

Now choose the source disk to be cloned using space bar.



By default clonezilla will mount the destination hard disk to " /home/part img/backup-img" , type " y" and press enter to proceed further.

The cloning starts.


After cloning, Press enter to continue.


Reboot the system.

Here, we are removing few files from the OS to verify the restore process in clonezilla.

Now we are booting the OS hard disk.

Open the terminal and run the following command to check the available disk

[root@localhost Desktop]# fdisk -l

Now mount the harddisk /dev/sda1 to the local harddisk.

[root@localhost Desktop]# mount /dev/sda1 /second
[root@localhost Desktop]# df-h
Filesystem    Size    Used    Avail    Use%   Mounted on
/dev/sdb2     116G     3.4G    107G     4%       /
tmp fs        3.8G     224K    3.8G     1%       /dev/shm
/dev/sdb1     477G     42M     410M     10%      /boot
/dev/sdc1     7.4G     242M    7.2G     4%       /media/20160529
/dev/sda1     459G     2.9G    433G     1%       /second-HDD

Go to the hard disk and list the hard disk.

[root@localhost Desktop]# cd /second-HDD/
[root@localhost Desktop]# ls -l
total 8
drwxr-xr-x. 2 root root 1395 jun 28 19:16 backup-img
drwxr-xr-x. 2 root root 1395 jun 28 01:13 backup-test

View the details in the image directory.

[root@localhost second-HDD]# cd backup-img/
[root@localhost backup-img]# ls -l

Remove all the files in the local disk using -rf option.

[root@localhost~]# rm -rf *
[root@localhost~]#ls -l
total 0

Reboot the system

[root@localhost~]# reboot

To restore the cloned image

In the boot screen, select the USB drive to run Clonezilla.

Now start clonezilla and choose the device image option.


Select the local drive

Choose the hard disk where the cloned image is stored.

Select the directory

Choose the Beginner mode and click Enter

Then choose restore disk option, to restore the image to the local disk.

Now choose the backup image to be restored in your local machine.

Select the hard disk to be restored and click enter to proceed further.

Press yes for the confirmation to proceed further.

It starts restoring the image to the local disk.

Finally reboot the system.

Open the terminal and run the following command to verify the stored image.

[root@localhost Desktop]# cd
[root@localhost ~]# ls -l
total 184
-rw-------. 1  root root 1395 jun 28 00:39  anaconda-ks.cfg
drwxr-xr-x. 2  root root 1395 jun 28 00:39  Desktop
drwxr-xr-x. 2  root root 1395 jun 28 00:39  Documents
drwxr-xr-x. 2  root root 1395 jun 28 00:39  Downloads
.
.
.
drwxr-xr-x. 2 root root 1395 jun 28 00:39  videos

Thus we have restored the image successfully.

FAQ
Q
How can I debug the clonezilla if it fails ?
A
0. use dcs to switch the mode you want, like clonezilla-start -> save disk, then you will got a complete drbl-ocs command like:
"drbl-ocs --clients-to-wait 1 -x -z3 -l en startdisk save".
1.
Q
What is the Alternatives available for clonezilla?
A
Here you can see the alternatives for the "clonezilla",
Acronis True Image. ...
Macrium Reflect. ...
dd. ...
Win32 Disk Imager. ...
Redo Backup and Recovery. ...
EaseUS ToDo BackUp. ...
Carbon Copy Cloner. ...
HDclo
Q
What is main terms of using the Clonezilla?
A
Clonezilla allows the user to clone and restore the entire storage media/ a portion of the media to a separate storage. The cloned data is stored as an image file. It can be either stored on
Q
What is the minimum requirement of using the "clonezilla"?
A
The requirement of using the "clonezilla" is given below,
X86 or x86-64 processor
196 MB of system memory (RAM)
Boot device, e.g. CD/DVD Drive, USB port, PXE, or hard drive
Q
Whether the Clonezilla is available for Windows?
A
The "Clonezilla" is also avialable for Windows.