Use this guide to customize your encryption setup. This guide addresses encryption setup needs not offered by Linux Mint installer.
A non exhaustive list of possibilities, each volume in the list being encrypted:
- root, home and swap
- home and swap (root not encrypted)
- root system #1, root system #2, shared data storage, shared swap, enabling dual boot encryption
- root system #1, root system #2, shared home, shared data, shared swap
- write your own here
This guide details a triple boot setup. In addition to Windows OS already installed on the computer, two versions of Linux Mint 64 bit fully encrypted with shared home and swap.
Notice the following procedure is a case scenario to illustrate the possibilities, this setup is not a recommendation in regards of the partitioning.
Requirements:
- two encrypted operating systems need two seperate unencrypted boot partitions, one for each.
- a large partition that will host LVM over LUKS
- the Linux Mint installation flash drive
- preparing the container and the logical volumes
- installing Linux Mint via the installer
- editing the encryption settings for the boot process to work properly
Proceeding with installation of operating system #1.
Step 1 - Preparing the container and the logical volumes:
Suppose a 1TB hard disk, first 4 partitions sda1 to sda4 allocated to EFI and Windows, 600 GB of unallocated free space. Booting LM 18 Cinnamon Live session and launching gparted to create the following partitions:
- sda5, 256MB ext4 for /boot system #1
- sda6, 256MB ext4 for /boot system #2
- sda7, 500GB unformatted for LUKS
- 100 GB of unallocated free disk space still available for other usages
Code: Select all
sudo cryptsetup luksFormat /dev/sda7
sudo cryptsetup luksOpen /dev/sda7 luks1
luks1
an LVM primary volume:
Code: Select all
sudo pvcreate /dev/mapper/luks1
Code: Select all
apt update
apt install system-config-lvm
Creating new Volume Group
vg1
:
Creating new Logical Volumes:
- root1, 20 GB
- root2, 20 GB
- swap, 4 GB
- home, 300 GB
- leaving 156 GB of unallocated space for future logical volume usages.
Step 2 - Installing Linux Mint 18 Cinnamon via the installer
Launching the installer, select Installation type Something else, assign the following partitions and logical volumes:
- available ESP (EFI System Partition) is assigned automatically as type efi by the installer, do not edit.
- /dev/sda5, /boot, ext4, format
- /dev/mapper/vg1-root1, / (root), ext4, format
- /dev/mapper/vg1-swap, swap area
- /dev/mapper/vg1-home, /home, ext4, format
- Device for boot loader installation, select /dev/sda (selecting the ESP partition id also works)
Step 3 - Editing encryption settings and finalizing
Preparing chroot environment for freshly installed Linux Mint 18 Cinnamon
Mounting root1 logical volume:
Code: Select all
sudo mount /dev/mapper/vg1-root1 /mnt
Code: Select all
sudo mount /dev/sda5 /mnt/boot
Code: Select all
sudo mount --bind /dev /mnt/dev
sudo chroot /mnt mount -t proc proc /proc
sudo chroot /mnt mount -t sysfs sysfs /sys
sudo chroot /mnt mount -t devpts devpts /dev/pts
Code: Select all
gksu xed /mnt/etc/crypttab
Code: Select all
# <target name> <source device> <key file> <options>
luks1 /dev/sda7 none luks
Code: Select all
sudo chroot /mnt update-initramfs -u
Proceeding with installation of operating system #2.
Installing Linux Mint 18 Mate 64 bit, booting the Live session.
Step 1 - Most done in previous installation.
Unlocking LUKS block device
luks1
:
Code: Select all
sudo cryptsetup luksOpen /dev/sda7 luks1
Assigning partitions and logical volumes for system #2:
- available ESP (EFI System Partition) is assigned automatically as type efi by the installer, do not edit
- /dev/sda6, /boot, ext4, format
- /dev/mapper/vg1-root2, / (root), ext4, format
- /dev/mapper/vg1-swap, swap area
- /dev/mapper/vg1-home, /home, ext4, do not select format
- Device for boot loader installation, select /dev/sda (selecting the ESP partition id also works)
Step 3 - Editing encryption settings and finalizing
Preparing chroot environment for freshly installed Linux Mint 18 Mate.
Mounting root2 volume:
Code: Select all
sudo mount /dev/mapper/vg1-root2 /mnt
Code: Select all
sudo mount /dev/sda6 /mnt/boot
Code: Select all
sudo mount --bind /dev /mnt/dev
sudo chroot /mnt mount -t proc proc /proc
sudo chroot /mnt mount -t sysfs sysfs /sys
sudo chroot /mnt mount -t devpts devpts /dev/pts
Code: Select all
gksu xed /mnt/etc/crypttab
Code: Select all
# <target name> <source device> <key file> <options>
luks1 /dev/sda7 none luks
Code: Select all
sudo chroot /mnt update-initramfs -u