0

I'm trying to add a kernel option "xxx" by adding it to the existing

GRUB_CMDLINE_LINUX="xxxx crashkernel=auto rhgb quiet"

line in /etc/default/grub, but after doing so, when I run

grub2-mkconfig –o /boot/grub2/grub.cfg

it produces exactly the same grub.cfg file as before (confirmed with diff).

What am I missing?

I'm running CentOS Linux release 7.6.1810 (Core)

0

I'm not using CentOS (so can't test it), but this should do it:

GRUB_CMDLINE_LINUX="xxxx crashkernel=auto rhgb quiet ${GRUB_CMDLINE_LINUX}"

1
  • I tried this, ran grub2-mkconfig -o file1, and it produced the desired "xxx" kernel option, previously missing. Then I removed your suggestion and ran grub2-mkconfig -o file2, diff'd the two files, which should have produced the original grub.cfg that I had yesterday, but it did not. Not only is it the same as file1 (both now have my new "xxx" kernel option, with or without your suggestion) but they are different now from my original grub.cfg, the biggest difference being that it's changed all my hd0 to hd2. So now I'm really confused. Nov 11 '19 at 19:35
0

First I would try to make a change in any of the other files in /etc/grub.d You can even make an error on purpose to force grub2-mkconfig to throw an error.

Also make sure you're not copying the command from a script that you may have stored on your computer, or from a website. Type the command grub2-mkconfig –o /boot/grub2/grub.cfg manually.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.