Bug 842150 - grub2-mkconfig keeps adding rd.lvm=0 but root is on lvm
grub2-mkconfig keeps adding rd.lvm=0 but root is on lvm
Status: CLOSED NOTABUG
Product: Fedora
Classification: Fedora
Component: grub2 (Show other bugs)
17
x86_64 Linux
unspecified Severity unspecified
: ---
: ---
Assigned To: Peter Jones
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-07-22 10:48 EDT by Fred van Zwieten
Modified: 2012-07-23 07:45 EDT (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-07-23 07:45:58 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Fred van Zwieten 2012-07-22 10:48:09 EDT
Description of problem:
I have moved my physical install into an LV using dd. Once I booted into it and ran grub2-mkconfig and grub2-install the grub.cfg file has only entries in it with rd.lvm=0. This result in not being able to boot and be dropped in the dracut shell. Removing the rd.lvm=0 from within the grub-menu works and gives a succesfull boot.

Version-Release number of selected component (if applicable):
grub2-tools-2.0-0.37.beta6.fc17.x86_64
grub2-2.0-0.37.beta6.fc17.x86_64

How reproducible:
Move complete install (including /boot) into LVM and build and install a new GRUB2

Steps to Reproduce:
1. dd partitions into prepped LV's
2. prep new fstab on the target root lv
3. change uuid on LV's to cope with duplicate uuid's
4. run grub2-mkconfig -o /boot/grub2/grub.cfg (old install)
5. boot into new install
6. remove old partitions
7. run grub2-mkconfig -o /boot/grub2/grub.cfg (new install)
8. run grub2.install /dev/sda
9. reboot
  
Actual results:
dropped into dracut shell

Expected results:
normal boot

Additional info:
As said, removing the rd.lvm=0 from the kernel line in grub.cfg makes it work. So, somehow, grub2-mkconfig (or os-prober) finds the os, the os lives on lvm, but still "rd.lvm=0" is added to the kernel line.
Comment 1 Mads Kiilerich 2012-07-23 06:43:38 EDT
What is the content of /etc/default/grub ?
Comment 2 Fred van Zwieten 2012-07-23 07:13:15 EDT
GRUB_TIMEOUT=5
GRUB_DISTRIBUTOR="Fedora"
GRUB_DEFAULT=saved
GRUB_CMDLINE_LINUX="rd.md=0 rd.lvm=0 rd.dm=0 SYSFONT=True  KEYTABLE=us rd.luks=0 LANG=en_US.UTF-8 rhgb quiet"
#GRUB_THEME="/boot/grub2/themes/system/theme.txt"


Ah, I didn't know about this file.

However, it's still not very userfriendly. grub2-mkconfg *should* autodetect that root is on lvm and act accordingly, imho.
Comment 3 Mads Kiilerich 2012-07-23 07:45:58 EDT
anaconda is responsible for creating the initial setup and tying the parts together. It creates this file to pass custom command line options to dracut to optimize it. If you "install" or make basic changes to your installation without using anaconda then you have to do everything that anaconda would have done - including updating this file.

I don't think it is feasible for grub to detect that the initrd is using dracut and automagically figure out which dracut options would be appropriate.

It seems to me like it would be better if the "need" for these command line options could be fixed differently. Either by dracut using them on demand without any boot time overhead or by being applied when dracut-the-tool generates the initrd.

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