Ask Your Question
0

grub2-mkconfig missing parameters?

asked 2018-11-24 00:37:35 -0500

updated 2018-11-24 09:45:12 -0500

Hello,

I'm completely inexperienced with grub, so I am confused why this is happening:

I chose to encrypt my root and home partitions when I installed Fedora 28 (now upgraded to 29).

My /etc/sysconfig/grub did not contain anything special, with GRUB_CMDLINE_LINUX="".

Then, I followed this guide on how to uninstall the nvidia driver because it stopped working on my machine with the 4.19.2 kernel.

I deleted the text rd.driver.blacklist=nouveau and a duplicate GRUB_CMDLINE_LINUX= line at the end, and etc. There may be some changes that I mistakenly made.

Edit: to clarify, I had two separate lines: GRUB_CMDLINE_LINUX="" and GRUB_CMDLINE_LINUX=. I simply deleted the latter.

Now, the linux line in grub after running grub2-mkconfig changed from

linux /vmlinuz-<version root=/dev/mapper/fedora_localhost--live-root ro resume/dev/mapper/fedora_localhost--live-swap rd.md.uuid=<uuid> rd.lvm.lv=fedora_localhost-live/root rd.md.uuid=<uuid> rd.luks.uuid=<luks-uuid> rd.lvm.lv=fedora_localhost-live/swap

to

linux /vmlinuz-<version root=/dev/mapper/fedora_localhost--live-root ro

For now, I manually added back the missing parameters in GRUB_CMDLINE_LINUX, but I shouldn't have to do that in the first place (unless my memory is wrong). How would I fix this?

edit retag flag offensive close merge delete

Comments

What is the content of that duplicate GRUB_CMDLINE_LINUX= line?

Or better yet. Copy-paste the entire /etc/default/grub into your question.

villykruse gravatar imagevillykruse ( 2018-11-24 02:47:46 -0500 )edit

@villykruse there was an empty GRUB_CMDLINE_LINUX= (verbatim) at the end of the file. Will paste the content when I get access to my computer.

JungHwan Min gravatar imageJungHwan Min ( 2018-11-24 03:21:18 -0500 )edit

... which erases or overrides the earlier GRUB_CMDLINE_LINUX= entry.

villykruse gravatar imagevillykruse ( 2018-11-24 05:44:01 -0500 )edit

@villykruse and I had had the line the whole time, and there were no missing boot options. I deleted the line, not added. Prior to deleting the line, I had the boot options that I needed.

JungHwan Min gravatar imageJungHwan Min ( 2018-11-24 09:38:23 -0500 )edit

2 Answers

Sort by » oldest newest most voted
1

answered 2019-01-28 01:23:09 -0500

FeRDNYC gravatar image

For now, I manually added back the missing parameters in GRUB_CMDLINE_LINUX, but I shouldn't have to do that in the first place (unless my memory is wrong). How would I fix this?

No, that's normal — the kernel command line in grub2.cfg will only contain the parameters that it's told to contain, it can't magically divine what those should be. (_grub_ can't, I should say ­— determining the contents of the kernel command line is anaconda's job.)

The real question is, why _didn't_ you have a line in /etc/default/grub containing:

GRUB_CMDLINE_LINUX="resume/dev/mapper/fedora_localhost--live-swap rd.md.uuid=<uuid> rd.lvm.lv=fedora_localhost-live/root rd.md.uuid=<uuid> rd.luks.uuid=<luks-uuid> rd.lvm.lv=fedora_localhost-live/swap"

Anaconda should've written it there when it installed the system originally. Perhaps something along the way deleted it (some script mangled it during the installation/removal of the nvidia driver, perhaps?

In fact, that uninstall procedure you linked to even contains this:

Remove ‘rd.driver.blacklist=nouveau’ from end of ‘GRUB_CMDLINE_LINUX=”…”‘

 ## Example row ##
 GRUB_CMDLINE_LINUX="rd.lvm.lv=fedora/swap rd.lvm.lv=fedora/root rhgb quiet"

So, as you can see, command-line arguments like the ones you inserted were expected to already be there.

/etc/default/grub is only used when manually regenerating the grub.cfg. The grubby tool that handles kernel updates simply copies existing entries to create new ones, it doesn't use the grub2 tools at all. So, that explains why your GRUB_CMDLINE_LINUX could be missing the proper arguments, without it affecting anything until you ran grub2-mkconfig.

edit flag offensive delete link more
0

answered 2018-11-24 05:46:41 -0500

villykruse gravatar image

The last occurence of a GRUB_CMDLINE_LINUX= line will replace any earlier occurences of the same line. Thus, an empty GRUB_CMDLINE_LINUX="" at the end will make the final command line empty.

edit flag offensive delete link more

Comments

I had the line this entire time, so this is definitely not the cause. I had two lines, one with GRUB_CMDLINE_LINUX="" and one with GRUB_CMDLINE_LINUX=. I deleted the latter because I know it just overrides the previous one (which doesn't do anything). Plus, before I deleted the line, my boot options were still there.

JungHwan Min gravatar imageJungHwan Min ( 2018-11-24 09:39:14 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2018-11-24 00:36:41 -0500

Seen: 132 times

Last updated: Jan 28