You are not logged in.

#1 2024-12-01 16:52:58

musbur
Member
Registered: 2022-01-14
Posts: 59

[SOLVED] UKI fails to mount root file system

I'm trying to switch from grub to UKI. The system loads fine from grub (encrypted LVM). The filesystems on the running grub-booted system are mounted like so:

~$ mount | grep mapper
/dev/mapper/vg-root on / type ext4 (rw,relatime)
/dev/mapper/vg-home on /home type ext4 (rw,relatime)
~$ cat /etc/kernel/cmdline
loglevel=3 rd.luks.name=7e1267b3-b972-4413-8daf-6a1bdfcc42db=root root=/dev/mapper/vg-root"
~$

I built the UKI with the same kernel parameters. When I boot into it, I get prompted for the passphrase, and the volume group seems to be set up correctly:

Found device /dev/mapper/vg-root

Then I get 1,5 minutes' worth of this message:

A start job is running for /dev/mapper/vg-root

which times out with:

Dependency failed for InitrdRoot Device
Dependency failed for File System Check on /dev/mapper/vg-root
Dependency failed for /sysroot
Dependency failed for InitrdRoot File System

It seems that for some reason the UKI initrd cannot mount the root fs which is weird because I'm generating both the UKI and the seperate (grub-loaded) initramfs simultaneously from the same preset file:

~$ cat /etc/mkinitcpio.d/linux.preset
# mkinitcpio preset file for the 'linux' package

ALL_kver="/boot/vmlinuz-linux"
PRESETS=('default')

default_config="/etc/mkinitcpio.conf"
default_image="/boot/initramfs-linux.img"
default_uki="/boot/EFI/Linux/arch-linux.efi"
default_options="--splash /usr/share/systemd/bootctl/splash-arch.bmp"

~$

Both the UKI and the separate initramfs are made simultaneously with the same preset which runs without error:

[root ~]# mkinitcpio -p linux
==> Building image from preset: /etc/mkinitcpio.d/linux.preset: 'default'
==> Using configuration file: '/etc/mkinitcpio.conf'
  -> -k /boot/vmlinuz-linux -c /etc/mkinitcpio.conf -U /boot/EFI/Linux/arch-linux.efi -g /boot/initramfs-linux.img --splash /usr/share/systemd/bootctl/splash-arch.bmp
==> Starting build: '6.12.1-arch1-1'
  -> Running build hook: [base]
  -> Running build hook: [systemd]
  -> Running build hook: [autodetect]
  -> Running build hook: [modconf]
  -> Running build hook: [kms]
  -> Running build hook: [keyboard]
  -> Running build hook: [sd-vconsole]
  -> Running build hook: [block]
  -> Running build hook: [sd-encrypt]
==> WARNING: Possibly missing firmware for module: 'qat_420xx'
  -> Running build hook: [lvm2]
  -> Running build hook: [filesystems]
  -> Running build hook: [fsck]
==> Generating module dependencies
==> Creating zstd-compressed initcpio image: '/boot/initramfs-linux.img'
  -> Early uncompressed CPIO image generation successful
==> Initcpio image generation successful
==> Creating unified kernel image: '/boot/EFI/Linux/arch-linux.efi'
  -> Using cmdline file: '/etc/kernel/cmdline'
==> Unified kernel image generation successful
[root ~]#

Last edited by musbur (2024-12-02 15:51:00)

Offline

#2 2024-12-01 16:57:57

Head_on_a_Stick
Member
From: The Wirral
Registered: 2014-02-20
Posts: 8,489
Website

Re: [SOLVED] UKI fails to mount root file system

Is that the exact same kernel command line GRUB uses? Either check /boot/grub/grub.cfg or boot with GRUB and check /proc/cmdline.


Para todos todo, para nosotros nada

Offline

#3 2024-12-01 18:51:26

musbur
Member
Registered: 2022-01-14
Posts: 59

Re: [SOLVED] UKI fails to mount root file system

~$ cat /proc/cmdline
BOOT_IMAGE=/vmlinuz-linux root=/dev/mapper/vg-root rw loglevel=3 quiet rd.luks.name=7e1267b3-b972-4413-8daf-6a1bdfcc42db=root root=/dev/mapper/vg-root
~$

Offline

#4 2024-12-02 07:55:57

Head_on_a_Stick
Member
From: The Wirral
Registered: 2014-02-20
Posts: 8,489
Website

Re: [SOLVED] UKI fails to mount root file system

Does adding rw to /etc/kernel/cmdline help at all? Remember to regenerate the UKI after editing the file.


Para todos todo, para nosotros nada

Offline

#5 2024-12-02 08:32:34

seth
Member
Registered: 2012-09-03
Posts: 59,884

Re: [SOLVED] UKI fails to mount root file system

You can't even fsck the device - is your password qwerty-safe (assuming this is qwertz or maybe azerty)?
Try to set it to
Spaceballs-12345.jpg

Offline

#6 2024-12-02 09:02:25

-thc
Member
Registered: 2017-03-15
Posts: 739

Re: [SOLVED] UKI fails to mount root file system

musbur wrote:
~$ cat /proc/cmdline
BOOT_IMAGE=/vmlinuz-linux root=/dev/mapper/vg-root rw loglevel=3 quiet rd.luks.name=7e1267b3-b972-4413-8daf-6a1bdfcc42db=root root=/dev/mapper/vg-root
~$

Doesn't that look weird to you? This looks like a concatenation of two command lines.

What's the content of your "/etc/cmdline.d/root.conf"? In my case this cmdline is used in both cases (UKI/non-UKI).

Offline

#7 2024-12-02 11:50:43

musbur
Member
Registered: 2022-01-14
Posts: 59

Re: [SOLVED] UKI fails to mount root file system

seth wrote:

You can't even fsck the device - is your password qwerty-safe (assuming this is qwertz or maybe azerty)?

Yes it is and even if it weren't it shouldn't matter because grub and UKI both use the same build of the initramfs.

Offline

#8 2024-12-02 12:07:30

musbur
Member
Registered: 2022-01-14
Posts: 59

Re: [SOLVED] UKI fails to mount root file system

-thc wrote:
musbur wrote:
~$ cat /proc/cmdline
BOOT_IMAGE=/vmlinuz-linux root=/dev/mapper/vg-root rw loglevel=3 quiet rd.luks.name=7e1267b3-b972-4413-8daf-6a1bdfcc42db=root root=/dev/mapper/vg-root
~$

Doesn't that look weird to you? This looks like a concatenation of two command lines.
What's the content of your "/etc/cmdline.d/root.conf"? In my case this cmdline is used in both cases (UKI/non-UKI).

That's what I thought, too, but I couldn't find the source of the concatenation. I did

find /etc -type f | xargs grep 7e1267b3-b972

and found it only in /etc/default/grub and in /etc/kernel/cmdline (writing from memory here). Maybe grub-mkconfig pulls in /et/kernel/cmdline. Anyway, the BOOT_IMAGE you see above is what I get when booting from grub, so it works.

Offline

#9 2024-12-02 13:00:44

-thc
Member
Registered: 2017-03-15
Posts: 739

Re: [SOLVED] UKI fails to mount root file system

musbur wrote:

That's what I thought, too, but I couldn't find the source of the concatenation. I did

find /etc -type f | xargs grep 7e1267b3-b972

and [...]

But that GUID isn't mentioned twice - can you search for "root=/dev/mapper/vg-root" instead?

musbur wrote:

Maybe grub-mkconfig pulls in /et/kernel/cmdline.

No. In my case GRUB creates the command line via "grub-mkconfig", the "/etc/grub.d/*" files and appends the "GRUB_CMDLINE_LINUX_DEFAULT" value from "/etc/default/grub".

I took the resulting command line and wrote it to "/etc/cmdline.d/root.conf" for the UKI generation.

musbur wrote:

Anyway, the BOOT_IMAGE you see above is what I get when booting from grub, so it works.

And have you tried using that command line in "/etc/kernel/cmdline"?

Offline

#10 2024-12-02 15:51:51

musbur
Member
Registered: 2022-01-14
Posts: 59

Re: [SOLVED] UKI fails to mount root file system

Solved. Turns out I had overlooked the "sw" in the kernel command line. Jeez!

Offline

#11 2024-12-02 21:21:52

musbur
Member
Registered: 2022-01-14
Posts: 59

Re: [SOLVED] UKI fails to mount root file system

-thc wrote:
musbur wrote:

That's what I thought, too, but I couldn't find the source of the concatenation. I did

find /etc -type f | xargs grep 7e1267b3-b972

and [...]

But that GUID isn't mentioned twice - can you search for "root=/dev/mapper/vg-root" instead?

$ find /etc -type f | xargs grep vg-root
/etc/kernel/cmdline:loglevel=3 rd.luks.name=7e1267b3-b972-4413-8daf-6a1bdfcc42db=root root=/dev/mapper/vg-root rw"
/etc/default/grub:GRUB_CMDLINE_LINUX_DEFAULT="loglevel=3 rd.luks.name=7e1267b3-b972-4413-8daf-6a1bdfcc42db=root root=/dev/mapper/vg-root"
$

I really have no idea where grub gets the double root= entry from, but then I find grub overly complicated anyway, which is why I'm going UKI in the first place.

Offline

#12 2024-12-02 21:28:30

seth
Member
Registered: 2012-09-03
Posts: 59,884

Re: [SOLVED] UKI fails to mount root file system

I really have no idea where grub gets the double root= entry from

/boot/grub/grub.cfg?
See whether it's there and whether grub-mkconfig still generates it.

Offline

Board footer

Powered by FluxBB