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)

INSTALL

sudo dnf install partclone
copy
sudo pacman -S partclone
copy
sudo zypper install partclone
copy
nix profile install nixpkgs#partclone
copy

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)

Braincup
Open source brain training for math, memory and focus
Braincup mini-games
41 mini-games · Apache-2.0
No ads · No tracking
Play in browser
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid
276 stars
From the maker of Linux Command Library
Copied to clipboard
Braincup
Open source brain training for math, memory and focus. 41 mini-games, from mental arithmetic to Sudoku, N-Back and Solo Chess.
Apache-2.0 licensed · No ads · No tracking · No account
From the maker of Linux Command Library
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid