ocs-sr(8)

πŸ“¦ version 5.19.7, in arch rolling, ubuntu stonking

πŸ’– ocs-sr β€” the Clonezilla main character πŸ’–

okay bestie, gather round, because this is the big one. we're talking ocs-sr, straight out of the Clonezilla Manual (section 8, for all my fellow nerds who care about that kind of thing). she's the main command, the moment, the whole entire vibe. πŸŽ€


✨ NAME ✨

ocs-sr β€” Clonezilla: save or restore a disk or partition(s) 🫢


✨ SYNOPSIS ✨

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

✨ DESCRIPTION ✨

so like. ocs-sr is THE main command of Clonezilla β€” the queen bee πŸ‘‘ β€” and what she does is save or restore a disk or partition(s). that's it, that's the job.

where do you usually find her? living her best life in Clonezilla live</> or hanging out in a DRBL environment. iykyk. πŸ’…


✨ COMMANDS ✨

you gotta pick one of these four besties before you do literally anything else. choose wisely ok? 😭

  • savedisk β€” saves the entire disk(s) as an image. the whole thing. all of it. no crumbs left behind. πŸ”₯
  • saveparts β€” saves the partition(s) as an image. tiny slice energy, but make it iconic. ✨
  • restoredisk β€” restores the image back onto the entire disk(s). put it back where it came from, periodt. πŸ’–
  • restoreparts β€” restores the image back onto the partition(s). the comeback tour we've all been waiting for. 🌸

✨ OPTIONS ✨

Bestie, this is the big one. Every single knob, dial, and secret switch ocs-sr(8) hands you. They come in three flavours: saving, restoring, and general. Buckle up, it's giving very much "menu at a fancy restaurant but the waiter knows every dish personally" πŸ’–


πŸ’Ύ Options for saving

  • -noabo, --not-only-access-by-owner β€” makes the partition image readable by other people too (mode 644). default is 600, aka owner-eyes-only energy πŸ”’.
  • -senc, --skip-enc-ocs-img β€” skips encrypting the image with a passphrase. no passphrase, no problem.
  • -enc, --enc-ocs-img β€” encrypts the image with a passphrase, using ecryptfs. spicy πŸ”₯.
  • -sgoc, --skip-gocrypt-ocs-img β€” skips encrypting the image with a passphrase, but for the gocryptfs flavour.
  • -goc, --gocrypt-ocs-img β€” encrypts the image with a passphrase, this time via gocryptfs.
  • -sfsck, --skip-fsck-src-part β€” don't bother running fsck on the source file system before saving it. just yolo it.
  • -fsck, -fsck-src-part, --fsck-src-part β€” runs fsck interactively on the source file system before saving. it will literally ask you things, so pay attention πŸ‘€.
  • -fsck-y, -fsck-src-part-y, --fsck-src-part-y β€” runs fsck automatically on the source file system before saving, and attempts to fix any detected filesystem corruption on its own. hands-off, auto-mode, slay.
  • -gm, --gen-md5sum β€” generates the MD5 checksum for the image.
  • -gs, --gen-sha1sum β€” generates the SHA1 checksum for the image.
  • -gb2, -gb, --gen-b2sum β€” generates the BLAKE2 checksum for the image.
  • -gb3, --gen-b3sum β€” generates the BLAKE3 checksum for the image.
  • -gmf, --gen-chksum-for-files-in-dev β€” generates the checksum for the files sitting in the source device.
  • -i, --image-size SIZE β€” set the size in MB that the partition image file gets chopped into, so it splits across multiple volume files. slice it 🍰.
  • -j2, --clone-hidden-data β€” uses dd to clone the image of the data slotted between the MBR (1st sector) and the 1st partition.
  • -ntfs-ok, --ntfs-ok β€” assumes the NTFS integrity is OK and does NOT check again (this one's for ntfsclone only).
  • -rm-win-swap-hib, --rm-win-swap-hib β€” tries to remove the MS Windows swap file and hibernation file from the source partition. spring cleaning, Windows edition 🧹.
  • -q, --use-ntfsclone β€” uses ntfsclone to save the NTFS partition. priority order: ntfsclone > partimage > dd.
  • -q1, --force-to-use-dd β€” forces using dd to save partition(s). it's inefficient and slow, but it works for all file systems. the reliable chaotic friend.
  • -q2, --use-partclone β€” uses partclone to save partition(s). priority order: partclone > partimage > dd.
  • -rescue, --rescue β€” turns on rescue mode, meaning it'll try to skip bad sectors. main character energy in a crisis.
  • -sc, -scs, --skip-check-restorable, --skip-check-restorable-s β€” skips checking whether the image is restorable after it's been created. faith-based vibes ✨.
  • -z0, --no-compress β€” no compression when saving. raw. unfiltered.
  • -z1, --gzip-compress β€” compresses with gzip (this is the default, btw).
  • -z1p, --smp-gzip-compress β€” compresses with the parallel gzip program, pigz.
  • -z2, --bz2-compress β€” compresses with bzip2.
  • -z2p, --smp-bzip2-compress β€” compresses with the parallel bzip2 program, lbzip2.
  • -z3, --lzo-compress β€” compresses with lzop.
  • -z4, --lzma-compress β€” compresses with lzma.
  • -z5, --xz-compress β€” compresses with xz.
  • -z5p, --smp-xz-compress β€” compresses with parallel xz.
  • -z6, --lzip-compress β€” compresses with lzip.
  • -z6p, --smp-lzip-compress β€” compresses with parallel lzip.
  • -z7, --lrzip-compress β€” compresses with lrzip.
  • -z8, --lz4-compress β€” compresses with lz4.
  • -z8p, --lz4mt-compress β€” compresses with multi-threaded lz4.
  • -z9, --zstd-compress β€” compresses with zstd.
  • -z9p, --zstdmt-compress β€” compresses with parallel zstd (zstdmt).
  • -sfs, --skip-fs-save β€” do not save the file system for the device, just save the rest of the files.
  • -pe, --passwd-ecryptfs PASSWD β€” sets the password used to encrypt the image (ecryptfs).
  • -pfe, --passwd-file-ecryptfs FILE β€” sets the password used to encrypt the image, by pulling it out of FILE (ecryptfs).
  • -pg, --passwd-gocryptfs PASSWD β€” sets the password used to encrypt the image (gocryptfs).
  • -pfg, --passwd-file-gocryptfs FILE β€” sets the password used to encrypt the image, by reading it from FILE (gocryptfs).
  • -plu, --put-log-files-usb β€” puts the Clonezilla live related log files onto the Clonezilla live USB drive.
  • -scpt, --skip-check-part-table β€” skips checking the partition table of the source disk.
  • *-luks, --enable-luks *MODE β€” opens the LUKS device, or not. MODE can be either yes or no.
  • *-dblk, --decrypt-bitlocker *MODE β€” decrypts the BitLocker device, or not. MODE can be either yes or no.

πŸ”„ Options for restoring

  • *-f, --from-part *PARTITION β€” restores the partition from an image or block device over to a different partition.
  • *-g, --grub-install *GRUB_PARTITION β€” installs grub in the MBR. GRUB_PARTITION can be "auto" or a device name.
  • -r, --resize-partition β€” resizes the partition to fit the target partition size.
  • -k, --no-fdisk, --no-create-partition β€” do NOT create a partition table on the target harddisk.
  • -icrc β€” skips Partclone CRC checking.
  • -irhr β€” skips removing the Linux udev hardware records on the restored GNU/Linux.
  • -irvd β€” skips removing the NTFS volume dirty flag after restoration.
  • -ius β€” skips updating syslinux-related files on the restored GNU/Linux.
  • -iui β€” skips updating initramfs file(s) on the restored GNU/Linux.
  • -icds, --ignore-chk-dsk-size-pt β€” skips checking the destination disk size before creating the partition table.
  • -iefi, --ignore-update-efi-nvram β€” skips updating boot entries in EFI NVRAM after restoring.
  • -k0 β€” creates the partition table based on the partition table from the image (this is the default).
  • -k1 β€” creates the partition table in the target disk proportionally.
  • -k2 β€” drops you into a command line prompt so you can create the partition table manually before restoring. DIY era.
  • -scr, --skip-check-restorable-r β€” skips checking whether the image is restorable before restoring.
  • -t, --no-restore-mbr β€” do NOT restore the MBR.
  • -t1, --restore-raw-mbr β€” restores the prebuilt bootloader from syslinux (Windows only).
  • -t2, --no-restore-ebr β€” do NOT restore the EBR.
  • -u, --select-img-in-client β€” input the image name in clients.
  • -e, --load-geometry β€” forces using the saved CHS (cylinders, heads, sectors).
  • *-e1, --change-geometry *NTFS-BOOT-PARTITION β€” forces a change to the CHS value of the NTFS boot partition after the image is restored.
  • -e2, --load-geometry-from-edd β€” forces using the CHS from EDD (Enhanced Disk Device).
  • -j, --create-part-by-sfdisk β€” uses sfdisk to create the partition table (default, bb).
  • -j0, --create-part-by-dd β€” uses dd to dump the partition table from the saved image instead of using sfdisk.
  • -j1, --dump-mbr-in-the-end β€” uses dd to dump the MBR after the disk image has been restored.
  • -j2, --clone-hidden-data β€” uses dd to clone data between the MBR and the 1st partition (restoredisk mode only).
  • *-hn0 *PREFIX β€” changes the hostname of MS Windows based on PREFIX-IP.
  • *-hn1 *PREFIX β€” changes the hostname of MS Windows based on PREFIX-MAC.
  • *--max-time-to-wait *TIME β€” when not enough clients have connected, it starts anyways after TIME seconds. impatient icon behaviour ⏰.
  • -cm, --check-md5sum β€” checks the MD5 checksum for the image.
  • -cs, --check-sha1sum β€” checks the SHA1 checksum for the image.
  • -cb2, -cb, --check-b2sum β€” checks the BLAKE2 checksum for the image.
  • -cb3, --check-b3sum β€” checks the BLAKE3 checksum for the image.
  • -cmf, --chk-chksum-for-files-in-dev β€” checks the checksum for the files in the device.
  • -srel, --save-restore-error-log β€” saves the error log file in the image dir.
  • *--mcast-port *NO β€” assigns the udp port number for multicast restore.
  • -ssnf, --skip-set-netboot-first β€” skips setting the 1st boot device as network in uEFI NVRAM.

πŸŽ€ General options

  • *-l, --language *INDEX β€” sets the language to be shown, by index number (e.g., 0 or en_US.UTF-8).
  • -b, -batch, --batch β€” runs the program in batch mode. dangerous! like, genuinely, bestie.
  • -c, --confirm β€” waits for confirmation before saving or restoring.
  • -d, --debug-mode β€” enters command mode to debug.
  • *--debug=LEVEL* β€” outputs the partimage debug log in directory /var/log/ with debug LEVEL.
  • *-m, --module *MODULE β€” forces loading kernel module MODULE.
  • --use-netcat β€” uses netcat instead of nuttcp for network clone.
  • *--net-filter *PROGRAM β€” uses PROGRAM (gzip, bzip2, xz, lz4, zstd, cat) as the network filter.
  • -o0, --run-prerun-dir β€” runs the script in the prerun directory before the clone is started.
  • -o1, -o, --run-postrun-dir β€” runs the script in the postrun directory when the clone is finished.
  • *-w, --wait-time *TIME β€” waits for TIME seconds before saving/restoring.
  • -nogui, --nogui β€” doesn't show the GUI (TUI), text only. minimalism periodt.
  • -a, --no-force-dma-on β€” doesn't force turning on HD DMA.
  • *-mp, --mount-point *MOUNT_POINT β€” uses NFS to mount MOUNT_POINT as directory ocsroot.
  • *-or, --ocsroot *DIR β€” specifies DIR (an absolute path) as directory ocsroot.
  • *-p, --postaction *ACTION β€” the action taken when finished: [choose|poweroff|reboot|command|CMD].
  • -ps, --play-sound β€” plays a sound when the job is done. 🎡 iconic.
  • -ns, --ntfs-progress-in-image-dir β€” saves the ntfsclone progress tmp file in the image dir.
  • *-s, --source-IP *IPADD β€” assigns the IP address of the source machine for device to device cloning.
  • -bm, --beginner-mode β€” runs in beginner mode.
  • -em, --expert-mode β€” runs in expert mode.
  • -um, --user-mode [beginner|expert] β€” specifies the user mode.
  • -edio, --enable-direct-io β€” enables the direct IO mode of Partclone for NVMe SSD.
  • -smtd, --save-mtdblock β€” saves MTD block device.
  • -smmcb, --save-mmcblk β€” saves eMMC boot device.
  • -rmtd, --restore-mtdblock β€” restores MTD block device.
  • -rmmcb, --restore-mmcblk β€” restores eMMC boot device.
  • -uoab, --use-ocs-alias-blkdev β€” uses the Clonezilla alias block device name (e.g., ocs-*d*).
  • -reluks, --reencrypt-luks β€” reencrypts LUKS encrypted volumes in-place.
  • -v, --verbose β€” prints verbose information. the "tell me everything" button πŸ—£οΈ.
  • -d0, --dialog β€” uses dialog.
  • -d1, --Xdialog β€” uses Xdialog.
  • -d2, --whiptail β€” uses whiptail.
  • -d3, --gdialog β€” uses gdialog.
  • -d4, --kdialog β€” uses kdialog.
  • -x, --interactive β€” interactive mode.
  • *-os, --ocs-server *SRV β€” assigns the OCS server as SRV.

✨ RESERVED WORDS ✨

okay so some arguments are ✨magic✨ β€” if you type these exact words in these exact spots, ocs-sr does something cute instead of treating them like a literal name. reserved words bestie, they hit different πŸ’…

πŸ’– For IMAGE_NAME:

  • ask_user β€” it literally just stops and asks you to type a name in. very "your turn, babes" energy πŸŽ€
  • autoname β€” auto-generates the image name from the MAC address and the time. no thoughts, just vibes and timestamps ⏰
  • autohostname β€” auto-generates the image name from the hostname. it's giving "name it after yourself" πŸ’β€β™€οΈ
  • autoproductname β€” auto-generates the image name from the hardware product model. yes it read your machine's birth chart 🌸

πŸ¦‹ For DEVICE:

  • ask_user β€” prompts you to pick which source device you want. choose your fighter ✨
  • all β€” selects all unmounted local disks or partitions. only unmounted ones though β€” do not come for me if you forgot to unmount, that's not my fault 😭

🌈 EXAMPLES 🌈

the moment you've all been waiting for, the demo reel, the main character era πŸ‘‘


1. save every last crumb of data on the local 1st hard drive sda as an image called IMAGE1, using ntfsclone and lzop compression:

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

2. save the data from the 1st and 2nd partition on the local first hard drive sda as an image called IMAGE2, using ntfsclone:

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

3. restore IMAGE1 back onto local sda, and grub-install gets run after the cloning is done:

ocs-sr -g auto restoredisk IMAGE1 sda

4. restore the image holding the 1st and 2nd partition from IMAGE2 onto local sda1 and sda2, and again grub-install runs after restoring:

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

5. save disk(s)/partition(s) as an image, or restore an image back to disk(s)/partition(s), interactively β€” aka let the menu hold your hand 🫢:

ocs-sr -x

πŸ“ FILES πŸ“

  • /etc/drbl/drbl-ocs.conf β€” the configuration file for Clonezilla. all the settings live here, it's the little home base 🏠

πŸ‘€ SEE ALSO πŸ‘€

go read those too, i know you want to πŸ“š


πŸ’œ AUTHORS πŸ’œ

  • Steven Shiau <steven _at_ clonezilla org> β€” the icon, the legend, the moment πŸ‘‘

aaaand that's the whole page bestie, you made it to the end, so proud of you πŸ₯ΉπŸŒΈ this was Clonezilla, dated 2026-05-03, filed under section ocs-sr(8) β€” go clone something responsibly, love u, bye πŸ’–βœ¨πŸ¦‹

πŸ“¦ where this page comes from