17
Clonezilla Tutorial – Backup & Restore an Operating System Clonezilla Tutorial English: main menu of clonezilla Nederlands: hoofdmenu van clonezilla (Photo credit: Wikipedia) We have discussed in a previous article how to clone hard drives and one of the possible ways was the use of the Clonezilla utility, I found on Dedoimedo website a good Clonezilla tutorial that provided more information on how to use this software tool and I have re-published it below for your convenience. The new and definite CloneZilla tutorial Updated: June 27, 2011 It has been a while since I have written my original Free imaging software tutorial , which covered the use of CloneZilla and PartImage software. Moreover, the article focused on the backup part only. Today, I’d like to refresh and improve the tutorial. I will show you both how to backup and restore an operating system, including special emphasis on choosing the right device, GRUB bootloader and MBR restoration and other important, delicate elements of the procedure. We’ll do it both with Linux and Windows systems. The two guides, the original and this one, should be the definite source for using CloneZilla imaging software smartly and wisely. 1 / 17

Clonezilla Tutorial – Backup & Restore an Operating System

Embed Size (px)

Citation preview

Page 1: Clonezilla Tutorial – Backup & Restore an Operating System

Clonezilla Tutorial – Backup & Restore an OperatingSystem

Clonezilla Tutorial

English: main menu of clonezilla Nederlands: hoofdmenu van clonezilla (Photo credit:Wikipedia)

We have discussed in a previous article how to clone hard drives and one of the possible wayswas the use of the Clonezilla utility, I found on Dedoimedo website a good Clonezilla tutorialthat provided more information on how to use this software tool and I have re-published it belowfor your convenience.

The new and definite CloneZilla tutorial

Updated: June 27, 2011

It has been a while since I have written my original Free imaging software tutorial, whichcovered the use of CloneZilla and PartImage software. Moreover, the article focused on thebackup part only.

Today, I’d like to refresh and improve the tutorial. I will show you both how to backup andrestore an operating system, including special emphasis on choosing the right device, GRUBbootloader and MBR restoration and other important, delicate elements of the procedure. We’lldo it both with Linux and Windows systems. The two guides, the original and this one, should bethe definite source for using CloneZilla imaging software smartly and wisely.

1 / 17

Page 2: Clonezilla Tutorial – Backup & Restore an Operating System

Linux system

Backup

I will not elaborate too much on the need for backup or the imaging technology details. You canfind these in the original tutorial. The one thing I’d like to emphasize is you can never be toocareful when working with your data. If you are not full confident about what you’re doing, thendon’t. You may inadvertently ruin your disk, system or personal files.

Now that you have the right amount of fear and respect in your bones …

After launching CloneZilla, you will need to choose what mode you want to run the software.Shell is for experienced users who can type in commands manually or remember backup andrestore options by heart. The first option is a guided wizard.

First important step. You need to choose the device you want to save your images to. This is

2 / 17

Page 3: Clonezilla Tutorial – Backup & Restore an Operating System

the target or the destination, officially known as CloneZilla image repository. This device can bean internal or an external device. The device has to have a valid partition table and partitionsneed to be formatted with a supported filesystem, including Ext2/3/4 or even NTFS. For moreabout notations, please check my GParted tutorial.

Choose the directory.

We will now enter the expert mode. I personally think this is very important, as you can controlall steps of the backup procedure.

3 / 17

Page 4: Clonezilla Tutorial – Backup & Restore an Operating System

Now you need to choose the operation. You can backup either an entire disk or specificpartitions. We will do the latter. We want to backup the root (/) partition of our operating system,in this case Fedora 14, before making a distro upgrade. This means that if something goeshorribly wrong, we can restore the old state.

It is important to remember that we do NOT want to touch any other partition, which may containother operating systems or personal data. You must know exactly what you’re doing.

A word about savedisk

Savedisk operation lets you clone an entire disk. This can be useful, although I think savingspecific partitions is more effective. You gain modularity and flexibility and save space. Datapartitions do not need to be images, because there is no importance to partition table orfilesystem structure.

Now choose the partition you want to backup. This partition must be unmounted. In our case,we want to backup sda1, which is the first partition of our disk. This is the root (/) partition of theFedora system.

4 / 17

Page 5: Clonezilla Tutorial – Backup & Restore an Operating System

In this step, you can choose advanced parameters. For example, you can generate checksums,remove extra stuff like page and hibernation files in Windows, run a filesystem integrity check,and more.

Let me point out the important ones:

-c is important. Confirmation is always good.

-j2 allows cloning hidden data between MBR and the first partition – This refers to disk sectors1-62 between MBR, which rests in sector 0 and the first partition, which starts at sector 63 forlegacy reasons. Bootloaders like GRUB may keeps data there. Backing up this data does nothurt, although if you are only backing up and restoring partitions, this area will remainuntouched.

Do not skip NTFS integrity check. I would advise against using -rescue if you really don’t knowwhat you’re doing. Filesystem check and repair can be useful, although working with corruptfilesystems is always a bad idea. Use only if you’re desperate. If you must, perform a filesystemcheck BEFORE using CloneZilla.

5 / 17

Page 6: Clonezilla Tutorial – Backup & Restore an Operating System

Choose the compression option. CloneZilla can utilize multiple cores on modern systems. Thisis a new feature, but definitely worth exploring. Of course, if you are not sure or have neverused this or feel uncomfortable testing a new option with your critical data, then go for thesimplest and safest option.

In general, the tradeoff is between the backup speed and compression rate. Some algorithmsare slower, but they conserve space and vise versa. My recommendation would be either -z1(or -z1p) or -z2 (or -z2p) for most people.

Confirm your choice.

6 / 17

Page 7: Clonezilla Tutorial – Backup & Restore an Operating System

And we’re running.

7 / 17

Page 8: Clonezilla Tutorial – Backup & Restore an Operating System

Restore

Now, we will restore the partition.

The first several steps are identical. You need to choose the CloneZilla image repository. Afteryou enter the expert mode, instead of selecting saveparts, you need to select restoreparts,because this is what we did earlier – we saved a partition.

Remember, we are restoring an image of a specific partition table onto a system that may haveone or more operating systems, with multiple partitions. This procedure can be considered arollback of changes done to one of the partitions, without changing the rest of the disk data.

8 / 17

Page 9: Clonezilla Tutorial – Backup & Restore an Operating System

You need to remember this. Restore operation is not just blind dumping of data to a disk. This isa very specific, targeted operation. In our case, we only want to restore the Fedora rootpartition. We do not want to touch the bootloader. We do not want to alter the partition table inany way, as we have other, critical data on the disk.

A word about restoredisk

Restoredisk option allows you to restore an entire disk, which means all of its contents,including the bootloader, the partition table and different partitions contained therein. Whenusing restoredisk, CloneZilla can try to automatically resize partitions to match the destination.This is effectively a disk clone procedure. The disk you want to clone the image to does nothave to have a valid partition table.

Back to our business of restoring the partition. Now choose the image file you want to restore.This is the image we saved earlier.

Now choose the destination. It is very important that you make the right choice. Do focus, as

9 / 17

Page 10: Clonezilla Tutorial – Backup & Restore an Operating System

this is a crucial stage of the restore procedure.

Now, the advanced restore options. You need to be extra careful here. There are many optionsand they can be baffling, so please don’t rush and pay attention.

-g restores GRUB – if GRUB exists. No need if you are only restoring a partition and you knowthe bootloader functions properly. You can also use classic GRUB restore methods, if yourequire. Valid for both GRUB and GRUB2.

10 / 17

Page 11: Clonezilla Tutorial – Backup & Restore an Operating System

-e1 auto adjusts filesystem geometry for NTFS boot partitions. Good.

-e2 sounds extremely cryptic. What it says in layman’s terms is that CloneZilla will try to restorethe Windows bootloader (NTLDR) in the best way it can, so you avoid any need for repairing a failing Windows system afterwards. You may want to use the CHS value saved with the image,in which case you want the -e option. For most people, best left untouched.

-c is good. We want confirmation.

-r is preselected, but not relevant here. It will try to fit the filesystem to match partition size,which is good if your target is bigger or smaller than the one saved in the image.

-j1 will restore MBR, if you suspect it’s damaged for some reason. This does not work if yourpartition layout has changed between the saved image and the restore.

-j2 works on sectors 1-62. Not relevant for partition backup, but good to know.

Mind the other warnings and messages. For instance, don’t use the batch mode. Ignoring theCRC checks is also not recommended as this might indicate a corrupt or invalid image, whichcould further complicate things.

Now, you need to decide whether you want to touch the partition table. Remember, you are onlyrestoring a single partition. Therefore, you do NOT need or want to create the partition table.We want the first option, which is -k.

If you are restoring an entire disk, then yes, maybe you do want to do this. You can use thepartition table saved from the image. Alternatively, -k1 option can be useful.

11 / 17

Page 12: Clonezilla Tutorial – Backup & Restore an Operating System

A few confirmations and then:

And we’re done. Reboot and check. It should be ok. However, there is no guarantee. While thisprocedure has worked for me many times without a hitch, both with CloneZilla and otherimaging software, you may be the unlucky one.

Now, a few Windows 7 screenshots

12 / 17

Page 13: Clonezilla Tutorial – Backup & Restore an Operating System

For those of you using Windows, the procedure is virtually identical. To have you convinced,here’s a sequence of screenshots that runs through the same steps like before. We choose theimage repository, we save a partition there. When restoring, we mount the image repository,choose the correct image, choose the destination, set the restore options, like MBR andPartition Table creation (or rather not), and that’s it. Simple.

13 / 17

Page 14: Clonezilla Tutorial – Backup & Restore an Operating System

14 / 17

Page 15: Clonezilla Tutorial – Backup & Restore an Operating System

15 / 17

Page 16: Clonezilla Tutorial – Backup & Restore an Operating System

My most sincere recommendation is that you test. Use a non-critical system and run half adozen backups and restores, including deleting the contents of the disk after backup andrestoring them, deleting the partition table, ruining the bootloader, etc. Only after you havebattle-tested the software and yourself in this wide range of situations will you be comfortablewith the backup and restore procedure.

Data, well, that’s a different story altogether. Keep it backed up in many ways and shapes,multiple instances. As long as your data is safe, you’ll be fine.

And we’re truly done now.

Conclusion

I hope you find this tutorial useful. It’s a real-life case, no nonsense, backup and restore,including critical advanced options. Working with system images requires patience, skill andcourage, but it gets easier with time. Even so, do not ever let over-confidence best you.

Always make sure your personal data is safe, regardless of what you’re planning to do. Nevertest backup and restore on production machines. Pay close attention to details and advanced

16 / 17

Page 17: Clonezilla Tutorial – Backup & Restore an Operating System

options. If in doubt, stop, read and ask. With some luck, my two imaging tutorials on the subject,as well as the GParted tutorial ought to provide you with enough knowledge and guidance tosuccessfully and safely master the world of system imaging.

Cheers.

References

Free imaging software tutorial on CloneZilla & PartImage

How to clone Linux Hard Drives

Powered by TCPDF (www.tcpdf.org)

17 / 17