ocs-sr(8)
π 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 (mode644). default is600, 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, usingecryptfs. spicy π₯.-sgoc,--skip-gocrypt-ocs-imgβ skips encrypting the image with a passphrase, but for thegocryptfsflavour.-goc,--gocrypt-ocs-imgβ encrypts the image with a passphrase, this time viagocryptfs.-sfsck,--skip-fsck-src-partβ don't bother runningfsckon the source file system before saving it. just yolo it.-fsck,-fsck-src-part,--fsck-src-partβ runsfsckinteractively 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β runsfsckautomatically 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-sizeSIZE β 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β usesddto 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 forntfscloneonly).-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β usesntfscloneto save the NTFS partition. priority order:ntfsclone>partimage>dd.-q1,--force-to-use-ddβ forces usingddto save partition(s). it's inefficient and slow, but it works for all file systems. the reliable chaotic friend.-q2,--use-partcloneβ usespartcloneto 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 withgzip(this is the default, btw).-z1p,--smp-gzip-compressβ compresses with the parallel gzip program,pigz.-z2,--bz2-compressβ compresses withbzip2.-z2p,--smp-bzip2-compressβ compresses with the parallel bzip2 program,lbzip2.-z3,--lzo-compressβ compresses withlzop.-z4,--lzma-compressβ compresses withlzma.-z5,--xz-compressβ compresses withxz.-z5p,--smp-xz-compressβ compresses with parallelxz.-z6,--lzip-compressβ compresses withlzip.-z6p,--smp-lzip-compressβ compresses with parallellzip.-z7,--lrzip-compressβ compresses withlrzip.-z8,--lz4-compressβ compresses withlz4.-z8p,--lz4mt-compressβ compresses with multi-threadedlz4.-z9,--zstd-compressβ compresses withzstd.-z9p,--zstdmt-compressβ compresses with parallelzstd(zstdmt).-sfs,--skip-fs-saveβ do not save the file system for the device, just save the rest of the files.-pe,--passwd-ecryptfsPASSWD β sets the password used to encrypt the image (ecryptfs).-pfe,--passwd-file-ecryptfsFILE β sets the password used to encrypt the image, by pulling it out of FILE (ecryptfs).-pg,--passwd-gocryptfsPASSWD β sets the password used to encrypt the image (gocryptfs).-pfg,--passwd-file-gocryptfsFILE β 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 eitheryesorno. - *
-dblk,--decrypt-bitlocker*MODE β decrypts the BitLocker device, or not. MODE can be eitheryesorno.
π 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β usessfdiskto create the partition table (default, bb).-j0,--create-part-by-ddβ usesddto dump the partition table from the saved image instead of usingsfdisk.-j1,--dump-mbr-in-the-endβ usesddto dump the MBR after the disk image has been restored.-j2,--clone-hidden-dataβ usesddto clone data between the MBR and the 1st partition (restorediskmode 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.,0oren_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 thepartimagedebug log in directory/var/log/with debug LEVEL. - *
-m,--module*MODULE β forces loading kernel module MODULE. --use-netcatβ usesnetcatinstead ofnuttcpfor 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 directoryocsroot. - *
-or,--ocsroot*DIR β specifies DIR (an absolute path) as directoryocsroot. - *
-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 thentfscloneprogress 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β usesdialog.-d1,--Xdialogβ usesXdialog.-d2,--whiptailβ useswhiptail.-d3,--gdialogβ usesgdialog.-d4,--kdialogβ useskdialog.-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 π
drbl-ocs(8)ocs-onthefly(8)
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
- arch rolling: clonezilla 5.19.7-1 Β· GPL-2.0-only
- ubuntu stonking: clonezilla 5.17.14-1 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms