Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 321569 - sys-fs/lvm2-2.02.64: fix grub2 support
Summary: sys-fs/lvm2-2.02.64: fix grub2 support
Status: RESOLVED WONTFIX
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High normal with 1 vote (vote)
Assignee: Robin Johnson
URL: http://www.mail-archive.com/debian-bu...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-05-26 15:48 UTC by Fabio Erculiani (RETIRED)
Modified: 2010-05-28 21:20 UTC (History)
3 users (show)

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


Attachments
lvm2 udev rules patch (lvm2-2.02.64-grub2-udev-rules-fix.patch,613 bytes, patch)
2010-05-26 15:49 UTC, Fabio Erculiani (RETIRED)
Details | Diff
make grub2 follow symbolic links in /dev/mapper/ (grub-1.98-follow-dev-mapper-symlinks.patch,1.53 KB, patch)
2010-05-28 03:26 UTC, Chris Coleman
Details | Diff
make grub2 follow symbolic links in /dev/mapper/ (grub-1.98-follow-dev-mapper-symlinks.patch,1.59 KB, patch)
2010-05-28 17:31 UTC, Chris Coleman
Details | Diff
make grub2 follow symbolic links in /dev/mapper/ (from upstream) (grub-1.98-follow-dev-mapper-symlinks-upstream.patch,793 bytes, patch)
2010-05-28 18:26 UTC, Chris Coleman
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Fabio Erculiani (RETIRED) gentoo-dev 2010-05-26 15:48:23 UTC
On a lvm2 rootfs, grub-probe fails to detect "/", making grub-mkconfig fail.
The problem is caused by some udev rules updates that have been merged into latest lvm2 builds. The attached patch restores the previous /dev/mapper device files and makes grub2 happy. Grub2 is unable to read devices or whatever it does through symlinks. Googling a bit, it looks like upstream (grub) is aware but didn't take any action yet.

Reproducible: Always
Comment 1 Fabio Erculiani (RETIRED) gentoo-dev 2010-05-26 15:49:15 UTC
Created attachment 233015 [details, diff]
lvm2 udev rules patch
Comment 2 Chris Coleman 2010-05-28 01:44:00 UTC
I worked around this bug by modifying grub2 so that it does not ignore the /dev/dm-x devices. Not a perfect solution, but it worked.

I've just reverted that and applied your patch to lvm2. It works, but I now get lots of annoying messages about symlinks at startup and shutdown.

I think I'll leave the symlinks in /dev/mapper/ and patch grub2. It should treat those symlinks as block devices.

Comment 3 Chris Coleman 2010-05-28 03:26:22 UTC
Created attachment 233195 [details, diff]
make grub2 follow symbolic links in /dev/mapper/
Comment 4 Fabio Erculiani (RETIRED) gentoo-dev 2010-05-28 04:58:20 UTC
I'm not getting any symlink message here. Running latest udev and lvm2 from ~. What are these messages?
Comment 5 Chris Coleman 2010-05-28 05:47:45 UTC
(In reply to comment #4)
> I'm not getting any symlink message here. Running latest udev and lvm2 from ~.
> What are these messages?
> 

I didn't log the messages and I have a different setup now, but I grepped the source code with what I remembered of the shutdown messages:

"The link %s should have been removed by udev but it is still present. Falling back to direct link removal."

I had that message for each of my logical volumes. It is the output of lvchange -a n being called by /etc/init.d/lvm.

If you insist, I could recreate the conditions and let you know what the startup messages were.
Comment 6 Fabio Erculiani (RETIRED) gentoo-dev 2010-05-28 05:58:01 UTC
weird, I didn't get those warnings at first. I am for fixing grub2 too (rather than playing with easy-to-break udev rules), would it be possible to have your grub2 patch reviewed upstream prior to adding to our ebuild?
Comment 7 Chris Coleman 2010-05-28 06:09:49 UTC
> "The link %s should have been removed by udev but it is still present. Falling
> back to direct link removal."

Sorry, that actually was not the right message. I reapplied your patch. On startup I get messages like:

udevd-work[288]: kernel provided name 'dm-10' and NAME= 'mapper/vg-foo' disagree, please use SYMLINK+= or change the kernel to provide the proper name

And on shutdown:

Node /dev/mapper/vg-foo was not removed by udev. Falling back to direct node removal.
Comment 8 Chris Coleman 2010-05-28 06:30:55 UTC
(In reply to comment #6)
> weird, I didn't get those warnings at first. I am for fixing grub2 too (rather
> than playing with easy-to-break udev rules), would it be possible to have your
> grub2 patch reviewed upstream prior to adding to our ebuild?
> 

I've attached the patch to the upstream bug: https://savannah.gnu.org/bugs/index.php?29697

Though I'm not sure that this patch offers the best solution.
Comment 9 Chris Coleman 2010-05-28 17:31:14 UTC
Created attachment 233301 [details, diff]
make grub2 follow symbolic links in /dev/mapper/

A minor improvement. Using realpath() was a bit inelegant when I could have simply used stat() instead of lstat().
Comment 10 Chris Coleman 2010-05-28 18:26:27 UTC
Created attachment 233317 [details, diff]
make grub2 follow symbolic links in /dev/mapper/ (from upstream)

This has now been fixed upstream (in bzr). The patch is almost identical to mine.

------------------------------------------------------------
revno: 2403 [merge]
committer: Colin Watson <cjwatson@ubuntu.com>
branch nick: grub
timestamp: Fri 2010-05-28 13:21:30 +0100
message:
  Make grub-probe work with symbolic links under /dev/mapper as well
  as with real block devices.  The Linux world seems to be (at best)
  in transition here, and GRUB shouldn't get caught in the middle.
  * kern/emu/getroot.c (find_root_device): Follow symbolic links under
  /dev/mapper.
------------------------------------------------------------
Comment 11 Fabio Erculiani (RETIRED) gentoo-dev 2010-05-28 18:36:06 UTC
@robbat2, can I add it as well as other 1.98 patches (available [1]) taken from ubuntu?

[1] http://gitweb.sabayon.org/?p=overlay.git;a=tree;f=sys-boot/grub/files/ubuntu-upstream-1.98;hb=HEAD

Comment 12 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2010-05-28 21:20:54 UTC
lxnay:
I only maintain grub1. Ask vapier for grub2, but should be ok.

I'm going to close this since I think fixing Grub is better too, and the udev change has other side-effects.