I recently wanted to back up my LUKS-encrypted disk. However, clonezilla only offered the ability to clone with dd, rather than the faster partclone tool, which is understandable. It is, however, possible to clone the (decrypted) underlying extfs filesystem.
Note: if you make a backup of your decrypted data, it is as bad as if you’ve never encrypted it. Take good care of your backup and, for extra security, destroy it after you have restored it.
The first thing you need to do when you load Clonezilla, is to select “drop to shell” rather than running the normal clonezilla UI. You should now be in a root shell.
Map the device as you normally would (supposing your LUKS partition is /dev/sda5):
cryptsetup luksOpen /dev/sda5 crypt
You should now load some kernel modules:
modprobe dm-mod vgchange -ay
You should now have /dev/mapper/yourdevice-vg–root or similar.
You can use the
partclone tool now.
To back up:
partclone.ext4 -c -s /dev/mapper/yourdevice-vg--root -o /mnt/path-to-backup-disk/backup/image.img
This will clone the decrypted ext4 filesystem and save it to /mnt/path-to-backup-disk.
partclone.ext4 -r -s /mnt/path-to-backup-disk/backup/image.img -o /dev/mapper/yourdevice-vg--root
Easier than you’d think! Once again, be extra careful with your backups, for without the encryption, your data will be compromised if they fall to the wrong hands.