backups to an encrypted volume using clonezilla

i had a few problems getting clonezilla to work

firstly, my live usb of clonezilla didn’t boot. turns out unetbootin, tuxboot, lili etc (i tried a few) don’t always edit the partition to be bootable and of type fat32. so while i’d formatted the usb to be fat32 and written the iso to it, it was still marked ‘linux, non-bootable’! using gnome-disks to edit the partition to fat32/bootable fixed it

so then i had clonezilla live booting. let it be said that clonezilla itself isn’t going to win any awards for clear instructions. i was paranoid i was going to write over my source drive by mistake, there was quite a bit of ambiguity in the first few screens

anyway, my second problem was one of encryption. clonezilla allows you to make encrypted backups, but i didn’t want that, i wanted to make unencrypted backups to an encrypted disk… i was going to use the same backup disk for rsync backups of bits of my filesystem too, you see. a disk password was out because my bios doesn’t support those for usb devices, even though the disk itself does. so i luks-encrypted my backup disk. but then clonezilla doesn’t support luks!

turns out the solution was easy. when clonezilla boots, it offers to drop you into a shell. do that, run the following commands, and then clonezilla will use your luks-encrypted disk as backup

sudo cryptsetup luksOpen /dev/sdN foo
sudo mount /dev/mapper/foo /home/partimag

…when prompted to mount the destination filesystem, just skip it (as it will offer by default), since you just did it…

after clonezilla has finished, it’ll drop you back into a shell. then you can do the following:

sudo sync
sudo umount /home/partimag
sudo crypysetup luksClose foo

# references

Leave a Reply

Your email address will not be published. Required fields are marked *