Clonezilla

The Free and Open Source Software for Disk Imaging and Cloning
Step-by-step docs

Use Clonezilla Live as the OS of client in Clonezilla SE server

In DRBL environment you can use Clonezilla live as the OS of client to do the clone or image job. The pros for this are:

  • Only DHCP, tftp services are required for client to boot, and only 3 files are required for client to boot. Therefore it's very easy to upgrade that.
  • The files of server and the clients are decouplied. You do not have to upgrade the complete server if you only need some newer files for clients to boot.
  • The image repostiroy can be on different types of server, e.g. NFS, Samba, or ssh server.
  • More flexible. Clonezilla live provides a lot of boot parameters so that you can make use of them.
So how to do that:
Two methods are available. If you do not need the diskless function of DRBL, use the 1st method below. Otherwise, use the 2nd method:

Method 1: use "drbl4imp" command

  1. Follow this doc to install the package drbl (deb or rpm).
  2. Remember to configure the network settings for all the network cards, as shown in this doc.
  3. With pacakge drbl is installed, say, if you want to create a Clonezilla server, using i686 Clonezilla live as the OS of clients,each network card will provide Clonezilla service to 40 clients, you can run:

    drbl4imp -p 40 -r 1 -z 3 -u 1

    The options used here:
    • -p NO The client number in each NIC port will be NO at most.
    • -r [0|1|2] Assign DRBL mode (0: Full DRBL mode, 1: DRBL SSI mode, 2:Do NOT provide diskless Linux service to clients). Default value is 0.
    • -u [0|1|2] Assign the CPU mode for client when doing Clonezilla job with Clonezilla live (0: i486, 1: i686, 2: amd64). This option should be used with -z = 3.
    • -z [0|1|2|3] Assign Clonezilla mode (0: Full Clonezilla mode, 1: Clonezilla box mode, 2: Do NOT provide clonezilla service to clients, 3: Use Clonezilla live as the OS of clients). Default value is 0.
    For the available options of drbl4imp, run: "drbl4imp --help"

Method 2: use "drblsrv" and "drblpush" commands

  • If you want to use the verbose mode to setup the DRBL server, you can run "drblsrv -i" and "drblpush -i" and follow the instructions to configure it. When drblpush askes you about the clonezilla mode, choose "3" to "use Clonezilla live as the OS (Operating System) of clients", and you will have a chance to choose the client's CPU arch.
Once you finish one of the above method, you can use command "dcs" to enter clonezilla-start mode, or use "drbl-ocs" to do that...

///NOTE///
  1. If the image repository is on different server, you can edit "ocs_prerun_for_pxe_ocs_live" variable (e.g. make it like: ocs_prerun_for_pxe_ocs_live="mount -t nfs 192.168.200.254:/images /home/partimag/") in /etc/drbl/drbl-ocs.conf so that when dcs is run, it will be used to generate the boot parameter "ocs_prerun" in /tftpboot/nbi_img/pxelinux.cfg/default. Then when the client boots, it will automatically to mount the image repository.
  2. If you want to replace another version of Clonezilla live, you can:
    1. Download Clonezilla live (It must be version >= 1.2.5-15, 20100521-lucid). Here we take "clonezilla-live-20100921-lucid.iso" as an example.
    2. After "clonezilla-live-20100921-lucid.iso" is downloaded, in the dir where "clonezilla-live-20100921-lucid.iso" exists, run: "drbl-ocs-live-prep -i clonezilla-live-20100921-lucid.iso", then the Clonezilla SE will use clonezilla-live 20100921-lucid as the OS of clients when running Clonezilla job.
  3. The PXE boot menu looks like (for multicast restoring):

    label Clonezilla-live
    MENU DEFAULT
    # MENU HIDE
    MENU LABEL Clonezilla: multicast restore lucid-x86-release to disk sda
    # MENU PASSWD
    KERNEL Clonezilla-live-vmlinuz
    APPEND initrd=Clonezilla-live-initrd.img boot=live noswap nolocales edd=on ocs_live_extra_param="" keyboard-layouts=NONE ocs_live_batch="no" locales="en_US.UTF-8" ip=frommedia nosplash noprompt netboot=nfs nfsroot=192.168.120.254:/tftpboot/node_root/clonezilla-live/ ocs_server="192.168.120.254" ocs_daemonon="ssh" ocs_prerun="mount -t nfs 192.168.120.254:/home/partimag /home/partimag/" ocs_live_run="ocs-sr --language en --batch -g auto -e1 auto -e2 -r --clone-hidden-data -p reboot --max-time-to-wait 300 --mcast-port 2232 multicast_restoredisk lucid-x86-release sda"

    TEXT HELP
    Clonezilla Live 1.2.5-15-i686 runs on RAM
    ENDTEXT

  4. If you want to do the pre run commands, you can use the boot parameter ocs_prerun1="wget http://path-to-files/files -P /usr/share/drbl/prerun/ocs/" in the session tagged as "label Clonezilla-live" in /tftpboot/nbi_img/pxelinux.cfg/default for example, to download your script and put that in /usr/share/drbl/prerun/ocs/. Then use ocs_prerun2="chmod 755 /usr/share/drbl/prerun/ocs/*" for example, to change the mode of your programs.
    You can find more boot parameters here.