3

I'm running Fedora 31 and when I installed it (F29) I added the option mem_sleep_default=deep to GRUB_CMDLINE_LINUX_DEFAULT in /etc/default/grub. Now I wanted to remove that option but found the file like this:

GRUB_TIMEOUT=5
GRUB_DISTRIBUTOR="$(sed 's, release .*$,,g' /etc/system-release)"
GRUB_DEFAULT=saved
GRUB_DISABLE_SUBMENU=true
GRUB_TERMINAL_OUTPUT="console"
GRUB_CMDLINE_LINUX=""
GRUB_DISABLE_RECOVERY="true"
GRUB_ENABLE_BLSCFG=true

I remember there have been many more options like rd.lvm.lv or rd.luks.uuid which luckily still are in /boot/efi/EFI/fedora/grub.cfg but I can't find them anywhere else.

I think things might have changed since the upgrade to F30 or F31. Also I noticed that GRUB_ENABLE_BLSCFG=true might mean that things are done different now. I read that I shouldn't use grub2-mkconfig any more but grubby to change kernelopts. But I fear to loose all my kernelopts which I think are important.

So what is the correct way to handle this?

2

I believe the recommended approach is to use grubby:

grubby --update-kernel=ALL --args="mem_sleep_default=deep"

will add the given argument to the kernel command line, and

grubby --update-kernel=ALL --remove-args=mem_sleep_default

will remove it.

grubby minimises the changes made, and when updating kernel parameters, the above will preserve the other parameters (based on those used to boot the currently-running kernel).

/etc/default/grub isn’t necessarily the reference file for boot parameters; AFAICT on EFI systems you should look at /boot/efi/EFI/fedora/grubenv (or rather, /boot/grub2/grubenv).

See the GRUB 2 wiki page on the Fedora wiki for some complementary information.

| improve this answer | |

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.