bugGNU Boot - Bugs: bug #65663, LVM2 doesn't work. Was: GRUB2 not...

 
 

bug #65663: LVM2 doesn't work. Was: GRUB2 not finding GNU/Linux on Gigabyte GA-G41M-ES2l (0.1-rc3)

Submitter:  WodeShengli <wodeshengli>
Submitted:  Tue 30 Apr 2024 02:49:14 PM UTC
   
 
Category:  Usability issue Priority:  5 - Normal
Item Group:  None Status:  In Progress
Privacy:  Public Assigned to:  gnuboot-maintainers
Open/Closed:  Open Computer:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Wed 13 Nov 2024 06:25:17 PM UTC, comment #11: 
GNUtoo <gnutoo>
Group administrator
Sun 08 Sep 2024 07:35:48 PM UTC, comment #10: 

A patch fixing this issue has been merged into the main branch.

Adrien Bourmault <neox>
Group administrator
Fri 06 Sep 2024 06:43:15 PM UTC, comment #9: 

BTW, if you want to be mentioned somehow as having reported this extremely important bug, feel free to reply in this bug report even after it is closed as we try to mention people who helped us as much as possible if they want to.

GNUtoo <gnutoo>
Group administrator
Fri 06 Sep 2024 06:41:37 PM UTC, comment #8: 

Thanks a lot for the bug report. I've now sent a patch to fix it. I'll also open new bugreports to contact other projects (Canoeboot and Libreboot) that use the same file even if they don't build images with GRUB as primary payload anymore.

GNUtoo <gnutoo>
Group administrator
Wed 26 Jun 2024 11:35:09 PM UTC, comment #7: 

I've work in progress code that can put the content of 'ls' into a variable.

We can then use 'ls --set=devices' and have all the devices in $devices and loop on top of it.

I'm unsure how to filter out the non-lvm part but there is a regex module, so it's probably doable.

So now we need to do several things:

  • Find how to filter out non-lvm devices and just drop-in the value of the LVM devices we found in lvmvol.
  • Finish the patch and add support for --set for listing files as well.
  • Split and clean the patches for adding --set into ls.
  • upstream the patches and hope there is not too much rework needed.
  • Backport the patches to GRUB 2.06 and add it to GNU Boot.


(file #56210)

GNUtoo <gnutoo>
Group administrator
Wed 26 Jun 2024 01:52:59 PM UTC, comment #6: 

I've done more research: I installed a Trisquel that is not encrypted and that has LVM2 and GNU Boot's GRUB didn't find the volumes.

So we could easily support cryptsetup in LVM2 but not LVM2 in cryptsetup or LVM2 alone.

To do that the best way would be to modify the ls command and somehow export the results to a variable (the probe command can do that for instance) and from that try to do a for loop on what was found.

GNUtoo <gnutoo>
Group administrator
Tue 25 Jun 2024 03:49:51 PM UTC, comment #5: 

In grub.cfg we have:
    # TODO: add more strings, based on what distros set up when
    # the user select auto-partitioning on those installers
    lvmvol="lvm/matrix-bootvol lvm/matrix-rootvol"

And then:
    echo -n "Attempting to unlock encrypted volumes"
    for dev in ${ahcidev} ${atadev} ${lvmvol} ${raidvol}; do
            if cryptomount "${dev}" ; then break ; fi
    done

So we need to find a way to either document what names are supposed to be used (and probably sync with the latest Libreboot commit that still shipped a grub.cfg) or find a way to fix it.

Basically we need to find a way to list the volumes and somehow programatically filter that out to test cryptomount on them.

Else we can also use 'cryptomount -a' and expect the user to have only one encrypted partition.

GNUtoo <gnutoo>
Group administrator
Tue 25 Jun 2024 02:35:51 PM UTC, comment #4: 

My hypothesis is that it is a bug inside the GRUB configuration shipped by GNU Boot and that it has something to do with how you partitioned your hard disk and not the Gigabyte GA-G41M-ES2l as I can somehow reproduce that on a ThinkPad X200.

I've done the following to try to reproduce, I've used an X200 with 4GiB of RAM, and an hdd. I've used an image with a qwerty image, seabios and low resolution.

I've installed Trisquel 10, with the defaults and I end up with a GPT + MBR partition with:
/dev/sda1: 1M    BIOS Boot (GRUB is inside)
/dev/sda2: 513M  /boot/efi
/dev/sda3: ~20G  /home
/dev/sda4: ~900G /

Nothing is encrypted and the GRUB payload can boot this configuration.

I've also tried with a second hard disk has a very different configuration:

It has only an MBR and it looks like that:
/dev/sda1: LVM
           |-> Encrypted rootfs
               |-> rootfs
           |-> Many other LVM volumes (some encrypted some not)

Here GRUB cannot boot it despite being encrypted with LUKS1 and encryption algorithm compatible with GNU Boot.

When I try 'o' in the GRUB payload, I then end up on the same menu than you (the one in gnubootgrub.jpg).

I use Parabola on this HDD and I modified the Parabola /etc/default/grub and added 'GRUB_ENABLE_CRYPTODISK=y', 'GRUB_TERMINAL_INPUT=console', 'GRUB_TERMINAL_OUTPUT=console' and 'GRUB_PRELOAD_MODULES="part_gpt part_msdos lvm"' inside and it and then it can boot with SeaBIOS:

> SeaBIOS (version rel-1.14.0-28-g185d177c)
> Machine UUID xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxx
>
> Press ESC for boot menu.
>
> Booting from Hard Disk...
> GRUB loading...
> Welcome to GRUB!
>
> Enter passphrase for lvm/[...] ([...]): []


Here SeaBIOS finds the Parabola GRUB and just runs it. But then I had to modify /etc/default/grub to make the graphics work and enable the Parabola GRUB to find the partitions.

So here the problem probably comes from the GRUB configuration we ship in GNU Boot.

I tried to use 'cryptomount -a' to open my rootfs in the GNU Boot GRUB, and then pressed 'ESC' to get back to the menu and selected 'o', and then it finds my Parabola GRUB configuration and it boots.

So my suposition is that by default it doesn't try to decrypt LVM partitions somehow.

GNUtoo <gnutoo>
Group administrator
Mon 24 Jun 2024 09:58:47 AM UTC, comment #3: 

propos initialĀ :

> Test images:
> seabios_grubfirst_ga-g41m-es2l_libgfxinit_txtmode_usqwerty.rom
> seabios_withgrub_ga-g41m-es2l_libgfxinit_txtmode_usqwerty.rom
> They work,but the grubfirst one can't not find the GNU/Linux that use lvm,i need to manually boot from grub2 command line.
> It seems to grub2 payload don't work at this motherboard.(you can just only use the grub2 command line.)


Thanks for testing and reporting this issue.

Adrien Bourmault <neox>
Group administrator
Fri 03 May 2024 09:44:39 AM UTC, comment #2: 


comment #1:

> grub2 payload got this error message:
> +error: variable `prefix' isn't set.+
>
>



WodeShengli <wodeshengli>
Fri 03 May 2024 09:42:20 AM UTC, comment #1: 

grub2 payload got this error message:
+error: variable `prefix' isn't set.+


WodeShengli <wodeshengli>
Tue 30 Apr 2024 02:49:14 PM UTC, original submission:  

Test images:
seabios_grubfirst_ga-g41m-es2l_libgfxinit_txtmode_usqwerty.rom
seabios_withgrub_ga-g41m-es2l_libgfxinit_txtmode_usqwerty.rom
They work,but the grubfirst one can't not find the GNU/Linux that use lvm,i need to manually boot from grub2 command line.
It seems to grub2 payload don't work at this motherboard.(you can just only use the grub2 command line.)

WodeShengli <wodeshengli>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

Attached Files
file #56210:  0001-commands-ls-add-set.patch added by gnutoo (8KiB - application/octet-stream)
file #56003:  IMG_20240503_170758.jpg added by wodeshengli (696KiB - image/jpeg - grub2 payload get this error)
file #56001:  gnubootgrub.jpg added by wodeshengli (839KiB - image/jpeg - Work)
file #56002:  gnubootseabios.jpg added by wodeshengli (682KiB - image/jpeg - Work)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by gnutoo (Posted a comment)
  • -email is unavailable- added by neox (Posted a comment)
  • -email is unavailable- added by wodeshengli (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 16 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2024-11-13 gnutoo StatusFixed In Progress
        Open/ClosedClosed Open
    2024-09-08 neox StatusConfirmed Fixed
        Open/ClosedOpen Closed
    2024-06-26 gnutoo Attached File- Added 0001-commands-ls-add-set.patch, #56210
    2024-06-26 gnutoo CategoryNone Usability issue
    2024-06-26 gnutoo SummaryGRUB2 not finding (encrypted) LVM volumes. Was: GRUB2 not finding GNU/Linux on Gigabyte GA-G41M-ES2l (0.1-rc3) LVM2 doesn't work. Was: GRUB2 not finding GNU/Linux on Gigabyte GA-G41M-ES2l (0.1-rc3)
    2024-06-25 gnutoo StatusNeed Info Confirmed
        SummaryGRUB2 not finding GNU/Linux on Gigabyte GA-G41M-ES2l (0.1-rc3) GRUB2 not finding (encrypted) LVM volumes. Was: GRUB2 not finding GNU/Linux on Gigabyte GA-G41M-ES2l (0.1-rc3)
    2024-06-24 neox StatusNone Need Info
        Assigned toNone gnuboot-maintainers
    2024-06-24 neox Severity3 - Normal 4 - Important
    2024-06-24 neox SummaryGigabyte GA-G41M-ES2l 0.1-rc3 tested GRUB2 not finding GNU/Linux on Gigabyte GA-G41M-ES2l (0.1-rc3)
    2024-05-03 wodeshengli Attached File- Added IMG_20240503_170758.jpg, #56003
    2024-05-03 wodeshengli Attached File- Added gnubootgrub.jpg, #56001
        Attached File- Added gnubootseabios.jpg, #56002

    Back to the top

    Powered by Savane 3.14-3b9d.
    Corresponding source code