Results 1 to 9 of 9

Thread: Where in initrd are boot-drive specified?

  1. #1
    Join Date
    Dec 2020
    Location
    Denmark
    Posts
    40

    Default 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?

  2. #2
    Join Date
    Sep 2012
    Posts
    6,842

    Default Re: Where in initrd are boot-drive specified?

    Quote Originally Posted by MrBW View Post
    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.
    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.

  3. #3
    Join Date
    Dec 2020
    Location
    Denmark
    Posts
    40

    Default Re: Where in initrd are boot-drive specified?

    Found this two files in the initrd image:
    Code:
    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:
    Code:
    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)


  4. #4
    Join Date
    Dec 2020
    Location
    Denmark
    Posts
    40

    Default Re: Where in initrd are boot-drive specified?

    The content of "etc/cmdline.d/90lvm.conf" in the initrd image is:
    Code:
    rd.lvm.lv=VG10/lv_debian
    And "etc/cmdline.d/95root-dev.conf"
    Code:
    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":
    Code:
    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:
    Code:
    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?

  5. #5
    Join Date
    Sep 2012
    Posts
    6,842

    Default Re: Where in initrd are boot-drive specified?

    Quote Originally Posted by MrBW View Post
    The last line result in a scan of VG10/lv_debian which give the error as it doesn't exist.
    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".

  6. #6
    Join Date
    Dec 2020
    Location
    Denmark
    Posts
    40

    Default Re: Where in initrd are boot-drive specified?

    Quote Originally Posted by arvidjaar View Post
    That is entirely different issue than "wrong name for root device". Which is why you should always present facts, not your interpretation of them.

    No, it is not. Read "man dracut.cmdline".
    Quote Originally Posted by arvidjaar View Post
    That is entirely different issue than "wrong name for root device". Which is why you should always present facts, not your interpretation of them.

    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.

  7. #7
    Join Date
    Dec 2020
    Location
    Denmark
    Posts
    40

    Default Re: Where in initrd are boot-drive specified?

    Quote Originally Posted by arvidjaar View Post
    That is entirely different issue than "wrong name for root device". Which is why you should always present facts, not your interpretation of them.

    No, it is not. Read "man dracut.cmdline".

    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?

  8. #8
    Join Date
    Dec 2008
    Location
    FL, USA
    Posts
    3,189
    Blog Entries
    1

    Default Re: Where in initrd are boot-drive specified?

    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.
    Reg. Linux User #211409 *** multibooting since 1992
    Primary: 15.2, TW, 15.3 & 13.1 on Haswell
    Secondary: eComStation (OS/2) &15.2 on i965P w/ Radeon
    Tertiary: Mageia, Fedora, Debian, more on Kaby Lake & older Intel, AMD, NVidia &&&&&

  9. #9
    Join Date
    Dec 2020
    Location
    Denmark
    Posts
    40

    Default Re: Where in initrd are boot-drive specified?

    Quote Originally Posted by mrmazda View Post
    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 :-(

    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •