LinuxCommandLibrary

partclone

creates and restores partition images while skipping empty blocks, resulting

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
Display help
$ partclone.ext4 -h
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 device or image file
-o, --output _output_
Output device or image file
-L, --logfile _file_
Write log to file
-C, --no-check
Skip filesystem check before clone

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)

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community