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
Created attachment 233015 [details, diff] lvm2 udev rules patch
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.
Created attachment 233195 [details, diff] make grub2 follow symbolic links in /dev/mapper/
I'm not getting any symlink message here. Running latest udev and lvm2 from ~. What are these messages?
(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.
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?
> "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.
(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.
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().
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. ------------------------------------------------------------
@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
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.