How to fix grub2 run level?

I pressed “e” to edit my run level and change it to 3 temporarily. The problem is that the change got saved somehow

I now have to re-edit grub at every boot to remove the “3”. How do I remove it permanently?

you can try recreating grub config as mentioned in The GRUB2 Bootloader – Installation and Configuration :: Fedora Docs

Also, you can check “/etc/grub.d/10_linux” for the run level. It could be saved in this file. Edit it as you want it and recreate your grub config.

The boot options with the “3” is permanently stored in the files found in /boot/loader/entries/. When installing a new kernel, these settings are taken from the file /etc/kernel/cmdline or, if this file is missing, from the current used boot options as found in /proc/cmdline. When running grub2-mkconfig, the setting in /etc/default/grub is used to create /etc/kernel/cmdline unless /etc/kernel/cmdline is actually newer than /etc/default/grub.

All of that is handled by the grubby --args command as documented in the manual pages for grubby. Run man grubby to display that page.

1 Like

This should fix the problem

sudo systemctl set-default graphical.target

Thanks all for the suggestions.

Unfortunately this didn’t do the trick.

This makes sense, because I had done a routine upgrade which included a new kernel, from run level 3.

I’ll keep editing on boot in the expectation that the next kernel upgrade done from run level 5 will be a permanent fix.

/etc/kernel/cmdline is missing and /proc/cmdline currently lacks the “3” suffix.

That worked a treat. All fixed now.