This guide will set up an Arch Linux system with an encrypted partition using LUKS containing logical volumes for swap, root, and home using LVM.
Below is an example of the disk layout:
|
|
Mount Point | Partition | Logical Volume | Type | File System | Size |
---|---|---|---|---|---|
/mnt/boot | /dev/efi_system_partition | none(not encrypted) | EFI system partition | fat32 | 1G |
[swap] | /dev/swap_partition | /dev/MyVolGroup/swap | Linux swap | swap | 16G |
/mnt | /dev/root_partition | /dev/MyVolGroup/root | Linux root | btrfs | 200G |
/mnt/home | /dev/home_partition | /dev/MyVolGroup/home | Linux home | btrfs | Remainder |
1. Creating the GPT partition table
List the available drives and create the partition table:
|
|
2. Preparing the disk
Create and open the LUKS encrypted container that will contain the logical volumes:
|
|
3. Preparing the logical volumes
Create a physical volume on top of the opened LUKS container:
|
|
Create a volume group and add the previously created physical volume to it:
|
|
Create all your logical volumes on the volume group:
|
|
Format your file systems on each logical volume:
|
|
Mount your file systems:
|
|
4. Preparing the boot partition
Create your file system for the boot partition:
|
|
5. Configuration during system install
5.1 Packages
Install ‘cryptsetup lv2’
5.3 Configuring mkinitcpio
Edit /etc/mkinitcpio.conf
adding encrypt lvm2
to HOOKS:
|
|
Recreate mkinitcpio:
|
|
5.4 Boot loader (grub)
Exit chroot to get the UUID of the disks.
|
|
Edit /etc/default/grub
and add the below to GRUB_CMLINE_DEFAULT:
|
|
Generate grub config:
|
|