Clonezilla

Clonezilla can be used to back Up your Windows Installation, when setting up dual boot with Linux .

http://www.mindworkshop.info/windows/windows-adjustments-back-up-your-windows-installation/ ↗

The hard drive in your computer is easily its most valuable component – although its worth probably can’t be measured entirely by the damage it did to your credit card. Installing Windows, and subsequently installing all the applications that will run under Windows, can take days.

While you can back up important files on your hard drive, there’s no way to back up an entire Windows hard drive in a form that would allow you to subsequently restore it and get back on line immediately, should your current hard drive get nuked by a virus, or wiped accidentally, or just die.

At least, there’s no way to completely back up a Windows hard drive under Windows. Windows locks down several important components of itself, making them inaccessible to other applications while Windows is running. This would include whatever software was intended to back up your system.

There’s a way to get around this seemingly insurmountable problem, and I should begin by pointing out that it sounds a great deal hairier than it really is. You can back up a Windows hard drive by booting up your computer using an operating system other than Windows, from a device other than your hard drive, and running back up software from this “other” operating system.

In practice, the general lack of hairiness involved in doing so can be ascribed to something called a “rescue CD,” a dedicated version of the aforementioned other operating system and the software running under it that’s been configured exclusively to back up hard drives. A rescue CD doesn’t require that you do anything more involved that follow some prompts and find something to do while it actually backs up and restores things.

Because Windows really, really dislikes being meddled with and moved around, the ideal procedure for backing it up is what’s called a “hard drive clone.” Rather than trying to copy all of Windows’ sneaky little files and put them back where they started without Windows noticing the switch, a hard drive clone copies the low-level data stored on your source hard drive while remaining ignorant of what it contains. As long is it performs the copy procedure faithfully, the eventual restored hard drive it creates will be exactly like the one it backed up, and Windows will run just as it did before the backup.

Available Software: Send in the Clones

There are a number of commercial packages that purport to clone hard drives, and we’ve tried several of them over the years. All these experiences were fraught with trauma and anguish, and few of them ended well. As nearly as we could tell, all of them modified the hard drives they were backing up, such that if something went wrong, the drive being backed up was left in a non-bootable state.

This can get ugly pretty quickly.

There are also a number of open-source rescue CDs. Most of the ones we’ve tried have worked far better than their commercial counterparts. Perhaps more to the point, they don’t actually change anything on the hard drive to be backed up, so if something crashes or misbehaves, you can just eject the CD and restart your computer normally.

Open-source rescue CDs are typically based on the Linux operating system. This having been said, unless you insist on doing something unusual or daring with one, you’ll never have to interact with Linux directly, or know any of Linux’s weird commands or mutant language.

Our current favorite rescue CD is called Clonezilla ↗ . It was designed by Steven Shaiu and developed by the NCHC Free Software Labs in Taiwan. It’s available as an ISO file, that is, a CD-ROM image. Download it from the Clonezilla web page ↗ and burn the ISO file to a CD-R – all the necessary files to create a bootable rescue CD will be burnt to your CD, and you won’t have to know any more about Linux than most salad vegetables do.

There are several flavors of Clonezilla as of this writing – you’ll want the one called Clonezilla Live at the “stable” link. It was called clonezilla-live-1.2.2-24.iso as of this writing. You’ll also need CD-ROM burning software that supports ISO files. We use Roxio’s CD Creator. ISO Burner from Imtoo is a nice shareware package to perform this function.

There’s no cost to download or use Clonezilla, although the Clonezilla web page invites you to donate some cash to its authors – something you should do if you use it, as it will almost certainly save your backside sooner or later.

At this point, it’s probably worth mentioning the first of several important disclaimers. Clonezilla consists of a number of disparate open-source programs assembled with a script to run them. As with most open source software, they work really well… but they don’t look particularly polished or trustworthy. Most of the Clonezilla experience runs in text mode, with bags of inscrutable messages scrolling past you at the speed of light. Don’t let this put you off.

Actually, it’s probably worth mentioning another important disclaimer. We’ve used Clonezilla without any ill effects – which is a lot more than we can say of its commercial cousins. None the less, keep in mind that Clonezilla is going to interact with your primary hard drive in a way that offers virtually no protection against your drive being overwritten, corrupted or wiped clean if something untoward happens. As such:

Clonezilla Eats Manhattan

When Clonezilla boots up, it will create a small version of Linux in your computer’s memory, which will remain in place for the duration of your Clonezilla session. It will then run the appropriate parts of itself to back up your hard drive. You’ll need to select some defaults and confirm a few actions.

In addition to the Clonezilla CD-ROM, you’ll also need somewhere to back up your hard drive to. In theory, you could send the image data over a network to a server or other storage device, or write it to a great many DVD-Rs. Neither of these options is particularly easy to deal with, however. In this example, we’re going to use a removable USB hard drive as the destination storage device to hold your hard drive image. Make sure you have one that’s at least as large as the hard drive you want to back up, and is initially empty.

There are a few terms and concepts you’ll probably bump into in using Clonezilla – you won’t need to get deeply into these matters, but having the important ones by the throat may help alleviate some of the unspeakable terror of turning unknown and none-too-pretty software loose on your unprotected computer.

As an aside, once you get started with Clonezilla, it can be a bit tricky to determine which Linux device is your internal hard drive and which is your USB drive. This situation will be exacerbated if you have lots of other removable storage devices connected to your system. It’s a really good idea to power down or disconnect any other external hard drives or flash drives you won’t be using for this procedure.

As a final note before this discussion gets disturbing, you can run Clonezilla successfully with a minimum level of technical competence. If you’re unusually dangerous around things with plugs, however, and you have a more technical friend handy, this might be the time to invite him or her over to your digs for a meal and an evening of hard drive management.

Backing up your Hard Drive

The following procedure will create a disk image of your internal hard drive on your removable USB drive, which will subsequently be available to restore. Here’s the rub.

  1. Restart your system with the Clonezilla CD in your CD-ROM drive. You might have to reconfigure your computer to boot up from its CD. Clonezilla, rather than Windows, should boot up.
  2. Hit Enter to select the default Clonezilla screen settings. Linux will begin to boot up. A great deal of text will scroll past your screen – ignore it all, or your head will explode.
  3. Hit Enter to select English when the language prompt appears, or choose another language.
  4. Hit Enter to use the existing key map – this defines how your keyboard will be managed by Linux.
  5. Hit Enter to start Clonezilla.
  6. Hit Enter to work with disk or partition images. You do not want to copy directly from one disk to another, which would require that you have two internal hard drives installed in your computer.
  7. Hit Enter to select Use Local Device. This will allow you to copy your hard drive image to a local USB removable hard drive. The other options involve sending your hard drive image over a network to a server, which unquestionably involves more hoops than you need to jump through just now.
  8. Some slightly inscrutable text will appear at the bottom of your screen. Plug in your USB hard drive if you haven’t done so previously. Wait for at least five seconds so it can spin up and then hit Enter.
  9. When the Mode screen appears, locate your USB hard drive. It will typically be the last item in the list, usually on a line that begins sdb1. The other items, usually beginning sda1, will be partitions of your internal hard drive. Use the arrow keys to select the external USB hard drive entry and hit Enter.
  10. Hit Enter to select the top directory, that is the root, of your removable hard drive as the location to write a disk image to. Clonezilla will create a subdirectory therein. Some text will appear at the bottom of your screen. Hit Enter to continue.
  11. Hit Enter to select Beginner Mode – it sounds a bit condescending, but it uses a well-chosen set of defaults.
  12. Hit Enter to save your local hard drive as an image.
  13. Hit Enter to accept the default image folder file name.
  14. Select the internal hard drive to copy to an image. Chances are, you’ll only have one. Hit Enter.
  15. Some text will appear at the bottom of your screen Hit Enter to continue.
  16. After quite a bit of text scrolls past, you’ll be asked if you’re sure you want to continue. Hit y and then hit Enter.
  17. Find something to do for about two hours. Note that in addition to writing the primary partition of your hard drive to an image, it will probably store one or more smaller partitions – it’s not over ‘til the software says it’s over.

When Clonezilla has finished creating a disk image, it will offer you a number of shut- down options. Reboot your computer. Linux will wind itself down and eject the Clonezilla CD-ROM before it restarts Windows. You’ll probably want to boot your computer normally and make sure that your original Windows installation is still behaving itself.

Restoring your Hard Drive

You can just stash your removable USB drive with its completed disk image somewhere safe, along with a copy of the Clonezilla CD, against the day you try to boot up Windows and you notice that world has come to an end.

We’re extremely fond of removable hard drives ↗ , and as such, we created clones of several critical Windows drives as soon as Clonezilla was finished backing them up. This both confirmed that the backup procedure was successful, and provided us with plug-in replacements for these drives with essentially no wait time, in the event of a catastrophe.

Here’s how to restore your hard drive from an image created by Clonezilla. This is also how you can create a clone of your hard drive – just restore the image to another hard drive. In the latter case, you should use the same size hard drive as the one you created an image from, and ideally, the same model of drive. While it’s possible to restore a disk image to a larger drive and subsequently fiddle the partition tables thereof to avail Windows of the extra real estate, doing so is well beyond the scope of this posting.

To restore a backed-up image to your hard drive:

  1. Repeat the foregoing procedure, up to but not including step 12.
  2. When you reach the Clonezilla: Select Mode screen, use your arrow keys to select Restore an Image to Local Disk and hit Enter.
  3. Clonezilla will prompt you to choose an image file to restore – there should be only one. Hit Enter.
  4. Select the hard drive to restore your image to – again, there’ll probably only be one option. Needless to say, once Clonezilla gets going with this part of its adventure, everything currently on the destination hard drive will be toast. Hit Enter.
  5. Some text will appear at the bottom of your screen. Hit Enter.
  6. You’ll be asked if you’re sure you want to continue. Enter y and hit Enter.
  7. You’ll be asked again if you’re sure you want to continue. Enter y and hit Enter.
  8. After a considerable amount of scrolling text, you’ll see a Partclone window with a bar graph indicating how things are going. Plan on about a wait of about a third of the time required to back up your hard drive.

Once again, let Clonezilla shut down and reboot and it’s done. Your restored hard drive should now be bootable, and behave just like the original drive you backed up.

Backing up your hard drive this way is time consuming, and will tie up some modestly expensive hardware. For most Windows users, it will entail repeating the backup procedure periodically, to keep your backed up disk image up to date. It will, however, provide you with a largely bulletproof way to get your computer back on line quickly and reliably in the event of something nasty happening to your Windows installation. You’ll be able to look smug while all around you are shrieking in terror and searching for a tall building to leap from. It will have been worth the effort.

Please see the disclaimers for Windows Adjustments ↗ before you apply the information at this post.

Some FAQ’s

When I use clonezilla to clone MS windows, there is no any problem when saving an image from template machine. However, after the image is restored to another machine, it fails to boot, the error message is “Missing Operating System” or just a blinking underscore. What’s going on ?

Usually this is because GNU/Linux and M$ windows interpret the CHS (cylinder, head, sector) value of harddrive differently. Some possible solutions:

  1. Maybe you can change the IDE harddrive setting in BIOS, try to use LBA instead of auto mode.
  2. Try to choose both
  3. [*] -j0 Use dd to create partition table instead of sfdisk
  4. and
  5. [*] -t1 Client restores the prebuilt MBR from syslinux (For Windows only)
  6. when you restore the image.
  7. Try to choose
  8. [*] -t1 Client restores the prebuilt MBR from syslinux (For Windows only)
  9. and uncheck
  10. -g auto Reinstall grub in client disk MBR (only if grub config exists)
  11. -r Try to resize the filesystem to fit partition size
  12. when you restore the image. You can refer to this discussion. Thanks to Alex Mckenzie for posting this on the forum.
  13. You can try to boot the machine with MS Windows 9x bootable floppy, and in the DOS command prompt, run: “fdisk /mbr”.
  14. You can try to boot the machine with MS Windows XP installation CD, enter recovery mode (by pressing F10 key in MS XP, for example), then in the console, run “fixmbr” to fix it. Maybe another command “fixboot” will help, too. For more info, refer to this doc
  15. Use ntfsfixbootto fix it. This program is included in Clonezila live and its name is partclone.ntfsfixboot, and you can use it to adjust FS geometry on NTFS partitions. By default this should be done by Clonezilla with the option -e1 and -e2 checked. If not, you can force to do that again. For more info, please run “partclone.ntfsfixboot –help” or refer to http://sourceforge.net/projects/ntfsfixboot/ ↗ ↗ .
  16. Use ntfsreloc to adjust FS geometry on NTFS partitions. For more info, refer to http://www.linux-ntfs.org/doku.php?id=contrib:ntfsreloc ↗ ↗ . NOTE ntfsreloc is an older version of partclone.ntfsfixboot.
  17. If you get error messages like “0xc0000225, 0xc00000e”, and something about Winload.exe, refer to this.
  18. Some more discussions are available here.

I am trying to restore an image of a 300 Gb drive (with 30 Gb of data) onto a 250 Gb drive, but it gives me an error that the output drive partition doesn’t have enough space to fit the image. Is there any way to restore it anyway?

No. Clonezilla is an image-based program, which means the target partition size must be equal or larger than the original one. However, it’s can be done by using GParted(especially GParted live) to resize the source partition, then use Clonezilla to clone partition (not clone disk, i.e. use the option “restoreparts”. That also means you have to manually create the partition table on the target disk, and the target partition size must be equal or larger than the source parition). Remember to backup important data before you resize a partition.

After I did a disk-to-disk clone, my MS Windows in the source disk fails to boot. Why?

Clonezilla actually won’t modify anything on the source disk. The reason after cloning your MS Windows fails to boot might be due to the destination disk is not removed from the same machine.

When you do a disk to disk clone, once you finish the cloning, you should remove the source disk or target disk. Then you can boot the MS windows. You should not keep them coexist on the same machine. This is nothing to do with Clonezilla. Clonezilla does clone the OS for you. The problem is on the restored OS. Especially for MS Windows, you give the OS 2 identical hard drives on the same machine. This will confuse your MS windows, and it is an OS which is sensitive to the hardware… Say, it might find the root file system on the destination hard drive, however, the hardware is apparently different, then MS Windows gives you BSOD. Therefore, to avoid this issue, remember to remove either source disk or destination one from the machine.

How can I restore the image from small harddisk to larger one ?

Clonezilla is NOT able to restore the image from LARGE harddisk to smaller one, but it CAN restore the image from small harddisk to larger one. Three choices are available. Here they are:

Choice (1).

  1. Save the image in the Clonezilla server.

  2. Do a normal restoration to target machine by clonezilla.

  3. When clone is finished, use

gpartedto resize or move the partition. You can install gparted in the DRBL server, then boot the client into remote-linux-gra (dcs -> remote-linux-gra) mode, login client as root, run gparted to do that. Or you can use gparted LiveCD or LiveUSB to do that. A gparted-clonezilla dual boot live CD is available, for more info, checkhttp://gparted.free.fr/GParted-Clonezilla/ or http://www.icewalkers.com/jump.php?AID=2917&src=home ↗ .

Choice (2).

  1. Save the image in the Clonezilla server.

  2. Prepare a partition table (manually created by fdisk in the target

machine, then use “sfdisk -d /dev/hda > pt.sf”, or you can manually edit that file if you are familiar with that), and backup /home/partimag/$IMA_NAME/pt.sf, then overwrite the /home/partimag/$IMA_NAME/pt.sf.

  1. Now use dcs -> clonezilla-start -> clonezilla-restore-disk in server,

remember to choose option -r (Resize the partition when restoration finishes).

  1. boot the client,

Choice (3).

  1. Save the image in the Clonezilla server.

  2. Boot the target machine as remote-linux-txt (dcs ->

remote-linux-txt).

  1. Login in as root in the target machine, use fdisk to create the

partitions you want. Remember every partition size should be larger than that in the image file.

  1. Now use dcs -> clonezilla-start -> clonezilla-restore-disk in server,

remember to choose option -k (Do NOT create partition in target harddisk in client), and option -r (Resize the partition when restoration finishes).

  1. boot the client,

That’s all. The above scenario I am assuming you are cloning M$ windows (ntfs or fat) or Linux ext2/ext3, since that resize action need ntfsresize (already in opt/drbl/sbin), parted and resize2fs. These programs are already in DRBL environment. For other file systems, such as reiserfs, xfs or jfs, you have to install those resize programs in the server, and maybe manually resize is necessary after clone.

How much space do I need when saving an image ?

This really depends. It depends on the data on a partition, and the compression algorithm you choose. Normally if you choose to use gzip, and the partition is an OS (GNU/Linux, MS Windows) partition, the space required is about 1/3. E.g. For 45 GB data used on a 100 GB harddrive, you will need about 15 GB space to save the image.

What are the compression options in Clonezilla? What are the differences?

In the Clonezilla, the compression opitons are:

In the above optioins, “-z0” is the same with “–no-compress”, and so on…

You can refer to some benchmark report about the speed and time for gzip, bzip2, lzo, and lzma… e.g. http://www.linuxjournal.com/article/8051 ↗

When I save an image, I see messages like “{ DriveReady Error }” or “{ DriveReady DataRequest Error }”, what can I do?

Normally when you see messages like:

hda: possible failed opcode: 0xc8
dma_instr: status=0x41 { DriveReady Error }
hda: task_pio_intr: status=0x49 { DriveReady DataRequest Error }
io_all: errno = Input/output error(5)

It means that your hard drive has hardware issues, e.g. bad blocks. You’d better to copy important data before you continue to use it. If you want to use Clonezilla to save the image, you can try to enter expert mode, choose “-q2” and “-rescue” (the rest of options can be default ones) so that it can use the rescue mode of partclone to save the image for you. However, this does not mean it always work. Good luck!

After I restore the MS windows image, I got error messages about “0xc0000225, 0xc00000e”, and something about Winload.exe, any hint?

http://sourceforge.net/projects/clonezilla/forums/forum/394751/topic/3659739 ↗


© Prabu Anand K 2020-2026