ocs-sr(8) Clonezilla Manual ocs-sr(8)

ocs-sr - Clonezilla: save or restore a disk or partition(s)

ocs-sr [OPTION] {savedisk|saveparts|restoredisk|restoreparts} IMAGE_NAME DEVICE

ocs-sr is the main command of Clonezilla to save or restore a disk or partition(s). It is usually used in Clonezilla live or in a DRBL environment.

Save the entire disk(s) as an image.
Save the partition(s) as an image.
Restore the image to the entire disk(s).
Restore the image to the partition(s).

Make the image of partition accessible by others (mode 644). Default is 600.
Skip encrypting the image with passphrase.
Encrypt the image with passphrase via ecryptfs.
Skip encrypting the image with passphrase (gocryptfs).
Encrypt the image with passphrase via gocryptfs.
Skip running fsck on the source file system before saving it.
Run fsck interactively on the source file system before saving it.
Run fsck automatically on the source file system before saving it. Attempt to fix any detected filesystem corruption automatically.
Generate the MD5 checksum for the image.
Generate the SHA1 checksum for the image.
Generate the BLAKE2 checksum for the image.
Generate the BLAKE3 checksum for the image.
Generate the checksum for files in the source device.
Set the size in MB to split the partition image file into multiple volumes files.
Use dd to clone the image of the data between MBR (1st sector) and 1st partition.
Assume the NTFS integrity is OK, do NOT check again (for ntfsclone only).
Try to remove the MS windows swap file and hibernation file in the source partition.
Use ntfsclone to save NTFS partition (Priority: ntfsclone > partimage > dd).
Force to use dd to save partition(s) (inefficient, slow, but works for all file systems).
Use partclone to save partition(s) (Priority: partclone > partimage > dd).
Turn on rescue mode, i.e. try to skip bad sectors.
Skip checking if the image is restorable after it is created.
Don't compress when saving.
Compress using gzip (default).
Compress using parallel gzip program (pigz).
Compress using bzip2.
Compress using parallel bzip2 program (lbzip2).
Compress using lzop.
Compress using lzma.
Compress using xz.
Compress using parallel xz.
Compress using lzip.
Compress using parallel lzip.
Compress using lrzip.
Compress using lz4.
Compress using multi-threaded lz4.
Compress using zstd.
Compress using parallel zstd (zstdmt).
Do not save the file system for device, just save the rest of files.
Set the password to encrypt the image (ecryptfs).
Set the password to encrypt the image in the FILE (ecryptfs).
Set the password to encrypt the image (gocryptfs).
Set the password to encrypt the image in the FILE (gocryptfs).
Put Clonezilla live related log files to Clonezilla live USB drive.
Skip checking the partition table of the source disk.
Open LUKS device or not. MODE can be either yes or no.
Decrypt BitLocker device or not. MODE can be either yes or no.

Restore the partition from image or block device to a different partition.
Install grub in the MBR. GRUB_PARTITION can be "auto" or a device name.
Resize the partition to fit the target partition size.
Do NOT create partition table in target harddisk.
Skip Partclone CRC checking.
Skip removing the Linux udev hardware records on the restored GNU/Linux.
Skip removing the NTFS volume dirty flag after restoration.
Skip updating syslinux-related files on the restored GNU/Linux.
Skip updating initramfs file(s) on the restored GNU/Linux.
Skip checking destination disk size before creating the partition table.
Skip updating boot entries in EFI NVRAM after restoring.
Create partition table based on the partition table from the image (default).
Create partition table in the target disk proportionally.
Enter command line prompt to create partition table manually before restoring.
Skip checking the image if restorable before restoring.
Do NOT restore the MBR.
Restore the prebuilt bootloader from syslinux (For Windows only).
Do NOT restore the EBR.
Input the image name in clients.
Force to use the saved CHS (cylinders, heads, sectors).
Force to change the CHS value of NTFS boot partition after image is restored.
Force to use the CHS from EDD (Enhanced Disk Device).
Use sfdisk to create partition table (default).
Use dd to dump the partition table from saved image instead of sfdisk.
Use dd to dump the MBR after disk image was restored.
Use dd to clone data between MBR and 1st partition (restoredisk mode only).
Change the hostname of MS Windows based on PREFIX-IP.
Change the hostname of MS Windows based on PREFIX-MAC.
When not enough clients have connected, start anyways after TIME seconds.
Check the MD5 checksum for the image.
Check the SHA1 checksum for the image.
Check the BLAKE2 checksum for the image.
Check the BLAKE3 checksum for the image.
Check the checksum for the files in the device.
Save the error log file in the image dir.
Assign the udp port number for multicast restore.
Skip setting 1st boot device as network in uEFI NVRAM.

Set the language to be shown by index number (e.g., 0 or en_US.UTF-8).
Run program in batch mode (dangerous!).
Wait for confirmation before saving or restoring.
Enter command mode to debug.
Output the partimage debug log in directory /var/log/ with debug LEVEL.
Force to load kernel module MODULE.
Use netcat instead of nuttcp for network clone.
Use PROGRAM (gzip, bzip2, xz, lz4, zstd, cat) as network filter.
Run the script in prerun directory before clone is started.
Run the script in postrun directory when clone is finished.
Wait for TIME seconds before saving/restoring.
Do not show GUI (TUI), use text only.
Do not force to turn on HD DMA.
Use NFS to mount MOUNT_POINT as directory ocsroot.
Specify DIR (absolute path) as directory ocsroot.
Action when finished: [choose|poweroff|reboot|command|CMD].
Play sound when the job is done.
Save the ntfsclone progress tmp file in the image dir.
Assign the IP address of source machine for device to device cloning.
Run in beginner mode.
Run in expert mode.
Specify the user mode.
Enable the direct IO mode of Partclone for NVMe SSD.
Save MTD block device.
Save eMMC boot device.
Restore MTD block device.
Restore eMMC boot device.
Use Clonezilla alias block device name (e.g., ocs-*d*).
Reencrypt LUKS encrypted volumes in-place.
Prints verbose information.
Use dialog.
Use Xdialog.
Use whiptail.
Use gdialog.
Use kdialog.
Interactive mode.
Assign the OCS server as SRV.

Prompt user to input a name.
Automatically generate image name based on MAC address and time.
Automatically generate image name based on hostname.
Automatically generate image name based on hardware product model.

Prompt user to select the source device.
Select all unmounted local disks or partitions.

To save all data in local 1st harddrive 'sda' as image 'IMAGE1', use ntfsclone, and lzop compression:

ocs-sr --use-ntfsclone -z3 savedisk IMAGE1 sda

To save the data in 1st and 2nd partition in local first harddrive 'sda' as image 'IMAGE2', use ntfsclone:

ocs-sr --use-ntfsclone -z3 saveparts IMAGE2 "sda1 sda2"

To restore image IMAGE1 to local sda, and grub-install will be run after cloning:

ocs-sr -g auto restoredisk IMAGE1 sda

To restore the image for the 1st and 2nd partition from IMAGE2 to local sda1 and sda2, and grub-install will be run after restoring:

ocs-sr -g auto restoreparts IMAGE2 "sda1 sda2"

To save disk(s)/partition(s) as an image or restore an image to disk(s)/partition(s) interactively, use:

ocs-sr -x

/etc/drbl/drbl-ocs.conf
The configuration file for Clonezilla.

drbl-ocs(8), ocs-onthefly(8)

Steven Shiau <steven _at_ clonezilla org>

2026-05-03 Clonezilla