Partclone

来自 Arch Linux 中文维基

Partclone 与众所周知的 Partimage 一样可用于备份和还原分区,同时仅考虑已使用的块。

安装[编辑 | 编辑源代码]

安装 partclone 包。

对一个 ext4 格式的分区使用 Partclone[编辑 | 编辑源代码]

不使用压缩[编辑 | 编辑源代码]

要备份而 不使用 压缩:

# partclone.ext4 -c -s /dev/sda1 -o ~/image_sda1.pcl

还原它:

# partclone.ext4 -r -s ~/image_sda1.pcl -o /dev/sda1

使用压缩[编辑 | 编辑源代码]

进行 压缩备份:

# partclone.ext4 -c -s /dev/sda1 | gzip -c > ~/image_sda1.pcl.gz
注意: 为获得最大压缩效果,请使用 gzip -c9,或者尝试使用其他压缩工具

还原它:

# zcat ~/image_sda1.pcl.gz | partclone.ext4 -r -o /dev/sda1