Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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.

share|improve this question

2 Answers 2

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

share|improve this answer
1  
I think you misunderstood the question. I'm editing my question to clarify. –  Mike Rowave Jun 5 '11 at 22:17
    
Your edit didn't clarify. Do you mean that you're looking for software that you can boot directly into that can handle that? Because if you're not afraid of the command line then there's several that will work in the manner I've given. –  Ignacio Vazquez-Abrams Jun 5 '11 at 22:26
    
Yes, I am looking software that I can boot into which will handle the imaging just like Ghost/Clonezilla/etc., but with the added capability of being able to intelligently handle the data in the encrypted volume. If this can be done with 4 or 5 steps via the command line, I am open to that, but not if it requires 15 or 20 steps and several pages of instructions. –  Mike Rowave Jun 5 '11 at 22:48

If I got you correctly: you want to backup your "files" without the "free" space in between. All this on an encrypted volume inside an lvm (or an lvm inside an encrypted volume).

If yes, you could do that:

  1. Open the device using cryptsetup
  2. Start lvm
  3. Mount the volume

Now you should be able to view all your files.

Finally, go to the root of that mounted volume: use tar and pipe it to gzip (or bzi2) to get an "image" / "archive" of all your files. You can also pipe it to 7zip and give a password in the progress, so your data stays encrypted.

You should read the man page for tar, to select the right switches (preserve symlinks, recursive, preserve hidden files, dirs, etc. ).

share|improve this answer
    
More specifically, I wanted to make backup image of only the disk blocks that are used, like what is already done by various imaging software with unencrypted partitions. I was hoping that there would be some software out there that understood LUKS and LVM, so the user only has to provide the password and then the software can automatically figure out which blocks need to be backed up into the image. Apparently there is no software like that, so I'm stuck with running scripts to decrypt and mount the LVM myself before letting the backup software run on it. –  Mike Rowave Oct 24 '12 at 20:13

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.