Hi all,
Here's how you install Ubuntu 14 with a LUKS-encrypted / and /boot partition when using legacy BIOS:
Here's how you install Ubuntu 14 with a LUKS-encrypted / and /boot partition when using legacy BIOS:
- Install Ubuntu. You'll want to create a 256M /boot (unencrypted), a LUKS container with LVM for /.
- Boot the system to prove that it boots correctly.
- Copy the contents of /boot somewhere, and note the device (say /dev/sda1 for this example).
cryptsetup luksFormat /dev/sda1 -c aes-xts-plain64
DO NOT install LVM here; grub2 refuses to allow FS writes to LVM volumes, which is needed for recordfail.- Create an entry in /etc/crypttab for the new LUKS container. We'll assume you called the device-mapper node "boot_crypt".
/etc/init.d/cryptdisks-early start
(prove that crypttab works)mkfs.ext4 /dev/mapper/boot_crypt -L boot
(or whatever filesystem you want here)- Edit /etc/fstab to point /boot to /dev/mapper/boot_crypt.
- Copy the saved files from step 3 into the new /boot.
echo 'GRUB_ENABLE_CRYPTODISK=y' >> /etc/default/grub
grub-install -v
(verify that grub-mkimage is called with luks/cryptodisk modules included)update-grub
- Reboot. Grub should now prompt to unlock the disk before showing the boot menu. For extra credit, set up LUKS keys for automount, since the only thing unencrypted on your HDD is grub, so in theory you could stash the key for the rootfs LUKS keys in the initramfs.