You are not logged in.

#1 2021-12-04 23:45:48

Cvlc
Member
Registered: 2020-03-26
Posts: 295

[SOLVED] /etc/crypttab.initramfs

Hi,

I'm having trouble using /etc/crypttab.initramfs to boot my system. The reason I'd like to use it is that it allows for LABELS to be used, which is not the case with rd.luks kernel parameters.

I'm also using Unified Kernel Images built with mkinitpcio, and maybe that's why it's not working. Apprently this works with Dracut though.

I've tried many combinations but here are those which I believe should work (but don't) :

# cat /etc/kernel/cmdline
root=/dev/mapper/root rw quiet bgrt_disable
# cat /etc/crypttab.initramfs
# <name>            <device>             <password>                 <options>
root                LABEL=Root           keyfile:LABEL=KEYDEV        keyfile-timeout=10s,rootflags=subvol=@

Any idea what I'm doing wrong ? Maybe it's not possible, as this suggests that "root= or cryptdevice=" flags are still needed in the cmdline, and those can only be specified using UUIDs.

Last edited by Cvlc (2021-12-05 13:43:45)

Offline

#2 2021-12-05 00:01:45

loqs
Member
Registered: 2014-03-06
Posts: 18,991

Re: [SOLVED] /etc/crypttab.initramfs

What is the outcome on boot?  Is a login prompt available for diagnostics?

Offline

#3 2021-12-05 00:17:08

Cvlc
Member
Registered: 2020-03-26
Posts: 295

Re: [SOLVED] /etc/crypttab.initramfs

Thanks for your answer. It's some kind of emergency but there's no shell, it says "press enter to continue" but pressing enter throws an error. Maybe because I have editor=no in systemd boot config.

It says something about root not being allowed, and waiting for "Real Root"

Also couldn't access the logs from arch-chroot, they stopped at the previous boot.

Should have taken a picture before setting everything else back to normal.

Offline

#4 2021-12-05 07:51:46

nl6720
The Evil Wiki Admin
Registered: 2016-07-02
Posts: 714

Re: [SOLVED] /etc/crypttab.initramfs

Does the KEYDEV have a different file system type than root? If so, did you include the kernel module in the initramfs as instructed by https://wiki.archlinux.org/title/dm-cry … d.luks.key ?

E.g. if it's FAT, you need to edit /etc/mkinitcpio.conf and add:

MODULES=(vfat)

Edit:

rootflags is not a crypttab option, it should go in /etc/kernel/cmdline.

Last edited by nl6720 (2021-12-05 09:04:53)

Offline

#5 2021-12-05 11:20:44

Cvlc
Member
Registered: 2020-03-26
Posts: 295

Re: [SOLVED] /etc/crypttab.initramfs

Hi, yes I do have the vfat module (everything works perfectly as long as I don't use crypttab.)

I initially tried with rootflags in the cmdline, but I had a typo in crypttab for a while so maybe I didn't try that config again after correcting it. Let me try and report back.

Offline

#6 2021-12-05 13:42:04

Cvlc
Member
Registered: 2020-03-26
Posts: 295

Re: [SOLVED] /etc/crypttab.initramfs

works perfectly ! Thanks !

Here's the working config for anyone interested :

# cat /etc/kernel/cmdline
root=/dev/mapper/root rootflags=subvol=@ rw quiet bgrt_disable

# cat /etc/crypttab.initramfs
# <name>            <device>             <password>                 <options>
root                LABEL=Root           keyfile:LABEL=KEYDEV        keyfile-timeout=10s

The initial typo was LABEL:Root instead of LABEL=Root

Have a good day !

Offline

Board footer

Powered by FluxBB