Skip to main content
Topic: [SOLVED] Encrypted install issues. (Read 387 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

[SOLVED] Encrypted install issues.

Hello, trying to install Artix with luks encryption following this (https://wiki.artixlinux.org/Main/InstallationWithFullDiskEncryption) and this (https://web.archive.org/web/20210515073858/https://www.rohlix.eu/post/artix-linux-full-disk-encryption-with-uefi/) guide, but keep running into problems. First time trying to install an encrypted system on UEFI.
Grub seems to work; I enter the passphrase and it starts booting linux. It then hangs on "Loading initial ramdisk" for a while and then errors and drops me into the rootfs shell.
Code: [Select]
ERROR: resume: hibernation device not found
ERROR: device '/dev/mapper/lvmSystem-volRoot' not found. Skipping fsck.
And errors based on those before (not being able to mount /new_root, real root, etc.)
When I
Code: [Select]
ls /dev/mapper
I only see "control", when I
Code: [Select]
cryptsetup luksOpen /dev/nvme0n1p2 lvmSystem
, I can then see lvmSystem, lvmSystem-volRoot and lvmSystem-volSwap in /dev/mapper and can mount /new_root where I exit rootfs and have access to the system.
Some other info:
blkid:
Code: [Select]
/dev/mapper/lvmSystem-volSwap: UUID="15ef6811-bb00-4585-ad0f-e791ee3e7081" TYPE="swap"
/dev/nvme0n1p1: LABEL_FATBOOT="ESP" LABEL="ESP" UUID="30B3-702C" BLOCK_SIZE="512" TYPE="vfat" PARTLABEL="primary" PARTUUID="79d460de-c66c-498c-acd9-39279c78f656"
/dev/nvme0n1p2: UUID="f5105e5b-8681-4f8d-a3ff-4b49fd5a2de3" TYPE="crypto_LUKS" PARTLABEL="primary" PARTUUID="b43244bb-c106-4a82-95e9-8bc147ed78b8"
/dev/mapper/lvmSystem-volRoot: LABEL="volRoot" UUID="fd53c5ca-378b-4466-bfc0-7cf04b8add75" BLOCK_SIZE="4096" TYPE="ext4"
/dev/mapper/lvmSystem: UUID="TLt1DK-AiUA-25Ra-9lFc-oNP7-WUug-c8R82B" TYPE="LVM2_member"
/dev/sda1: UUID="278B-85BA" BLOCK_SIZE="512" TYPE="vfat"
Partition table:
Code: [Select]
NAME                    MAJ:MIN RM   SIZE RO TYPE  MOUNTPOINTS
sda                       8:0    1  29.3G  0 disk 
└─sda1                    8:1    1    29G  0 part  /root/usb
nvme0n1                 259:0    0 931.5G  0 disk 
├─nvme0n1p1             259:1    0   511M  0 part  /boot/efi
└─nvme0n1p2             259:2    0   931G  0 part 
  └─lvmSystem           254:0    0   931G  0 crypt
    ├─lvmSystem-volSwap 254:1    0    16G  0 lvm   [SWAP]
    └─lvmSystem-volRoot 254:2    0   915G  0 lvm   /
mkinitcpio.conf:
Code: [Select]
# MODULES
MODULES=()

# BINARIES
BINARIES=()

# FILES
FILES=(/crypto_keyfile.bin)

# HOOKS
HOOKS=(encrypt resume lvm2 base udev autodetect microcode modconf kms keyboard keymap consolefont block filesystems fsck)
/etc/default/grub:
Code: [Select]
GRUB_DEFAULT=0
GRUB_TIMEOUT=5
GRUB_DISTRIBUTOR="Artix"
GRUB_CMDLINE_LINUX_DEFAULT="cryptdevice=UUID=f5105e5b-8681-4f8d-a3ff-4b49fd5a2de3:lvm-system loglevel=3 quiet resume=UUID=15ef6811-bb00-4585-ad0f-e791ee3e7081 net.ifnames=0"
GRUB_CMDLINE_LINUX=""

GRUB_PRELOAD_MODULES="part_gpt part_msdos"

GRUB_ENABLE_CRYPTODISK=y

GRUB_TIMEOUT_STYLE=menu

GRUB_TERMINAL_INPUT=console

GRUB_GFXMODE=auto

GRUB_GFXPAYLOAD_LINUX=keep

GRUB_DISABLE_RECOVERY=true

I want to solve why the process isn't being automated as it should and would welcome any help.

Edit:
Also tried what the OP of this (https://forum.artixlinux.org/index.php/topic,1541.0.html) thread suggested, so that my GRUB_CMDLINE_LINUX in /etc/default/grub now looks like this:
Code: [Select]
GRUB_CMDLINE_LINUX="cryptdevice=UUID=f5105e5b-8681-4f8d-a3ff-4b49fd5a2de3:lvmSystem root=/dev/lvmSystem/volRoot"
Which didn't help.

Re: Encrypted install issues.

Reply #1
Here is the easiest way to install FDE.


Re: Encrypted install issues.

Reply #3
One thing I noticed when looking at dmesg was the kernel parameter defining root twice:
Code: [Select]
Command line: BOOT_IMAGE=/boot/vmlinuz-linuz-lts root=/dev/mapper/lvmSystem-volRoot rw cryptdevice=UUID=f5105e5b-8681-4f8d-a3ff-4b49fd5a2de3:lvmSystem root=/dev/lvmSystem/volRoot loglevel=3 quiet net.ifnames=0
Could that be the culprit? Even though this (https://unix.stackexchange.com/questions/544224/evaluation-order-of-duplicated-kernel-parameters) thread suggests it shouldn't matter, I don't know where the first definition of root is coming from because I only ever specify /dev/lvmSystem/volRoot as per (https://wiki.archlinux.org/title/Install_Arch_Linux_on_LVM#Kernel_boot_options).

Re: Encrypted install issues.

Reply #4
One thing I noticed when looking at dmesg was the kernel parameter defining root twice:
Code: [Select]
Command line: BOOT_IMAGE=/boot/vmlinuz-linuz-lts root=/dev/mapper/lvmSystem-volRoot rw cryptdevice=UUID=f5105e5b-8681-4f8d-a3ff-4b49fd5a2de3:lvmSystem root=/dev/lvmSystem/volRoot loglevel=3 quiet net.ifnames=0
Could that be the culprit? Even though this (https://unix.stackexchange.com/questions/544224/evaluation-order-of-duplicated-kernel-parameters) thread suggests it shouldn't matter, I don't know where the first definition of root is coming from because I only ever specify /dev/lvmSystem/volRoot as per (https://wiki.archlinux.org/title/Install_Arch_Linux_on_LVM#Kernel_boot_options).
Edit: it is not the case, after manually removing it from grub.cfg the problem still persists, this time not finding /dev/lvmSystem/volRoot.

Re: Encrypted install issues.

Reply #5
Edit:
Also tried what the OP of this (https://forum.artixlinux.org/index.php/topic,1541.0.html) thread suggested, so that my GRUB_CMDLINE_LINUX in /etc/default/grub now looks like this:
Code: [Select]
GRUB_CMDLINE_LINUX="cryptdevice=UUID=f5105e5b-8681-4f8d-a3ff-4b49fd5a2de3:lvmSystem root=/dev/lvmSystem/volRoot"
Which didn't help.
Try setting root= using the UUID of volRoot.
Based on your blkid output from the original post, modify /etc/default/grub like so:
Code: [Select]
GRUB_CMDLINE_LINUX="cryptdevice=UUID=f5105e5b-8681-4f8d-a3ff-4b49fd5a2de3:lvmSystem root=UUID=fd53c5ca-378b-4466-bfc0-7cf04b8add75"
Then update grub.cfg and reboot.

Re: Encrypted install issues.

Reply #6
Solved. Found out that the order of HOOKS matters, I changed:
Code: [Select]
HOOKS=(encrypt resume lvm2 base udev autodetect microcode modconf kms keyboard keymap consolefont block filesystems fsck)
to
Code: [Select]
HOOKS=(base udev autodetect modconf block encrypt keyboard keymap consolefont lvm2 resume filesystems fsck)

 

Re: Encrypted install issues.

Reply #7
Edit:
Also tried what the OP of this (https://forum.artixlinux.org/index.php/topic,1541.0.html) thread suggested, so that my GRUB_CMDLINE_LINUX in /etc/default/grub now looks like this:
Code: [Select]
GRUB_CMDLINE_LINUX="cryptdevice=UUID=f5105e5b-8681-4f8d-a3ff-4b49fd5a2de3:lvmSystem root=/dev/lvmSystem/volRoot"
Which didn't help.
Try setting root= using the UUID of volRoot.
Based on your blkid output from the original post, modify /etc/default/grub like so:
Code: [Select]
GRUB_CMDLINE_LINUX="cryptdevice=UUID=f5105e5b-8681-4f8d-a3ff-4b49fd5a2de3:lvmSystem root=UUID=fd53c5ca-378b-4466-bfc0-7cf04b8add75"
Then update grub.cfg and reboot.
Thanks, I already solved it in the post above, but it is best practice to reference volumes by their UUIDs so I will do it.