This copyright is preserved for the author and publisher. Anyone is permitted to copy and distribute verbatim copies of this document under the terms of the GNU FDL Free Documentation License. If you do make any distribution or modification of the document, please add your name to the authors list.
We recommend this document principally for works whose purpose is instruction or reference. The author and publisher will not take any responsibility if there is any damage caused by this document.
2. Authors
Steven Shiau
(steven _at_ nchc org tw)
K. L. Huang (klhaung _at_ gmail com)
H. T. Wang (c00wht00 _at_ nchc org tw)
Ceasar Sun (ceasar _at_ nchc org tw)
Jazz Wang (jazz _at_ nchc org tw)
Thomas Tsai (thomas _at_ nchc org tw)
3. About Clonezilla Live
Clonezilla server edition is used to clone many computers simultaneously. It is an extremely useful tool, however, it does have several limitations. In order to use it, you must first prepare a DRBL server AND the machine to be cloned must boot from a network (e.g. PXE/Etherboot). To address these limitations, the Free Software Lab at the NCHC has combined Debian Live with Clonezilla to produce "Clonezilla Live," a new software that can be used to easily clone individual machines. The primary benefit of Clonezilla Live is that it eliminates the need to set up a DRBL server ahead of time and the need for the computer being cloned to boot from a network. Clonezilla Live can be used to clone individual computers using a CD/DVD or USB flash drive. Though the image size is limited by the boot media's storage capacity, this problem can be eliminated by using a network filesystem such as sshfs or samba.
4. How to make Clonezilla Live ?
To make Clonezilla live, the basic steps are to download pre-build Clonezilla Live then put it in a boot media (CD, USB flash drive or USB hard drive). Two types of files are available, iso and zip. The former one is for CD, the latter is for USB flash drive. Besides, you can put Clonezilla live on hard drive or PXE server, too.
For CD/DVD:
Download an ISO file for CD/DVD. Then you can burn the iso file to a CD/DVD with any burnning program, such K3b on GNU/Linux or InfraRecorder on MS Windows. The CD can then be used to boot the machine you want to clone.
For USB flash drive or USB hard drive:
To put Clonezilla live on a USB flash drive or USB hard drive, check this doc.
For hard drive:
To put Clonezilla live on a harddrive with OS installed already, check this doc.
For PXE server:
To put Clonezilla live on a PXE server and boot your client via PXE, check this doc.
Once you have the bootable Clonezilla Live media, as created in the previous step, you can boot it in the machine you want to clone. Remember to use the Clonezilla live media, such as CD, USB flash drive, USB hard drive, hard drive or PXE to boot the machine. For example, if you have Clonezilla Live in USB flash drive, you have to boot it via USB device (Ex. USB-HDD or USB-ZIP). If necessary, you can set the first boot priority in the BIOS as USB-HDD or USB-ZIP so that it can boot Clonezilla Live from your USB flash drive.
Here is a screenshot of Clonezilla Live boot menu:
The first 3 choices illustrate the "Clonezilla Live" boot menu. The first one is the default mode for Clonezilla Live. It will default to framebuffer mode with a resolution of 1024x768, you can choose other modes, e.g. 800X600 or 640x480 one if you want.
The choice, "Clonezilla live (To RAM. Boot media can be removed later), is the same function with the 1st one except when Clonezilla live booting finishes, all the necessary files are copied to memory. Therefore you can remove the boot media (CD or USB flash drive) then.
If you do not need a Traditional Chinese environment or if your computer experiences problems in the framebuffer mode, you can choose the one "Clonezilla Live (no framebuffer)" to clone in the English environment.
The choice, "Clonezilla live (failsafe mode)", is for something goes wrong when you are not be able to boot your machine, such as ACPI of your machine is not supported in the kernel.
If you want to boot local OS in your harddrive, you can choose the one "Local operating system in harddrive (if available)". This is an extra function in the boot media that has nothing to do with Clonezilla Live.
The choice, "FreeDOS", allows you to boot your machine into Free DOS. This is an extra function in the boot media that has nothing to do with Clonezilla Live.
The choice, "Memory test using Memtest86+," is for memory testing using Memtest86+. This is an extra function in the boot media that has nothing to do with Clonezilla Live.
The choice, "Network boot via etherboot" or "Network boot via gpxe" is used to perform a network boot via Etherboot or gPXE. If your computer does not have a PXE network, you can use this to do boot from a network. This is an extra function in the boot media that has nothing to do with Clonezilla Live.
After language and keymap are chosen, first you will be prompted to assign the image repository, which can be local disk, ssh server, nfs server, samba server (network neighborhood) or any file system you can mount as /home/partimag. Once the repository is ready, you can proceed to save or restore the image. Just follow the on-screen instructions. Two main screenshots about Clonezilla live:
///Note/// The image name of Clonezilla is actually a directory name. For example, if you give the image name as 2007-05-NOVISTA, all the info will be saved as in the directory /home/partimag/2007-05-NOVISTA/. Inside that directory, MBR, partition table and partition files will be stored. Therefore when you want to restore an image, remember to mount the /home/partimag as the right device or path. i.e. the directory 2007-05-NOVISTA must be in the clonezilla home directory (Ex. /home/partimag)
NEW! You can refer to these step-by-step examples, which provide more details about how to save and restore image.
[Expert mode] If you want to MANUALLY mount clonezilla image home (/home/partimag), follow this:
Run "sudo su -" to become root.
You must prepare another writable device or space and mount it as /home/partimag (Note! If your boot media is writable, such as USB flash drive or you choose to use To RAM option, the existing /home/partimag is linked to /live_media/home/partimag, You have to remove that file and create a directory /home/partimag as a mount point by "rm -f /home/partimag; mkdir -p /home/partimag).
Ex. If you want to use Clonezilla to save /dev/hda and put the image in /dev/hdb1, then you have to mount /dev/hdb1 as /home/partimag by "mount -t auto /dev/hdb1 /home/partimag". If the file system of /dev/hdb1 is ntfs, you have to use "ntfs-3g /dev/hdb1 /home/partimag" to mount it so that it's writable. Remember, sshfs and smbfs are also supported. For example, using sshfs, you can mount your remote ssh server:
sshfs ACCOUNT@SSH_SERVER:/ABSOLUTE_PATH /home/partimag
i.e. if you want to mount your ssh server 192.168.100.254 with directory /work/pool, run it like this:
sshfs root@192.168.100.254:/work/pool /home/partimag
If you want to mount your samba server 192.168.200.254 with directory /work/smb, run it like this:
mount -t cifs -o username=your_user_name //192.168.200.254/work/smb /home/partimag
///NOTE/// In the above command, do NOT use smbfs in Linux, use cifs, since cifs has better compatibility with MS windows file sharing. Clonezilla live will FAIL to save a correct image when you use smbfs!
If you want to use a terminal with Traditional Chinese support, run "tw-bterm"
Run "ocs-live" to use Clonezilla, then follow the on-screen instructions.
6. Accounts
In Clonezilla live, two accounts are available: (1) account "user" with sudo privilege, password is "live", (2) administration account "root", no password. Therefore you can not login as root, the only way to get root privilege is to login as user, and run "sudo su -" to become root. Note, for old clonezilla live (naming is clonezilla-live-2007XXXX), root's password is "drbllive".
For better security, it is recommended to change the passwords of user and root by command "passwd" before you allow remote access.
When Clonezilla live boots, the ssh service is NOT automatically started, and the setting in /etc/hosts.deny does NOT block any connection. If you want to remotely ssh login into your Clonezilla live, you have to start ssh service by "/etc/init.d/ssh start".
Mode 1: Create your own recovery CD or USB flash drive:
First, use the prebuild Clonezilla live to save an Clonezilla image, or you can save the image on DRBL/Clonezilla server). Once the image is ready, you can create your own recovery CD/USB flash drive:
To create a Clonezilla Live ISO file with a built-in image used to restore. For example, let's say you want to create a CD/DVD ISO file in which an existing image "sarge-image" will be inserted in. If you use Clonezilla live to boot into shell mode, you have to mount the clonezilla image home (maybe source is from ssh server, nfs server or samba server) as /home/partimag first, and run "cd /home/partimag" to change working dir so that you have a writable dir later. If you are using Clonezilla server, the clonezilla images normally already exist in the directory /home/partimag. Now you can run the following to create a Clonezilla live iso file:
/opt/drbl/sbin/ocs-iso sarge-image
This command will create the ISO file clonezilla-live-sarge-image.iso which can then be burned to a CD or DVD.
If you want to create an ISO file with built-in pre-settings, such as keyboard layout, so that it can run in batch mode, you can create it like:
In this command, the clonezilla image "sarge-image" will be put into the ISO file. When you put the ISO in the CD/DVD and boot the CD/DVD, it will run in batch mode (-t), in English environment (-g en_US.UTF-8), do NOT change the keyboard layout (-k NONE), and ocs-sr will run with parameters "-g auto -b -c restoredisk sarge-image hda" to restore image "sarge-image" into disk hda (-e "-g auto -b -c restoredisk sarge-image hda"). The parameters used in "-e" will be run by ocs-sr when cloning, so you can run "/opt/drbl/sbin/ocs-sr --help" to check all of them. The above command will create an ISO file "clonezilla-live-sarge-image.iso", and it will allow you to boot and run in batch mode.
If you need to insert more than one image, run the following command:
/opt/drbl/sbin/ocs-iso sarge-image etch-image
///Note/// Due to the limitations of program mkisofs , ocs-iso can not process an image file larger than 4.5 GB. For this reason, if your image is larger than 4.5 GB, ocs-iso will refuse to process it.
For more parameters of ocs-iso, run "/opt/drbl/sbin/ocs-iso --help".
To create Clonezilla Live in an USB flash drive with image built-in. For example, you want to create a USB flash drive in which an image sarge-image existing in the Clonezilla server will be inserted:
Insert your USB flash drive into the USB port on your Clonezilla server and wait a few seconds. Next, run the command "dmesg" to query the device name of the USB flash drive. Let's say, for example, that you find it is /dev/sdb1. If GNU/Linux mounts the USB flash drive automatically, you must unmount it. You can run "df -h" to check to see if it was mounted automatically and, if it was, run something like "unmount /dev/sdb1" to unmount it or you can use your mouse to right-click on the device to unmount it in Gnome/KDE.
The USB flash drive partition must be formatted. If it is not, for example, for /dev/sdb1, you can run:
mkfs.vfat -F 32 /dev/sdb1
or
mkfs.ext3 /dev/sdb1
to format it.
WARNING!!! The above command will delete all existing data in your device! Be sure to backup important data first. Also, be aware that any typo could cause your server not to boot or cause data loss.
WARNING!!! Make sure the device name /dev/XXX is the one you want. An incorrect device name could cause you to lose data in your server.
Taking the above steps will create a bootable Clonezilla Live USB flash drive with image sarge-image built-in. For more ocs-live-dev parameters, run "/opt/drbl/sbin/ocs-live-dev --help".
If you want to create a batch-mode Clonezilla live usb flash drive, such as. pre-set the keyboard layout, so that it can be used to boot and run in unattended mode, you can create it like:
WARNING!!! Make sure the device name /dev/XXX is the one you want. An incorrect device name could cause you to lose data in your server.
In the above command, the clonezilla image "sarge-image" will be put in the USB flash drive. This USB flash drive will boot and run in batch mode (-t), in English environment (-g en_US.UTF-8), do NOT change the keyboard layout (-k NONE), and ocs-sr will run with parameters "-g auto -b -c restoredisk sarge-image hda" to restore image "sarge-image" into disk hda (-e "-g auto -b -c restoredisk sarge-image hda"). The parameters used in "-e" will be run by ocs-sr when cloning, so you can run "/opt/drbl/sbin/ocs-sr --help" to check all of them. The above command will create an USB flash drive, and it will allow you to boot and run in batch mode.
Video about the process to use a recovery CD to restore an image: In this video, you will be prompted with a menu that lets you restore the image when using the Clonezilla Live with image built-in. Here is a video that shows how to do this. Click to play it (Flash Player plugin required) or you can download this mpeg4 file to watch it. To save disk space and bandwidth, we skipped the duplicate frames. This also enables the video to play more quickly.
Mode 2: Use your own script and run it on clonezilla live.
You can write a script, say "custom-ocs", to do that. A sample script file /opt/drbl/samples/custom-ocs, which allows user to use clonezilla live to choose (1) backup the image of /dev/hda1 (or /dev/sda1) to /dev/hda5 (or /dev/sda5) (2) restore image in /dev/hda5 (or /dev/sda5) to /dev/hda1 (or /dev/sda1), can be found when you are running clonezilla live (version 1.0.3-20 or later) or in DRBL server (version 1.7.12-1 or later).
In the above examples, "-g en_US.UTF-8" means the language will be English, "-k NONE" means won't change the keyboard layout (default is US keyboard).
For other options, please run "/opt/drbl/sbin/ocs-iso -h" or "/opt/drbl/sbin/ocs-live-dev -h" to get more info.
8. Acknowledgment
The authors would like to thank Mr. Jr-Jung Lin from Taipei County, Mr. Wei-Ji Hsiao from Huallien County and all others who helped put together this project for their time, effort, contribution and input.