Bug 2217551 - grub2-mkconfig fails to generate configuration after renaming volume group
Summary: grub2-mkconfig fails to generate configuration after renaming volume group
Keywords:
Status: NEW
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: lvm2
Version: 7.9
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: LVM Team
QA Contact: cluster-qe
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2023-06-26 16:38 UTC by CJ Travers
Modified: 2023-08-10 15:39 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed:
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker RHELPLAN-160804 0 None None None 2023-06-26 16:40:51 UTC

Description CJ Travers 2023-06-26 16:38:03 UTC
Description of problem:
After renaming logical volumes using vgrename, grub2-mkconfig fails to generate a new configuration file with the message: "/usr/sbin/grub2-probe: error: failed to get canonical path of /dev/mapper/somevg_somelv". The error appears to occur because grub2-probe relies on the names in /dev/mapper to check for bootable logical volumes, and in this situation it fails to do so because the names in /dev/mapper are not updated live by vgrename. This results in requiring updating config files in single user or recovery mode to boot successfully. 

Version-Release number of selected component (if applicable):
grub2-tools-2.02-0.87.el7_9.11.x86_64

How reproducible:
Always

Steps to Reproduce:
1. Rename volume group foo to bar using vgrename
2. Execute grub2-mkconfig -o /boot/efi/EFI/redhat/grub.cfg

Actual results:
/usr/sbin/grub2-probe: error: failed to get canonical path of /dev/mapper/foo-root

Expected results:
grub2-mkconfig completes successfully and generates the new grub.cfg with the updated volume group name.

Additional info:
A workaround can be implemented by editing the GRUB_DEVICE parameter in /usr/sbin/grub2-mkconfig to hard-code the updated path (/dev/mapper/bar-root in this example). Adding " || true" to the line as suggested by some sources results in a blank "root=" boot parameter and a failed boot.


Note You need to log in before you can comment on or make changes to this bug.