0

I have an unencrypted Ubuntu 16.04 setup using LVM2. I'd like to 'port' this into an encrypted setup on the same computer and disk, which would save me the hassle of reinstalling all the apps and redoing the various settings.

Will the following work?

  1. Make dd backups of the logical volumes - lvroot, lvhome (no swap)

  2. fresh install of Ubuntu, with LVM sitting on top of LUKS.

  3. The logical volumes lvroot and lvhome on the new encrypted install will be at least as large as the corresponding volumes on the old unencrypted install.

  4. restore via dd the backups of lvroot and lvhome

  5. e2fsck -f then resize2fs

1 Answer 1

0

I went ahead and followed the steps outlined above and it does work.

Three additional steps after the above steps:

  1. create /etc/crypttab

  2. recreate initramfs

Both are described in this guide to Ubuntu install with encrypted LVM and custom/multiple logical volumes (i.e., not limited to the installer defaults of / and /swap): http://www.olafdietsche.de/2014/10/16/install-ubuntu-encrypted-lvm

  1. if the prior non-encrypted setup has logical volumes that are not in the encrypted setup, edit /etc/fstab (which is from non-encrypted setup) so the boot process doesn't search for a logical volume that doesn't exist.

Since dm-crypt cannot non-destructively encrypt an existing partition (like Truecrypt can), this definitely saved a lot of time and effort over starting from scratch with a fresh install and re-doing all the settings.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .