Clonezilla

The Free and Open Source Software for Disk Imaging and Cloning
Misc

In this example: Misc doc
  1. The boot parameters for Clonezilla live

[Back to 'Clonezilla Live Doc']

  • The boot parameters for Clonezilla live     ^TOP^
  •  Kernel boot parameters are text strings which are interpreted by the system to change specific behaviors and enable or disable certain features. Different boot loaders use different config files for the boot parameters:
    1. For Clonezilla live booting from CD on a MBR machine, isolinux is the boot loader. Therefore the config file is /syslinux/isolinux.cfg.
    2. For Clonezilla live booting from USB flash drive on a MBR machine, syslinux is the boot loader. Therefore the config file is /syslinux/syslinux.cfg.
    3. For Clonezilla live booting from PXE on a MBR machine, pxelinux is the boot loader. The config file is on the PXE server, and is configured by the system administrator. it could be something like /tftpboot/nbi_img/pxelinux.cfg/default, or different file.
    4. For Clonezilla live booting from a uEFI machine, grub2 is used. Therefore the config file is /EFI/boot/grub.cfg.

    We now describe the kernel boot parameters related to Clonezilla live. If you want to modify the boot parameters, make sure you edit the right config file.

    Clonezilla live is based on Debian live with clonezilla installed. Therefore there are 2 kinds of boot parameters:

    1. Boot parameters from Debian live-boot and live-config. You can refer to the manual of live-boot and manual of live-config..
    2. Boot parameters specially for Clonezilla. All of them are named as "ocs_*", e.g. ocs_live_run, ocs_live_extra_param, ocs_live_batch.
      • ocs_live_run is intended for saving/restoring an image or cloning disk/partition. It is the main program to be run in Clonezilla live. Available program: ocs-live-general, ocs-live-restore or any command you write.
        e.g. ocs_live_run="ocs-live-general"
        //NOTE// You might have to use "sudo" command inside your own script, or you can assign it like: ocs_live_run="sudo bash /my-clonezilla"
      • ocs_live_extra_param will be used only when ocs_live_run=ocs-live-restore (not for ocs-live-general or any other), then it will be passed to ocs-sr. Therefore these parameters are actually those of ocs-sr.
        e.g. ocs_live_extra_param="--batch -c restoredisk sarge-r5 hda"
      • To preset the keyboard layout, use "keyboard-layouts" from live-config.
        e.g. keyboard-layouts=NONE (won't change the default layout, which is US keyboard)
        keyboard-layouts=fr (French keyboard)
        //NOTE// The ocs_live_keymap used in Clonezilla live 1.x is deprecated. The following description is only for reference.
        ocs_live_keymap is for keymap used in Clonezilla live. Man install-keymap for more details.
        e.g. ocs_live_keymap="NONE" (won't change the default layout)
        ocs_live_keymap="/usr/share/keymaps/i386/azerty/fr-latin9.kmap.gz" (French keyboard)
      • batch mode or not (yes/no), if no, will run interactively.
        e.g. ocs_live_batch="no"
      • To assign the image repository via URI (Uniform Resource Identifier), use "ocs_repository".
        URI supported in Clonezilla live:
        [dev|smb|ssh|nfs|nfs4|http|https]:[//[user:password@]host[:port]][/]path
        There are 5 types of repository can be assigned via "ocs_repository":
        • local device: dev:///dev/partition
        • nfs server: nfs|nfs4://host/path
        • samba server: smb://[domain;user:password@]host/path
        • ssh server: ssh://[user@]host[:port]/path (No password can be assigned in URI)
        • webdav server: http|https://host[:port]/path (No username and password can be assigned in URI)
        E.g.
        • ocs_repository="dev:///dev/sdf1"
        • ocs_repository="nfs://192.168.100.254/home/partimag/"
        • ocs_repository="nfs4://192.168.100.254/partimag/"
        • ocs_repository="smb://administrator:mypasswd@192.168.100.175/images/"
        • ocs_repository="smb://my_domain;jack:mypasswd@192.168.1.1:445/images/"
        • ocs_repository="ssh://jack@192.168.100.211/home/partimag/"
        • ocs_repository="http://192.168.100.180/share"
        Then when Clonezilla live boots, the image repository assigned by ocs_repository will be automatically mounted, and if authentication is required, it will prompt you.
        //NOTE//
        • Remember to set the network configuration either by the option "ocs_prerun" to run "dhclient" or the option "ip" if your image repository is a network repository.
        • You can also use "ocs_prerun" to use your own command to mount your image repository if you like, and that's more flexible if you want to assign more parameters for your mount command.
      • To fetch tarall/zip/sh files from http(s), ftp, tftp, and local URL then extract to /opt/ in the Clonezilla live environment, use "ocs_preload*", i.e.
        1. Type 1, fetch tarball/zip/shell script file:
          ocs_preload=[http|https|ftp|tftp|file]://[HOST_NAME_or_IP_ADD]/path/to/your_tarball_or_script
        2. Support file format: tar.gz, tgz, tar.bz2, tbz2, tar.xz, txz, zip, .sh
        3. Type 2, fetch files on a cifs/nfs directory using mount command:
          ocs_preload="mount -t cifs //YOUR_CIFS_SERVER/path/to/ /path/to/mounting_point"
          ocs_preload="mount -t nfs YOUR_CIFS_SERVER:/path/to/ /path/to/mounting_point"
          Support network file system: cifs (samba) and nfs2/3/4
          E.g. You can put the following in the boot parameter:
          • ocs_preload=tftp://192.168.100.254/my-custom.tgz
          • ocs_preload=http://192.168.200.254/my-custom.tar.xz
          • ocs_preload=file:///lib/live/mount/medium/my-custom.tar.bz2
          • ocs_preload=tftp://192.168.100.254/my-custom.sh
          • ocs_preload="mount -t cifs //192.168.120.2/images/ /tmp/cifs -o user=administrator,password=yourpasswd"
          • ocs_preload="mount -t nfs 192.168.120.254:/home/partimag/script/ /tmp/nfs -o ro"
          Multiple ocs_preload* are available, just append a number after that. E.g.
          ocs_prealod=... ocs_preload1=... ocs_preload2=...
          Then when Clonezilla live boots, the file assigned by ocs_preload will be downloaded and extracted to /opt. Its mode will be set automatically, too. i.e. set as mode 755 and Unix format script.
          //NOTE//
          • Remember to set the network configuration either by the option "ocs_prerun" to run "dhclient" or the option "ip" if your files are on the network repository.
          • You can also use "ocs_prerun" to use your own command to fetch your files and put in Clonezilla live environment if you like, and that's more flexible if you want to assign more parameters for your own command.
      • To preset the language, use "locales" from live-config.
        e.g. locales=en_US.UTF-8
        //NOTE// The "ocs_lang" used in Clonezilla live 1.x is deprecated.
      • To preset the font name and font size for KMS mode, use "ocs_fontface" and "ocs_fontsize".
        e.g. ocs_fontface="TerminusBold"
        ocs_fontsize="24x12"
        Check file /etc/default/console-setup and the console-setup(5) manual page on Debian or Ubuntu system.
      • ocs_debug (or ocs-debug) is for you to enter command line prompt before any clonezilla-related action is run. This is easier for you to debug.
      • ocs_daemonon, ocs_daemonoff, ocs_numlk, ocs_capslk.
        Ex. for the first 2 parameters, ocs_daemonon="ssh", then ssh service will be turned on when booting. For the last 2 parameters, use "on" or "off", e.g. ocs_numlk=on to turn on numberlock when booting.
      • ocs_prerun, ocs_prerun1, ocs_prerun2... is intended for running a command before an operation of saving/restoring an image or cloning disk/partition is started. E.g. ocs_prerun="df -h" (For running the system command "df -h", or ocs_prerun="/lib/live/mount/medium/myscript.sh" (For running the script myscript.sh in the root path of the live USB media or CD, i.e. after booting into Clonezilla live, the root path of live USB media or CD is mounted as /lib/live/mount/medium/). If you have more commands to run, you can assign them in the order: ocs_prerun=..., ocs_prerun1=..., ocs_prerun2=.... If more than 10 parameters, remember to use ocs_prerun01, ocs_prerun02..., ocs_prerun11 to make it in order.
      • ocs_postrun, ocs_postrun1, ocs_postrun2... is intended for running a command after an operation of saving/restoring an image or cloning disk/partition has been completed. E.g. ocs_postrun="/live/image/myscript.sh". If you have more commands to run, you can assign them in the order: ocs_postrun=..., ocs_postrun1=..., ocs_postrun2=.... If more than 10 parameters, remember to use ocs_postrun01, ocs_postrun02..., ocs_postrun11 to make it in order. //NOTE// If you use this parameter, remember not to use "-p reboot" or "-p poweroff" option of ocs-sr. Use "-p true" instead because if "-p reboot" or "-p poweroff" is used, it will reboot or shutdown the system before ocs_postrun related commands are executed. For more info, check this discussion.
      • echo_ocs_prerun and echo_ocs_postrun are used to echo the commands of prerun and postrun. By default the command assigned in ocs_prerun or ocs_postrun will be echoed. By using "no" the command won't be echoed. This is useful when you want to hide some commands.
        e.g. echo_ocs_prerun="no" (Will not show the commands assigned in boot parameter "ocs_prerun").
      • ocs_live_run_tty. This option allows you to specify the tty where $ocs_live_run is run. By default $ocs_live_run is run on /dev/tty1 only. If you want to make $ocs_live_run use on ttyS0, for example, use ocs_live_run_tty="/dev/ttyS0".
        //NOTE//
        • The kernel boot parameter "console" (e.g. console=ttyS0,38400n81) is for the GNU/Linux system, while ocs_live_run_tty is for $ocs_live_run. They are different. Therefore you can make GNU/Linux system output the messages on tty1, while make $ocs_live_run run on ttyS1 like: "console=tty1,38400n81 ocs_live_run_tty=/dev/ttyS1". To make all the output on serial console ttyS1, use: "console=ttyS1,38400n81 ocs_live_run_tty=/dev/ttyS1"
        • It's recommended to assign locales and keyboard-layouts in the boot parameters too.
      • ip, this option allows you to specify the network parameters for network card. In Clonezilla live a patched live-initramfs is used, which is different from the original live-initramfs so that you can assign DNS server, too. Its format is: ip=ethernet port,IP address, netmask, gateway, DNS. E.g. If you want to assing eth0 with IP address 10.0.100.1, netmask 255.255.255.0, gateway 10.0.100.254, DNS server 8.8.8.8, you can assign the following in the boot parameter:
        ip=eth0:10.0.100.1:255.255.255.0:10.0.100.254:8.8.8.8
        If more than one network card, you can use "," to separate them, e.g.:
        ip=eth0:10.0.100.1:255.255.255.0:10.0.100.254:8.8.8.8,eth1:192.168.120.1:255.255.255.0:192.168.120.254::
      • Besides, two parameters could be used to assign the network card for PXE booting, "live-netdev" (yes, not ocs_live_netdev) and "nicif" can be used when using PXE booting,
        1. For "live-netdev", you can force to assign the network device by its ethernet device name on GNU/Linux, e.g. eth0, eth1, to get filesystem.squashfs. This is useful when there are two or more NICs are linked. E.g. live-netdev="eth1" allows you to force the live-initramfs to use eth1 to fetch the root file system filesystem.squashfs.
        2. For "nicif", you can force to assign the network device by its MAC address, e.g. 00:aa:bb:cc:dd:ee, to get filesystem.squashfs. This is useful when there are two or more NICs are linked. E.g. nicif="00:aa:bb:cc:dd:ee", allows you to force the live-initramfs to use the ethernet card with MAC address "00:aa:bb:cc:dd:ee" to fetch the root file system filesystem.squashfs.

    You can find some examples about using these boot parameters in the Clonezilla Live Doc.



[Back to 'Clonezilla Live Doc']

Clonezilla project. All Rights Reserved. Anyone is permitted to copy and distribute verbatim copies of this document under the terms of the GNU FDL Free Documentation License.