You are not logged in.

#1 2021-10-12 14:08:52

RunAndTumble
Member
Registered: 2021-10-12
Posts: 2

Root partition not found when booting in encrypted installation

Hi folks,

I decided to follow the Wiki and use LVM on LUKS for my work machine. Installation didn't cause any serious problems but I for some reason can't finish the boot process, it gets back to the emergency shell, no passphrase asked.
I did try some other guides other than Wiki and that helped to fix a few issues with UUID etc but I clearly don't see what I miss here and I'm at my wits' end.
I've tried some advices from similar topics, in particular, mounting the partition from the shell manually but it says that "device does not exist or access denied".


lsblk -f: https://termbin.com/a0se

fstab: https://termbin.com/fn8b

mkinitcpio.conf: https://termbin.com/lnk1

grub.cfg: https://termbin.com/6x60

default grub: https://termbin.com/n6ly

Offline

#2 2021-10-12 14:47:56

Ammako
Member
Registered: 2021-07-16
Posts: 189

Re: Root partition not found when booting in encrypted installation

linux	/vmlinuz-linux root=/dev/mapper/work-root rw cryptdevice=UUID=5b3608d3-a73e-4a5f-8553-a514f99a5fc3:cryptlvm root=/dev/work/root loglevel=3 quiet splash

"/dev/mapper/work-root" and "/dev/work/root" should be equivalent, as far as I know, but is there a reason why "root" is being defined twice, as something different each time? I'm not sure where the first one comes from.

Edit: Hmm, that's probably not the issue. Mine has it twice as well, but it uses UUID-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx instead of device name. I'm not sure yet where that first declaration comes from but you might benefit from using UUIDs instead of device names?

Also, you're running unencrypted boot, so you don't need GRUB_ENABLE_CRYPTODISK=y, but I'm not sure if that might cause issues or not. At what point is it failing? It is grub that's failing, or initramfs?

Last edited by Ammako (2021-10-12 15:13:22)

Offline

#3 2021-10-13 08:56:11

RunAndTumble
Member
Registered: 2021-10-12
Posts: 2

Re: Root partition not found when booting in encrypted installation

benefit from using UUIDs instead of device names

How should it look in this case? Plus, as you mention there are two definitions of the root partition, I have no idea where the first one comes from as well and I'd rather not edit such configs manually.

Also, you're running unencrypted boot, so you don't need GRUB_ENABLE_CRYPTODISK=y,

I saw it being used in a few guides, that should not hurt as far as I understand but it didn't work without it as well.

At what point is it failing? It is grub that's failing, or initramfs?

I guess it's the latter judging by the message but I'm not that proficient at this part of Linux so you should guide me here.
I get this exact message after the GRUB stage.

ERROR: device '/dev/work/root' not found. Skipping fsck.
mount: /new_root: special device /dev/work/root does not exist.

And it throws me out to the emergency shell.

Offline

#4 2021-10-13 10:20:41

Ammako
Member
Registered: 2021-07-16
Posts: 189

Re: Root partition not found when booting in encrypted installation

I don't use lvm, but did you install lvm2 package before building your initramfs? That's the only reason I might see why the device might not exist at this point (though it would ask for luks encryption passphrase first, but without lvm2 it wouldn't know how to open your lvm partition.)

I don't know why yours uses device name in the first root= parameter instead of UUID, I suspect it probably doesn't matter though because with lvm there should be no risk of that device name changing unexpectedly.

I'll have to play around in a VM later to see if I can replicate this, you're on an NVMe SSD though and that might make things different. I assume your drive is probably already set to AHCI mode at least, otherwise you wouldn't have been able to see the drive to install to it at all in the first place (judging by other threads on NVMe drives.)

I recommend you remove "loglevel=3 quiet", let it show absolutely everything. Then you might have a better chance of seeing exactly what's going wrong.

Last edited by Ammako (2021-10-13 10:35:05)

Offline

#5 Yesterday 13:24:35

Ammako
Member
Registered: 2021-07-16
Posts: 189

Re: Root partition not found when booting in encrypted installation

Okay, so actually grub-mkconfig will automatically detect and generate the root= parameter, that's where the second (first) root= comes from. You don't actually need to manually specify it in /etc/default/grub

What doesn't make sense to me is that yours is using the old format (root=/dev/xxx) despite GRUB_DISABLE_LINUX_UUID=true not being set in your config. It should be using UUID. Do you have anything in /etc/grub.d that might be affecting things?

RunAndTumble wrote:

I did try some other guides other than Wiki and that helped to fix a few issues with UUID etc but I clearly don't see what I miss here and I'm at my wits' end.

What other guides? If those had you make unknown changes that aren't mentioned on the wiki then it's hard to know what your setup is like exactly. I would recommend against following any other guides unless you know what you're doing and know what everything does.

Offline

Board footer

Powered by FluxBB