Where in initrd are boot-drive specified?

I renamed my root LV without updating initrd.
The system now boot into emergency shell because it seems somewhere in initrd the old name of the boot drive still exist.
I did update the new name of the root device in the boot-manager (systemd-boot) and fstab.
I thought initrd only got the information about the root device from the boot-manager, but it seems not to be the case.

In which file(s) in the initrd-image is the root device specified?

Kernel command line should override any saved information. You do not explain what “update the new name of the root device in the boot-manager” means, so it is hard to comment.

Found this two files in the initrd image:


etc/cmdline.d/90lvm.conf
etc/cmdline.d/95root-dev.conf

I’ll try to update them with the correct name and see if that solve the problem.
Or perhaps just delete them?

I regards to my systemd-boot config, my entry-file look like this:


title      "openSUSE 15.3"
linux      "/EFI/kernels/openSUSE_15.3/vmlinuz-5.3.18-59.16-default"
initrd     "/EFI/kernels/openSUSE_15.3/initrd-5.3.18-59.16-default"
options    root=/dev/mapper/VG10-openSUSE_15.3

*(and the options file has the correct LV name)

The content of “etc/cmdline.d/90lvm.conf” in the initrd image is:


rd.lvm.lv=**VG10/lv_debian**

And “etc/cmdline.d/95root-dev.conf


root=**/dev/mapper/VG10-lv_debian** rootfstype=ext4 rootflags=rw,relatime

I now updated my systemd-boot entry with the same kernel option “rd.lvm.lv”:


title      "openSUSE 15.3"
linux      "/EFI/kernels/openSUSE_15.3/vmlinuz-5.3.18-59.16-default"
initrd     "/EFI/kernels/openSUSE_15.3/initrd-5.3.18-59.16-default"
options    root=/dev/mapper/VG10-openSUSE_15.3 **rd.lvm.lv=VG10/openSUSE_15.3**

The boot-process now improved, but the boot-log still says:


Using kernel command line parameters: 
    rd.lvm.lv=VG10/lv_debian 
    root=/dev/mapper/VG10-lv_debian 
    rootfstype=ext4 
    rootflags=rw,relatime 
    initrd=\EFI\kernels\openSUSE_15.3\initrd-5.3.18-59.16-default 
    root=/dev/mapper/VG10-openSUSE_15.3 
    rd.lvm.lv=VG10/openSUSE_15.3
..
..
..
   17.399764] localhost dracut-initqueue[382]: Scanning devices sda2  for LVM logical volumes **VG10/lv_debian** VG10/openSUSE_15.3
..

The last line result in a scan of VG10/lv_debian which give the error as it doesn’t exist.
But at least I now can succeed a full boot pressing Ctrl+D at the emergency shell.

I expect if I inject (overwrite) “**etc/cmdline.d/90lvm.conf” **in the initrd image with an empty file the problem will be completely solved (or just regenerate the initrd completely of course)

The question is if it’s a bug that the option “rd.lvm.lv” in the initrd image is not completely overwritten by the same option specified in the boot-manager?

That is entirely different issue than “wrong name for root device”. Which is why you should always present facts, not your interpretation of them.

The question is if it’s a bug that the option “rd.lvm.lv” in the initrd image is not completely overwritten by the same option specified in the boot-manager?

No, it is not. Read “man dracut.cmdline”.

I did read it, but I didn’t find any information about if the kernel-options specified in your boot-manager should/or should not overrule any kernel options specified in the initrd. Which one could argue would be preferable.

Does it say anywhere?

Secondly I never asked about the “wrong name for root device” I got that fully under control, that’s not the issue.

And to quote your own statement “Kernel command line should override any saved information”. This doesn’t seem to be the case. So is this a bug or is your statement wrong?

root= on kernel command line overrides whatever root= the initrd may contain. However, when the device specified by root= on kernel command line cannot be found, dracut typically/normally?/always? will offer the root= it contains to attempt to proceed with.

But the “root=” option was not the issue, but the kernel option “rd.lvm.lv=” (this option tell the kernel to ONLY initialize that specific LV)
This option was to my surprise specified in the initrd image by dracut will NOT get overridden be the same option you specify on the kernel command :frowning:

But the damage is limited in the sense that when your system end up in the emergency shell, when you push CTRL+D the kernel seem to load all LV’s afterall and then your boot succeed because it now initialize the device specified in the “root=” option.

I would be nice if it was the case so you can always boot by just setting kernel command options in your boot manager.