Clonezilla Live on Hard Drive |
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:
- Boot the OS in the harddrive, saying it's GNU/Linux.
- Mount /dev/sda4 as /mnt, you can make it by: mount /dev/sda4 /mnt
- 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).
- Change the dir name "live" under /mnt as another name, say "live-hd". You can make it by: "cd /mnt; mv live live-hd"
- If your grub is 2.x (grub-pc), e.g. on Debian Buster or Ubuntu 20.04, edit /etc/grub.d/40_custom, make it like:
================================================
menuentry "Clonezilla" {
set root=(hd0,4)
linux /live-hd/vmlinuz boot=live union=overlay username=user config components quiet 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=live-hd,syslinux,EFI
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, from Clonezilla live >= 2.6.2-15, you can use only the Clonezilal live iso file in grub2. Thanks to Phil Webster for this hint:
First, download the Clonezilla live iso, e.g., clonezilla-live-2.7.2-39-amd64.iso. Then put it in the partition of your OS, say /dev/sda2, which might be mounted as /boot. Then make the grub2 custom menu (/etc/grub.d/40_custom) like:
================================================
menuentry "clonezilla-live" {
ISO="/clonezilla-live-2.7.2-39-amd64.iso"
search --set -f $ISO
loopback loop $ISO
linux (loop)/live/vmlinuz boot=live union=overlay username=user config components quiet noswap edd=on nomodeset locales= keyboard-layouts= ocs_live_run="ocs-live-general" ocs_live_extra_param="" ocs_live_batch="no" vga=791 ip= net.ifnames=0 splash i915.blacklist=yes radeonhd.blacklist=yes nouveau.blacklist=yes vmwgfx.enable_fbdev=1 findiso=$ISO
initrd (loop)/live/initrd.img
}
================================================
For the above grub config file, please change "linux" as "linuxefi", and "initrd" as "initrdefi" when your OS is uEFI booting.
Then run "update-grub2" to update your grub2 config.
(For CentOS/Fedora/Redhat, the command is like:"grub2-mkconfig -o "$(readlink -e /etc/grub2.cfg)" or "grub2-mkconfig -o "$(readlink -e /etc/grub2-efi.cfg)", depending on your grub config file path, to update your grub2 config.
- 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 union=overlay username=user config components quiet 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=live-hd,syslinux,EFI
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.
- 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=live-hd,syslinux,EFI" 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=live-hd,syslinux,EFI") only. This is useful when you have some customized files you need in /dev/sda4/.
- 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.
- 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: