Your SlideShare is downloading. ×
Clonezilla Tutorial – Backup & Restore an Operating System
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Clonezilla Tutorial – Backup & Restore an Operating System

1,394
views

Published on


0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
1,394
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
24
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. Clonezilla Tutorial – Backup & Restore an OperatingSystemClonezilla TutorialEnglish: 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 tutorialUpdated: June 27, 2011It 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
  • 2. Linux systemBackupI 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
  • 3. 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
  • 4. 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 savediskSavedisk 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
  • 5. 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
  • 6. 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
  • 7. And we’re running. 7 / 17
  • 8. RestoreNow, 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
  • 9. 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 restorediskRestoredisk 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
  • 10. 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
  • 11. -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 afailing 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
  • 12. 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
  • 13. 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
  • 14. 14 / 17
  • 15. 15 / 17
  • 16. 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.ConclusionI 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
  • 17. 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 to successfully and safely master the world of system imaging. Cheers. References Free imaging software tutorial on CloneZilla & PartImage How to clone Linux Hard Drives 17 / 17Powered by TCPDF (www.tcpdf.org)