How to Clone Drives and Partitions with Clonezilla

clonezilla-logoSome hard drive cloning programs support a wide variety of filesystems. Some can create image files and store only the sectors that are actually in use. Some can clone over a network, and a few can multicast a drive or image file to multiple targets simultaneously. Clonezilla can do all of the above, with the added benefit of being free. It’s a live CD with partitioning software and simple cloning interface packed with useful features. In this guide, we’ll be using Clonezilla to run a disk-to-disk copy and checking out a few of the more interesting options.

Getting Clonezilla

You have a choice of a few ISO files at the download site here. The main difference between them is that Stable and Testing are based on Debian and contain only open source software, while the Alternate is based on Ubuntu and uses some non-OSS software. I’d recommend Stable, because in my opinion you can’t be too careful when it comes to things like partitioning and mass data transfer. That’s what we’ll be using for all examples and screenshots.

Preparing to Clone

Burn and boot the ISO like any other live CD, and you’ll be taken directly into the Clonezilla application. Once you’ve chosen language and keymap, you’ll be asked whether to start the cloning process or drop to shell.

clonezilla-start

The shell option isn’t something you want to overlook. If you need to do any ahead-of-time partitioning, here’s your chance to do it. You can drop to shell and run fdisk or cfdisk if needed, and whenever you’re ready to return you can start Clonezilla back up with

sudo /opt/drbl/sbin/clonezilla

clonezilla-image-or-disk

For the examples, we’ll be doing a direct disk-to-disk clone using some small virtual drives partitioned as such:

hda 2GB
  mbr - grub
  hda1 - Linux root (ext3)
  hda2 - swap
  hda3 - Linux /home (ext3)
hdb 2GB
  (unpartitioned)

Next we choose if we’ll proceed in Beginner or Expert mode. As this is an introductory article, we’ll go with beginner for now.

Our example will be a local-to-local copy. Remote copy and other topics could be covered in the future if there’s reader interest.

clonezilla-localorremote

Now choose the source and destination for the clone data.

clonezilla-choosesource

At this point the transfer will begin (after a few confirmation dialogs). You’ll be able to see the process as you go.

clonezilla-cloning

Cloning to Image Files

If you want to save your drive/partition into a file instead of cloning directly to another disk, Clonezilla can do that too. At the beginning of the Clonezilla process, you’d choose device-image instead of device-device, then pick the general target location for the image files.

clonezilla-choosesource1

Clonezilla creates a mount point /home/partimag that it will connect to whichever location you specify as the target. This is a great place for USB drives that can act as intermediary between systems. You’ll have a choice as to which device (and optionally which directory on the device) will hold your image files.

clonezilla-imagesaveorrestore

As you can see, up to this point it’s the same process you’d do if you were restoring FROM an image. If that was the case, the device you had just chosen as the target would be acting as the source of the image files.

Next you’ll choose the name of your image and the drive/partition you’ll be cloning. Once you’ve confirmed, you’re off and running.

clonezilla-savingimage

Josh Price is a Linux professional and contributing writer to MakeTechEasier.com

  • James A
    Thanks for the overview; found it very interesting... Still as a real beginner, I'm looking for clonezilla for 'dummies' articles... example question. My pc is win xp, have ms office and other progams running on it. I want to 'save' all the data and programming so if the drive crashes, and I need to replace the drive. How would I use clonezilla to do that? Many thanks, james.asbury@hayssen.com; 8/3/2010
  • JoshPrice
    That's generally the process the article describes. Whether cloning disk-to-disk or disk-to-image, you'd need a place to store the data.

    In brief, I'd suggest booting up your PC with a Clonezilla CD and external hard drive. Clonezilla will pick up the drive when running and allow you to build an image of your XP drive and save it to the external.

    Same basic process for restoring from that image back to disk.
  • James A
    Thanks!! One more if I may... can I use on Win 98? Thanks again.
  • JoshPrice
    It's capable of handling Win98's filesystem (FAT) yes, but as to whether you'd WANT to back up your 98..... =P
  • James A
    Thanks again!!
  • awesome thanks. Also, may be unrelated but have you tried using sysprep on Windows 7?
  • any luck on creating multiple images and saving them on same external HDD? I want to take a couple different machines (different hardware) and create an image for each and save it to the save harddrive, since I manage a variety of PCs.
    Can it be done where I can just use one HDD for all my images?
  • Joshua Price
    Yes, each time you save an image to the drive, Clonezilla will ask for an image name (like backup-2-2-2010 etc). You can even specify a particular directory where you keep your images so they're not all dumped on the drive's root.
  • Sam Masiello
    I've used Clonezilla many times and have always found it to be solid. The only problem I ever had with it was in trying to restore my MBR when restoring an Ubuntu image. Not sure if this was ever fixed, but I found a workaround.
  • Thanks for writing this post dude! I think CloneZilla should be more widely used because sh!t eventually hits the fan. :-)
blog comments powered by Disqus