Unecrypted Image of Truecrypt-Encrypted System Partition

Posted by Dexter on Super User See other posts from Super User or by Dexter
Published on 2012-09-05T09:21:35Z Indexed on 2012/09/05 9:40 UTC
Read the original article Hit count: 280

Filed under:
|
|
|

The general tenor around the internet seems to be that you can't create images of system partitions that have been encrypted (with truecrypt) other than with dd or similar sector-by-sector copy tools. These files however are very impractical given their size (and are obviously incompressible) which makes keeping multiple states/backups of your system partition rather expensive (..especially considering current hdd prices).

The problem is that backup tools (like Acronis True Image, Clonezilla, etc.) won't give you the option to create an image of (mounted/opened) Truecrypt partitions, or that there is no recovery environment for restoring the backup, that would allow to run truecrypt before doing any actual restoring.

After some trial and error however, I believe I have found a very simple way. Since Truecrypt (running in Linux) creates a virtual block device, that it uses for mounting the unencrypted partitions into the file system, partclone can be used for creating/restoring images.

What I did:

  1. boot up a linux live disk
  2. mount/open the drive/device/partition in truecrypt
  3. unmount the filesystem mount point again, like so:

    umount /media/truecryptX
    

    ("X" being the partition number assigend by truecrypt)

  4. use partclone (this is what clonezilla would do too, except that clonezilla only offers you to back up real drive partitions, not virtual block devices):

    partclone.ntfs -c -s /dev/mapper/truecryptX -o nameOfBackupFile
    
  5. for restoring steps 1-3 remain the same, and step 4 is

    partclone.ntfs -r -s nameOfBackupFile -o /dev/mapper/truecryptX
    

A backup and test-restore of the system (with this method) seems to have worked fine (and the changed settings were reverted to the backup-state). The backup file is ~40 GB (and compressible down to <8GB with 7zip/LZMA2 on the "fast" setting).

I can't quite believe that I'm the only one that wants to create images of encrypted drives, but doesn't want to waste >100GB on the backup of one single system state. So my question now is, given how simple this was, and that no one seems to mention anywhere that this is possible - did I miss something? or did I do something wrong? Is there any situation that I didn't think of where this method will fail?

Obviously, the backup file needs to be stored in some other encrypted place in order to still remain confidential, since it is unencrypted. Also, in order to do a full "bare metal" restore, one would have to actually first (re-)install Windows, encrypt it, and only then restore the backup file. The funny thing however is that you won't need to backup any partition tables, etc. since the reinstall will effectively take care of that. Is there anything else? This is imho still a lot better than having sector-by-sector images..

© Super User or respective owner

Related posts about Windows

Related posts about backup