Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 904228 - sys-boot/grub: Grub fails to detect LVM volumes with: error: disk `lvmid/*/*' not found
Summary: sys-boot/grub: Grub fails to detect LVM volumes with: error: disk `lvmid/*/*'...
Status: CONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal major
Assignee: Mike Gilbert
URL: https://lists.gnu.org/archive/html/gr...
Whiteboard:
Keywords: PATCH
Depends on:
Blocks:
 
Reported: 2023-04-12 13:14 UTC by Horst Prote
Modified: 2024-08-03 20:59 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Patch (grub-2.06-lvm-volumes.patch,433 bytes, patch)
2023-04-12 13:14 UTC, Horst Prote
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Horst Prote 2023-04-12 13:14:18 UTC
Created attachment 859936 [details, diff]
Patch

See also https://savannah.gnu.org/bugs/?func=detailitem&item_id=61620
and https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=987008

Citation from the svannah.gnu.org Bug:
When handling a regular LVM volume, Grub can fail with the message:
error: disk `lvmid/******-****-****-****-****-****-
****/******-****-****-****-****-****-******' not found.

If the condition which triggers this exists, grub-probe will report the error mentioned above. Similarly, the grub boot code will fail to detect LVM volumes, resulting in a failure to boot off of LVM disks/partitions. The condition can be created on any LVM VG by an LVM configuration change, so any system with /boot on LVM can become unbootable at 'any' time (after any LVM configuration change).

==== Cause ===
The problem is caused by an incorrect computation of mda_end in lvm.c, when the metadata area wraps around.
--- Citation End ---

I was hit by this yesterday, then tried the proposed fix on grub-2.06-r6 (see attached patch) which worked for me.
Comment 1 Mike Gilbert gentoo-dev 2024-04-03 02:42:36 UTC
I'm not comfortable applying this patch without upstream review. Please submit it to to the grub-devel mailing list.
Comment 3 Mike Gilbert gentoo-dev 2024-08-03 16:36:04 UTC
Please submit the patch to the grub-devel list. Sending a link to their issue tracker will not suffice.
Comment 4 Horst Prote 2024-08-03 19:32:16 UTC
Already did it in April (https://lists.gnu.org/archive/html/grub-devel/2024-05/msg00010.html). Although my patch had some formal issues thankfully Glenn Washburn "created a suitable patch for review" (https://lists.gnu.org/archive/html/grub-devel/2024-05/msg00040.html) and in the last message of that thread (May 08, 2024) Michael Chang wrote:
=================== citation start ===================
The number of times to commit a wrap actually depends on the size of the
metadata area, how many LVs and VGs are connected to the PV and
whichever would take part in the size of active raw metadata block
within the area.

I managed to use the attached shell script to prepare a LVM disk where
the metadata area is in wrapped state. It took about 100 cycles for me.
With that, I could see the error occurred, and with the patch, the
problem is gone.

So, Feel free to add my: 

Tested-By: Michael Chang <mchang@suse.com>
=================== citation end ===================