LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

partclone

creates and restores partition images while skipping empty blocks

TLDR

Clone partition to image file
$ sudo partclone.ext4 -c -s /dev/sdXY -o [path/to/backup.img]
copy
Restore partition from image
$ sudo partclone.ext4 -r -s [path/to/backup.img] -o /dev/sdXY
copy
Clone btrfs partition
$ sudo partclone.btrfs -c -s /dev/sdXY -o [path/to/backup.img]
copy
Device to device clone
$ sudo partclone.ext4 -b -s /dev/sdX1 -o /dev/sdY1
copy
Clone with rescue mode (continue after read errors)
$ sudo partclone.ext4 -c -R -s /dev/sdXY -o [path/to/backup.img]
copy
Clone with ncurses interface
$ sudo partclone.ext4 -c -N -s /dev/sdXY -o [path/to/backup.img]
copy

SYNOPSIS

partclone.fstype [-c|-r|-b] [-s source] [-o output] [options]

DESCRIPTION

partclone creates and restores partition images while skipping empty blocks, resulting in smaller backup files and faster operations compared to raw disk imaging. Each filesystem type has its own binary that understands the filesystem structure.The tool reads only used blocks from the source filesystem, making backups significantly smaller than the partition size. This is especially beneficial for partially filled partitions.

PARAMETERS

-c, --clone

Clone partition to image file.
-r, --restore
Restore partition from image file.
-b, --dev-to-dev
Device to device clone.
-s source, --source source
Source device or image file.
-o output, --output output
Output device or image file.
-L file, --logfile file
Write log to file.
-C, --no-check
Skip filesystem check before clone.
-R, --rescue
Continue after disk read errors.
-N, --ncurses
Use Ncurses text user interface.
-O file, --overwrite file
Output file, overwriting if it exists.
-n, --note MSG
Add a note to the image (up to 128 words).

COMMANDS

partclone.ext4

Clone ext4 filesystems
partclone.btrfs
Clone btrfs filesystems
partclone.ntfs
Clone NTFS filesystems
partclone.fat32
Clone FAT32 filesystems
partclone.xfs
Clone XFS filesystems
partclone.dd
Raw block copy (any filesystem)

CAVEATS

Source partition should be unmounted during cloning. Filesystem-specific binary must match the partition type. Restored partitions may need fsck. Image files are not directly mountable.

HISTORY

partclone was developed as an efficient alternative to dd for partition backup. By understanding filesystem metadata, it achieves compression without needing external tools, making it popular for system backup and deployment scenarios.

SEE ALSO

dd(1), clonezilla(1), fsarchiver(1)

Copied to clipboard
Kai