You are not logged in.

#1 2019-12-16 16:26:44

drossbox
Member
Registered: 2019-12-04
Posts: 24

[Solved]Mount encrypted /root after change from udev to systemd hooks.

Hi all. I'm trying to migrate to using the systemd mkinitcpio hooks, but I'm currently dropping into an emergency shell instead. My mkinitcpio hooks are set like so -

 HOOKS=(base systemd  autodetect modconf block sd-vconsole sd-encrypt filesystems keyboard fsck) 

My /etc/fstab shows this for my root volume which I haven't changed -

 # /dev/mapper/luks_root LABEL=root
UUID=b3342490-f2d2-45f8-9994-6c2145c768a0       /               ext4            rw,relatime     0 1 

The luks partition containing my /root (before decrypting) has a UUID of -

 5a86baee-b5cc-474d-bb12-f1600a6d3437 

So, I replaced the kernel parameters that I'd used for udev:

 root=UUID=b3342490-f2d2-45f8-9994-6c2145c768a0 cryptdevice=/dev/nvme0n1p3:luks_root 

with:

 rd.luks.name=5a86baee-b5cc-474d-bb12-f1600a6d3437=luks_root root=/dev/mapper/luks_root 

I'd expected that to work given what I've read on the wiki, but it's giving me an error that /dev/mapper/luks_root isn't found, skipping fsck and being dropped into an emergency shell. What have I done wrong? Maybe someone has a similar setup and could share a working config? Also, not sure what it means but despite having changed to the systemd hooks, the system still boots happily if I leave the old cryptdevice and root values there, even though I'd assumed they wouldn't be valid with systemd&sd-encrypt?

Edited to correct an error.

Last edited by drossbox (2019-12-17 09:30:40)

Offline

#2 2019-12-16 16:30:18

Slithery
Administrator
From: Norfolk, UK
Registered: 2013-12-01
Posts: 5,776

Re: [Solved]Mount encrypted /root after change from udev to systemd hooks.

drossbox wrote:
 rd.luks.name=5a86baee-b5cc-474d-bb12-f1600a6d3437 root=/dev/mapper/luks_root 

Shouldn't that be rd.luks.uuid instead?


No, it didn't "fix" anything. It just shifted the brokeness one space to the right. - jasonwryan
Closing -- for deletion; Banning -- for muppetry. - jasonwryan

aur - dotfiles

Offline

#3 2019-12-16 16:34:45

drossbox
Member
Registered: 2019-12-04
Posts: 24

Re: [Solved]Mount encrypted /root after change from udev to systemd hooks.

Apologies, it actually reads

  rd.luks.name=5a86baee-b5cc-474d-bb12-f1600a6d3437=luks_root 

which as I understand can be used in place of rd.luks.uuid.

Offline

#4 2019-12-16 17:09:08

frostschutz
Member
Registered: 2013-11-15
Posts: 1,658

Re: [Solved]Mount encrypted /root after change from udev to systemd hooks.

in the emergency shell you can try 'ls -l /dev/mapper' or 'cat /proc/partitions' to see what's there

you can also verify kernel parameters are as expected in 'cat /proc/cmdline'

also you can try root=UUID= with the decrypted filesystem uuid, then it would be found regardless of mapping name, as long as it exists at all

Also, not sure what it means but despite having changed to the systemd hooks, the system still boots happily if I leave the old cryptdevice and root values there, even though I'd assumed they wouldn't be valid with systemd&sd-encrypt?

is it possible you didn't generate new initrd with mkinitcpio or booting off an old file?

in the rescue shell you should be able to check out the active initcpio ( cat or less /buildconfig and /config files ) and see if it is as you expect

Offline

#5 2019-12-16 17:32:38

drossbox
Member
Registered: 2019-12-04
Posts: 24

Re: [Solved]Mount encrypted /root after change from udev to systemd hooks.

Wow, thank you so much. 'cat /buildconfig'  listed udev as still being used. I'm using the linux-hardened package but thought I still needed to run mkinitcpio -p linux - was I wrong?? Running mkinitcpio -p linux-hardened has made the changes I needed and it works fine. Thanks so much!

Offline

Board footer

Powered by FluxBB