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.
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
- Follow this doc to install the package drbl (deb or rpm).
- Remember to configure the network settings for all the network cards, as shown in this doc.
- 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.
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.
///NOTE///
- 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.
- If you want to replace another version of Clonezilla live, you can:
- Download Clonezilla live Here we take "clonezilla-live-3.2.0-2-amd64.iso" as an example.
- After "clonezilla-live-3.2.0-2-amd64.iso" is downloaded, in the dir where "clonezilla-live-3.2.0-2-amd64.iso" exists, run: "drbl-ocs-live-prep -i clonezilla-live-3.2.0-2-amd64.iso", then the Clonezilla SE will use clonezilla-live 20100921-lucid as the OS of clients when running Clonezilla job.
- The netboot file, i.e., PXE boot menu files /tftpboot/nbi_img/pxelinux.cfg/default (for legacy BIOS) and /tftpboot/nbi_img/grub/grub.cfg (for uEFI netboot) look like (for multicast restoring):
label Clonezilla-live
MENU DEFAULT
# MENU HIDE
MENU LABEL Clonezilla: multicast restore bookworm-efi-20240914 to disk nvme0n1
# MENU PASSWD
KERNEL Clonezilla-live-vmlinuz
APPEND initrd=Clonezilla-live-initrd.img boot=live union=overlay username=user config components loglevel=0 noswap edd=on nomodeset enforcing=0 locales=en_US.UTF-8 keyboard-layouts=us ocs_live_extra_param= ocs_live_batch=no net.ifnames=0 nosplash noeject netboot=nfs nfsroot=192.168.150.254:/tftpboot/node_root/clonezilla-live/ ocs_server="192.168.150.254" ocs_daemonon="ssh" ocs_prerun="mount -t nfs 192.168.150.254:/home/partimag /home/partimag/" ocs_live_run="ocs-sr -l en_US.UTF-8 -g auto -e1 auto -e2 -r --clone-hidden-data -k0 -p reboot -scr --mcast-port 2232 multicast_restoredisk bookworm-efi-20240914 nvme0n1"
TEXT HELP
Clonezilla Live 3.2.0-2-amd64 runs on RAM
ENDTEXT
menuentry "Clonezilla: multicast restore bookworm-efi-20240914 to disk nvme0n1" --id clonezilla-live-client {
# This is Clonezilla live especially to be run for Clonezilla SE.
# Do _NOT_ edit unless you know what you are doing!
echo "Enter Clonezilla Live 3.2.0-2-amd64 (Ramdisk)..."
echo 'Loading Clonezilla-live-vmlinuz...'
$linux_cmd Clonezilla-live-vmlinuz initrd=Clonezilla-live-initrd.img boot=live union=overlay username=user config components noswap edd=on nomodeset enforcing=0 locales=en_US.UTF-8 keyboard-layouts=us ocs_live_extra_param= ocs_live_batch=no net.ifnames=0 nosplash noeject netboot=nfs nfsroot=192.168.150.254:/tftpboot/node_root/clonezilla-live/ ocs_server="192.168.150.254" ocs_daemonon=\"ssh\" ocs_prerun=\"mount -t nfs 192.168.150.254:/home/partimag /home/partimag/\" ocs_live_run=\"ocs-sr -l en_US.UTF-8 -g auto -e1 auto -e2 -r --clone-hidden-data -k0 -p reboot -scr --mcast-port 2232 multicast_restoredisk bookworm-efi-20240914 nvme0n1\"
echo 'Loading initial ramdisk Clonezilla-live-initrd.img...'
$initrd_cmd Clonezilla-live-initrd.img
}
- 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.