Linux command
partclone 命令
安全
May affect permissions or system state. Check the target first.
命令示例
Clone
sudo partclone.ext4 -c -s /dev/sdXY -o [path/to/backup.img]
Restore
sudo partclone.ext4 -r -s [path/to/backup.img] -o /dev/sdXY
Example
sudo partclone.btrfs -c -s /dev/sdXY -o [path/to/backup.img]
Device to device
sudo partclone.ext4 -b -s /dev/sdX1 -o /dev/sdY1
Example
sudo partclone.ext4 -c -R -s /dev/sdXY -o [path/to/backup.img]
Example
sudo partclone.ext4 -c -N -s /dev/sdXY -o [path/to/backup.img]
说明
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.
参数
- -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).
FAQ
What is the partclone command used for?
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.
How do I run a basic partclone example?
Run `sudo partclone.ext4 -c -s /dev/sdXY -o [path/to/backup.img]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does -c, --clone do in partclone?
Clone partition to image file.