Creating a disk image of dm-crypt/LUKS encrypted LVM partition (Linux)

backupdisk-encryptiondisk-imagelvm

Is there any disk imaging software out there that can intelligently take an image of an encrypted LVM partition, if I provide the passphrase?

I am referring to software that is similar to Clonezilla and Norton Ghost…. scan the partitions, save the image to a file on another drive, then the image can later be used to overwrite the partitions to restore the system to the saved state.

By "intelligently" I mean only imaging the used space of the partition and compressing the data in the image, like what those imaging software programs can do with regular unencrypted partitions. A variety of software can image the whole raw encrypted LVM, but without the ability to decrypt with my passphrase, it wouldn't know what is free space so it would image the whole thing and the encrypted data would be uncompressible.

Best Answer

If you open the device using cryptsetup then you can access the various entries in /dev/mapper in order to access the raw filesystems.

Related Question