My /etc/default/grub file has decided to play hide-and-seek.
Last time I edited that file, I added parameters for unlocking my luks drive with tang authentication.
Tang decrypt is working fine, computer is booting fine, everything works. I wasn’t even aware of a problem until I needed to add some kernel parameters…
- Contents of /etc/default/grub is not the usual one. Instead I get a file made up of concatenated files from /etc/grub.d/.
- My dnf upgrades run fine but nothing updates. I just “upgraded” to 6.7.4 kernel from some version of 6.6 apparently but uname -r still shows me on 6.5.6 kernel.
- cat /proc/cmdline shows that I booted with the cmdline params that I set way back when I edited grub file last.
- I no longer get grub boot options.
Where’s my grub file hiding?
Note: This is a relatively fresh install of F39. It was installed on a blank disk (not an F38 upgrade)
Did you by chance make an error in running the grub2-mkconfig command after editing /etc/default/grub and possibly overwrote that file?
ls -l /etc/default/ should reveal the date of that file as Nov 9 with a size of 242 bytes if it is the original file as installed, and it should be relatively close in size even if edited. A large difference in size might indicate that it was totally overwritten.
The file seems to be provided by the grub2-tools package so the original content as installed should be recovered by removing that file then reinstalling the source package.
sudo rm -f /etc/default/grub && sudo dnf reinstall grub2-tools
You then could edit the file and restore the command line options you wish then update grub with
sudo grub2-mkconfig -o /boot/grub2/grub.cfg
/etc/default/grub is owned by
grub2-utils, the contents are not provided or created by that package. The file is created during initial installation by
anaconda. To restore it you need a backup, or you can get it from another similar system.
Mine looks like this
GRUB_DISTRIBUTOR="$(sed 's, release .*$,,g' /etc/system-release)"
GRUB_CMDLINE_LINUX may need to be customized to mach your actual system.