| ocs-onthefly(8) | Clonezilla Manual | ocs-onthefly(8) |
NAME
ocs-onthefly - Clonezilla: on-the-fly disk or partition(s) cloning
SYNOPSIS
ocs-onthefly [OPTION]
DESCRIPTION
ocs-onthefly is used for "disk to disk" or "partition to partition" clone on-the-fly, either locally or over the network.
OPTIONS
- -b, -batch, --batch, --batch-mode
- Run program in batch mode (dangerous!), i.e., without any prompt or wait for confirmation.
- -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 (e.g., /dev/sdb or sdb).
- -e1, --change-geometry NTFS-BOOT-PARTITION
- Force to change the CHS (cylinders, heads, sectors) value of NTFS boot partition after cloning. NTFS-BOOT-PARTITION can be "auto" or a device name.
- -e2, --load-geometry-from-edd
- Force to use the CHS 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.
- -f, --source DEV
- Specify the source device as DEV (e.g., /dev/sda or sda).
- -g, --grub-install GRUB_PARTITION
- Install grub in the MBR. GRUB_PARTITION can be "auto" or a device name.
- --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). Default is zstd.
- -nogui, --nogui
- Do not show GUI (TUI), 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.
- -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 source (default).
- -k1
- Create partition table in the target disk proportionally.
- -k2
- Enter command line prompt to create partition table manually before cloning.
- -j2, --clone-hidden-data
- Use dd to clone the image of the data between MBR (1st sector) and 1st partition.
- -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.
- -q1, --force-to-use-dd
- Force to use sector-by-sector copy (slow but works for all filesystems).
- -po, --port PORT
- Specify the netcat port (only in network clone mode).
- -p, -pa, --postaction ACTION
- Action when cloning finishes: [choose|poweroff|reboot|true|CMD].
- -a, --server
- Specify the running machine is the 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.
- -t1, --restore-raw-mbr
- Restore the prebuilt bootloader from syslinux (For Windows only).
- -t2, --no-restore-ebr
- Do NOT restore the EBR.
- -v, --verbose
- Prints verbose information.
- -np, --net-pipe PROGRAM
- Use PROGRAM as network pipe program. Available: netcat, nuttcp.
- -x, --interactive
- Interactive mode.
- -bm, --beginner-mode
- Run in beginner mode (shortcut for "-um beginner").
- -em, --expert-mode
- Run in expert mode (shortcut for "-um expert").
- -um, --user-mode [beginner|expert]
- Specify the user mode.
- -edio, --enable-direct-io
- Enable the direct IO mode of Partclone for NVMe SSD.
EXAMPLES
1. To clone local sda to local sdb:
- ocs-onthefly -f sda -d sdb
2. To clone sda from machine A (IP 192.168.100.1) to sda on machine B via network:
On machine A:
- ocs-onthefly -a -f sda
On machine B:
- ocs-onthefly -s 192.168.100.1 -d sda
FILES
- /etc/drbl/drbl-ocs.conf
- The configuration file for Clonezilla.
SEE ALSO
AUTHORS
Steven Shiau <steven _at_ clonezilla org>
| 2026-05-03 | Clonezilla |