The Free and Open Source Software for Disk Imaging and Cloning
Clonezilla Live Doc
Print all this session
ocs related command manpages : Manual pages about Clonezilla related commands
  1. Man page of ocs-sr
  2. Man page of ocs-onthefly
Man page of ocs-onthefly

To run clonezilla on-the-fly:

ocs-onthefly [OPTION]


-b, -batch, --batch, --batch-mode (DANGEROUS!) Run program in batch mode, i.e. without any prompt or wait for pressing enter key. //NOTE// You have to use '-batch' instead of '-b' when you want to use it in the boot parameters. Otherwise the program init on system will honor '-b', too.

-cmf, --chk-chksum-for-files-in-dev Do the files checksum inspection for cloned files in destination devices.

-d, --destination, --target DEV Specify the target device as DEV (can be with or without /dev/, e.g., /dev/sda or sda, /dev/sda1 or sda1...)

-e1, --change-geometry NTFS-BOOT-PARTITION Force to change the CHS (cylinders, heads, sectors) value of NTFS boot partitoin after image is restored. NTFS-BOOT-PARTITION can be one of "/dev/sda1", "/dev/sda2"... or "auto" ("auto" will let clonezilla detect the NTFS boot partition automatically)

-e2, --load-geometry-from-edd Force to use the CHS (cylinders, heads, sectors) from EDD (Enhanced Disk Device) when creating partition table by sfdisk

-r, --resize-partition Resize the file system size to fit the partition size in the destination disk. It is normally used when when a small partition image is restored to a larger partition.

-f, --source DEV Specify the source device as DEV (can be with or without /dev/, e.g., /dev/sda or sda, /dev/sda1 or sda1...)

-g, --grub-install GRUB_PARTITION Install grub in the MBR of the disk containing partition GRUB_PARTITION with root grub directory in the same GRUB_PARTITION when restoration finishes, GRUB_PARTITION can be one of "/dev/sda1", "/dev/sda2"... or "auto" ("auto" will let clonezilla detect the grub root partition automatically). If "auto" is assigned, it will work if grub partition and root partition are not in the same partition.

--net-filter PROGRAM Use the PROGRAM (gzip/lzop/bzip2/xz/lz4/zstd/cat) before sending partition data to netcat/nuttcp (only in network clone mode). The default action is zstd. Use "cat" if you do not want to compress (Good for fast internode network).

-nogui, --nogui Do not show GUI (TUI) of Partclone or Partimage, use text only

-rescue, --rescue Turn on rescue mode, i.e. try to skip bad sectors.

-rvd, --rvd Remove the NTFS volume dirty flag in source NTFS file system before cloning it.

-irhr, --irhr Skip removing the Linux udev hardware records on the restored GNU/Linux.

-ius, --ius Skip updating syslinux-related files on the restored GNU/Linux.

-iui, --iui Skip updating initramfs file(s) on the restored GNU/Linux.

-icds, --ignore-chk-dsk-size-pt Skip checking destination disk size before creating the partition table on it. By default it will be checked and if the size is smaller than the source disk, quit.

-iefi, --ignore-update-efi-nvram Skip updating boot entries in EFI NVRAm after cloning.

-k, --no-sfdisk Do NOT create partition table in boot sector in target machine

-k0, Create partition table based on the partition table from the image. this is the same as as default. Just an option to let us explain the action easier.

-k1, Create partition table in the target disk proportionally.

-k2, Enter command line prompt to create partition table manually before restoring image.

-j2, --clone-hidden-data Use dd to clone the image of the data between MBR (1st sector, i.e. 512 bytes) and 1st partition, which might be useful for some recovery tool.

-m, --no-boot-loader-clone Do NOT clone boot loader

-o, --load-geometry Force to use the saved CHS (cylinders, heads, sectors) when using sfdisk in restoring.

-q1, --force-to-use-dd Force to use sector-by-sector copy (supports all filesystem, but inefficient). By default we will use partclone to clone a partition.

-po, --port PORT Specify the netcat port (Only in network clone mode)

-p, -pa, --postaction [choose|poweroff|reboot|true|CMD] When cloning job finishes, the action to be run, e.g. poweroff, reboot, enter command line prompt or run CMD you assign

-a, --server Specify the running machine is in network clone server.

-s, --source-IP IP Specify the source IP address (used in target client machine).

-t, --no-restore-mbr Do NOT restore the MBR (Mater Boot Record) when cloning. If this option is set, you must make sure there is an existing MBR in the current restored harddisk. Default is to restore.

-t1, --restore-raw-mbr Restores the prebuilt bootloader from syslinux (For Windows only)

-t2, --no-restore-ebr Do NOT restore the EBR (Extended Boot Record) when restoring image. Default is to restore

-v, --verbose Prints verbose information

-np --net-pipe PROGRAM Use PROGRAM as network pipe program. Available: netcat, nuttcp. Default is

-x, --interactive Interactive mode.

-bm, --beginner-mode Run in beginner mode. This is a short way for "-um beginner".

-em, --expert-mode Run in expert mode. This is a short way for "-um expert".

-um, --user-mode [beginner|expert] Specify the mode to use.


1. To clone local sda to local sdb, run

ocs-onthefly -f sda -d sdb

2. To clone sda (in machine A with IP to sda (in machine B) via network,

In machine A, boot it into DRBL client mode or boot on Clonezilla live, then run

ocs-onthefly -a -f sda

Then in machine B, boot it into DRBL client mode or boot on Clonezilla live, too. Then run

ocs-onthefly -s -d sda

Print this page
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.