Reference

partclone(8)

The utility for clone and restore a partition.

NAME

partclone - The utility for clone and restore a partition.

SYNOPSIS

partclone.[fstype] {[-c | --clone]} {[-r | --restore]} {[-b | --dev-to-dev]} {[-s | --source] source} {[[-o | --output] [-O | --overwrite]] target} [[-dX | --debug=X]] [[--restore_raw_file]] [[-z | --buffer_size]] [[-N | --ncurses]] [[-q | --quiet]] [[-f | --UI-fresh]] [[-F | --force]] [[-I | --ignore_fschk]] [[-i | --ignore_crc]] [[-C | --nocheck]] [[-R | --rescue]] [[-L | --logfile] logfile] [[-X | --compresscmd]] [[-D | --domain]] [[--offset_domain]] [[-aX | --checksum-mode=X]] [[-kX | --blocks-per-checksum=X]] [[-K | --no-reseed]] [[-w | --skip_write_error]] [[-E | --offset=X]] [[-T | --btfiles]] [[-t | --btfiles_torrent]] [[-n | --note]] [[-B | --no_block_detail]] [[--binary-prefix]] [[--prog-second]] [[--json-status] FILE] [[--json-fresh] N] [[--write-direct-io]] [[--read-direct-io]]

DESCRIPTION

partclone.[fstype] is a part of Partclone project. Partclone provide utilities to backup used blocks and design for higher compatibility of the file system by using existing library, e.g. e2fslibs is used to read the used block of ext2 partition.

Partclone supported file system include btrfs, ext2, ext3, ext4, reiserfs, reiser4, xfs, jfs and zfs for LINUX. Also support some non-linux operation system, ex: NTFS, FAT and EXFAT (for Windows), HFS plus (APPLE MAC OS), UFS2 (FreeBSD), VMFS (VMWare Vsphere) and MINIX (MINIX3).

All partclone utils could be run like partclone.[fstype] is very similar to fsck or mkfs. For example, for backup/restore hfsplus, just run partclone.hfsp

       File System                 partclone.[fstype]
       btrfs                       partclone.btrfs
       ext2, ext3, ext4            partclone.[ext2 | ext3 | ext4]
       reiserfs 3.5                partclone.reiserfs
       reiser 4                    partclone.reiser4
       xfs                         partclone.xfs
       ufs | ufs2                  partclone.ufs
       jfs                         partclone.jfs
       hfs plusfs                  partclone.[hfs+ | hfsplus]
       vmfs                        partclone.[vmfs | vmfs5]
       ntfs                        partclone.ntfs
       fat12, fat16, fat32         partclone.[fat12 | fat16 | fat32]
       exfat                       partclone.exfat
       minix                       partclone.minix
       f2fs                        partclone.f2fs
       nilfs2                      partclone.nilfs2
       apfs                        partclone.apfs
       zfs (stripe pool)           partclone.zfs
       openzfs (stripe pool)       partclone.openzfs
       others (Not Supported FS)   partclone.imager

OPTIONS

The program follows the usual GNU command line syntax, with long options starting with two dashes (`-'). A summary of options is included below.

-s FILE, --source FILE

Source FILE. The FILE could be a image file (made by partclone) or device depend on your action. Normally, backup source is device, restore source is image file.

Receving data from pipe line is supported ONLY for restoring, just ignore -s option or use '-' means receive data from stdin.

-o FILE, --output FILE

Output FILE. The FILE could be a image file (partclone will generate) or device depend on your action. Normally, backup output to image file and restore output to device.

Sending data to pipe line is also supported ONLY for back-up, just ignore -o option or use '-' means send data to stdout.

-O FILE, --overwrite FILE

Overwrite FILE, overwriting if exists.

-W FILE, --restore_raw_file FILE

create special raw file for loop device.

-c, --clone

Save partition to the special image format.

-r, --restore

Restore partition from the special image format.

-b, --dev-to-dev

Local device to device copy on-the-fly, source and output both are device.

-D, --domain

Create GNU Ddrescue domain log file from source device. This is a human readable file in which + marks used block areas and ? marks free areas.

--offset_domain=X

Add X (in bytes) to all positions reported in the domain log file

--restore_raw_file

Creating special raw file for loop device.

-L FILE, --logfile FILE

put special path to record partclone log information. (default /var/log/partclone.log)

-R, --rescue

Continue after disk read errors.

-C, --no_check

Don't check device size and free space.

-N, --ncurses

Using Ncurses Text User Interface.

-I, --ignore_fschk

Ignore filesystem check.

-i, --ignore_crc

Ignore crc check error.

-F, --force

Force progress.

-f sec, --UI-fresh sec

put special second to different interval.

-z size, --buffer_size size

Read/write buffer size (default: 1048576)

-q, --quiet

Disable progress message.

-dlevel, --debug level

Set the debug level [1|2|3]

-x, --compresscmd CMD

Start CMD as an output pipe to compress the cloned image

-aX, --checksum-mode=X

Checksum formula to use to add error detection

where X:

0: No checksum (no slowdown, smallest image)

1: CRC32 (Fast to compute, basic detection)

2: xxHash64 extremely fast non-cryptographic hash algorithm

3: xxHash128 Strong and extremely fast, best detection

-kX, --blocks-per-checksum=X

Write one checksum for every X blocks

-w, --skip_write_error

Continue restore while write errors

--write-direct-io

Writing data to TARGET partition without cache

--read-direct-io

Reading data from SOURCE partition without cache

-B, --no_block_detail

Show progress message without block detail

--binary-prefix

Show progress with bit size (default is MB, GB...)

--prog-second

Show progress in seconds (default is minute)

--json-status[=FILE]

Write progress status to FILE in JSON format, periodically refreshed, so external tools can poll the clone/restore status (default FILE: /var/log/partclone.json)

--json-fresh=N

JSON status update interval in seconds (default: 1, minimum: 1)

-E, --offset=X

Add offset X (bytes) to OUTPUT

-T, --btfiles

Restore block as file for ClonezillaBT.

-t, --btfiles_torrent

Restore block as file for ClonezillaBT but only generate torrent.

-n, --note NOTE

Display Message Note (128 words).

-h, --help

Show summary of options.

-v, --version

Show version of program.

FILES

/var/log/partclone.log

The log file of partclone

/var/log/partclone.json

The default JSON progress status file written when --json-status is given without FILE.

EXAMPLES

 clone /dev/hda1 to hda1.img and display debug information.
   partclone.ext3 -c -d -s /dev/hda1 -o hda1.img
 restore /dev/hda1 from hda1.img and display debug information.
   partclone.extfs -r -d -s hda1.img -o /dev/hda1
 restore image from clonezilla (split, gzip,) with stdin source
   cat sda1.ext3-ptcl-img.gz.a* | gunzip -c | partclone.ext3 -d -r -s - -o /dev/sda1

DIAGNOSTICS

The following diagnostics may be issued on stderr:

partclone provides some return codes, that can be used in scripts:

CodeDiagnostic
0Program exited successfully.
1Clone or Restore seem failed.

BUGS

Report bugs to [email protected] or http://partclone.org.

You can get support at http://partclone.org

SEE ALSO

partclone(8), partclone.chkimg(8), partclone.restore(8), partclone.dd(8), partclone.info(8)

AUTHOR

Yu-Chin Tsai <[email protected]>

COPYRIGHT

Copyright © 2007 Yu-Chin Tsai

This manual page was written for the Debian system (and may be used by others).

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU General Public License, Version 2 or (at your option) any later version published by the Free Software Foundation.

On Debian systems, the complete text of the GNU General Public License can be found in /usr/share/common-licenses/GPL.

History

--binary-prefix since Debian 13 (Trixie); --blocks-per-checksum since Debian 13 (Trixie); --btfiles since Debian 13 (Trixie); --btfiles_torrent since Debian 13 (Trixie); --checksum-mode since Debian 13 (Trixie); --compresscmd since Debian 13 (Trixie); --json-fresh since Arch Linux 2026-11-01; --json-status since Arch Linux 2026-11-01; --ncurses since Debian 12 (Bookworm); --no_block_detail since Debian 13 (Trixie); --note since Debian 13 (Trixie); --offset since Debian 13 (Trixie); --prog-second since Debian 13 (Trixie); --read-direct-io since Debian 13 (Trixie); --skip_write_error since Debian 13 (Trixie); --write-direct-io since Debian 13 (Trixie); -B since Debian 13 (Trixie); -E since Debian 13 (Trixie); -L since Debian 12 (Bookworm); -T since Debian 13 (Trixie); -W since Debian 13 (Trixie); -aX since Debian 13 (Trixie); -i since Debian 13 (Trixie); -kX since Debian 13 (Trixie); -n since Debian 13 (Trixie); -t since Debian 13 (Trixie); -w since Debian 13 (Trixie); -x since Debian 13 (Trixie).

--dialog until Debian 12 (Bookworm); --ncurse until Debian 11 (Bullseye); -X until Debian 12 (Bookworm); -l until Debian 11 (Bullseye).