Clonezilla

The Free and Open Source Software for Disk Imaging and Cloning
Clonezilla Live on Hard Drive

In this doc we explain how to put clonezilla live in your harddrive which already has an OS installed.
Here we use grub boot loader as an example. You have to put the clonezilla live files in a FAT, ext2/3, reiserfs or any grub supported partition.
If you do not have such a partition, you can use gparted to resize your partition and create another partition to put clonezilla live. Here we assume you already have a FAT partition /dev/sda4 to put clonezilla live. This is how to do that:
  1. Boot the OS in the harddrive, saying it's GNU/Linux.
  2. Mount /dev/sda4 as /mnt, you can make it by: mount /dev/sda4 /mnt
  3. Download clonezilla live zip file, and unzip all the files in /mnt, make sure you put all the files in /mnt, say, "GPL" is in /mnt/, not in any subdir. You can make it by something like: "unzip clonezilla-live-*.zip -d /mnt" (Replace clonezilla-live-*.zip with the file name you just downloaded).
  4. Change the dir name "live" under /mnt as another name, say "live-hd". You can make it by: "cd /mnt; mv live live-hd"
  5. If your grub is version 1.x, edit your grub config file /boot/grub/menu.lst, and append the following:

    ================================================
    title Clonezilla live on harddrive
    root (hd0,3)
    kernel /live-hd/vmlinuz boot=live live-config noswap nolocales edd=on nomodeset ocs_live_run="ocs-live-general" ocs_live_extra_param="" keyboard-layouts="" ocs_live_batch="no" locales="" vga=788 ip=frommedia nosplash live-media-path=/live-hd bootfrom=/dev/sda4 toram=filesystem.squashfs
    initrd /live-hd/initrd.img
    boot

    ================================================
    //NOTE// There is a length limit (256 characters, for example) on the boot parameters for grub 1. For more info, please check this discussion.

  6. If your grub is 2.x (grub-pc), e.g. on Debian Squeeze or Ubuntu 9.10, edit /etc/grub.d/40_custom, make it like:

    ================================================
    menuentry "Clonezilla" {
    set root=(hd0,4)
    linux /live-hd/vmlinuz boot=live live-config noswap nolocales edd=on nomodeset ocs_live_run=\"ocs-live-general\" ocs_live_extra_param=\"\" keyboard-layouts=\"\" ocs_live_batch=\"no\" locales=\"\" vga=788 ip=frommedia nosplash live-media-path=/live-hd bootfrom=/dev/sda4 toram=filesystem.squashfs
    initrd /live-hd/initrd.img
    }

    ================================================
    //NOTE//

    • In grub2, (hd0,4) means the first harddrive and the 4th partition. It's different from that in grub version 1. Then run "update-grub2" to update your grub2 config. (Thanks to Louie Chen for providing this).
    • Remember to put back slash \ before " for the boot parameters in grub 2. Otherwise it won't shown in /proc/cmdline, then some actions of Clonezilla won't work.


    Besides, you can use only the Clonezilal live iso file in grub2 (Thanks to the patches files from grml). For example, put clonezilla-live-1.2.6-24.iso in dir /home/isos/, then make the grub2 custom menu (/etc/grub.d/40_custom) like:

    ================================================
    menuentry "Clonezilla live" {
    set isofile="/home/isos/clonezilla-live-1.2.6-24.iso"
    loopback loop $isofile
    linux (loop)/live/vmlinuz boot=live live-config noswap nolocales edd=on nomodeset ocs_live_run=\"ocs-live-general\" ocs_live_extra_param=\"\" keyboard-layouts=\"\" ocs_live_batch=\"no\" locales=\"\" vga=788 ip=frommedia nosplash toram=filesystem.squashfs findiso=$isofile
    initrd (loop)/live/initrd.img
    }

    ================================================
    Then run "update-grub2" to update your grub2 config.

//NOTE//:
  1. Here we assign "live-media-path=/live-hd" since the files are not put in the default path (live). We force to use "bootfrom=/dev/sda4" (files are on /dev/sda4) so that if there is another Clonezilla live on your CD drive (e.g. /dev/hdc), the live initramfs wont's find the wrong files from your CD drvie. An extra param "toram=filesystem.squashfs" is added so that later later you can mount /dev/sda4 as clonezilla image dir if you want. If you want live-initramfs to copy all the files in /dev/sda4 to memory, you can use "toram" (not "toram=filesystem.squashfs") only. This is useful when you have some customized files you need in /dev/sda4/.
  2. Remember to check kernel and initrd file names and the parameters in syslinux/syslinux.cfg from the zip file, copy them to here. It might be different from here, say vmlinuz path, username and hostname maybe different.
  3. If you do not change the dir name from "live" to "live-hd" in the above, you might encounter a problem when you have a version of Clonezilla live on harddrive and you want to boot your Clonezilla live CD or USB flash drive. There are some discussions about this. Check: