How to Change the Default Boot Entry in GRUB2 on Fedora

Change the default GRUB boot entry on Fedora by editing /etc/default/grub and regenerating the configuration.

The boot menu skips your preferred kernel

You upgraded to a new Fedora release and the system boots straight into the old kernel. Or you dual-boot with Windows and the bootloader keeps jumping to the wrong operating system. You hold the Shift key during startup to catch the menu, but you want the system to land on the right entry automatically. The fix lives in a single configuration variable and a regeneration command.

How GRUB picks what to boot

GRUB2 does not guess your preference. It reads a compiled configuration file at /boot/grub2/grub.cfg every time the firmware hands over control. That file is never edited by hand. It is generated from templates and variables stored in /etc/default/grub. The GRUB_DEFAULT variable tells the bootloader which menu entry to highlight and boot when the timeout expires. Think of it like setting the default channel on a remote. The remote still shows all the channels, but it starts on the one you specified.

Fedora ships with GRUB_DEFAULT=saved in many configurations. The saved keyword tells GRUB to remember the last entry you manually selected. When you use saved, GRUB writes your choice to a small state file at /boot/grub2/grubenv. The next boot reads that file and jumps to the recorded entry. If you pick a recovery kernel once, GRUB will boot that recovery kernel every time until you change it again. If you want a fixed entry that never changes, you override saved with an index number or a quoted title.

Convention aside: configuration files in /etc/ are reserved for administrator modifications. Files in /usr/lib/ ship with the package and get overwritten during updates. Always edit /etc/default/grub. Never touch /boot/grub2/grub.cfg directly. The package manager will erase your changes the next time grub2-common updates.

Change the default entry

Open the configuration file with a terminal editor. The file is small and contains only active variables.

sudo nano /etc/default/grub
# Open the file with root privileges to modify bootloader variables
# nano is preinstalled on Fedora Workstation and Server editions

Locate the GRUB_DEFAULT line. Remove the # if it is commented out. Change the value to your target. You have three reliable options.

Use an index number when you want a position-based default. GRUB counts from zero. The first visible menu entry is 0, the second is 1, and so on. Submenus are not counted in the top-level index. If your target lives inside a submenu, you use the parent>child syntax. The entry 1>2 means the second top-level item, then the third item inside that submenu.

Use an exact title when you want a name-based default. The title must match the menu entry string exactly, including parentheses and version numbers. Wrap it in double quotes. Titles are immune to index drift when you install or remove kernels.

Use saved when you want the bootloader to remember your last manual selection. This is the Fedora default for a reason. It survives kernel updates without manual intervention.

Here is how the configuration looks after you set a fixed title as the default.

# /etc/default/grub
# Set the default boot entry to the exact menu title
GRUB_DEFAULT="Fedora Linux (43.20241115.0 (Silverblue))"
# Keep the timeout at five seconds so you can still interrupt the boot
GRUB_TIMEOUT=5
# Disable the saved state so the fixed title takes precedence
GRUB_SAVEDEFAULT=false

Save the file and close the editor. The changes do not apply yet. GRUB reads the compiled configuration, not the template. Run the generator to rebuild the menu.

sudo grub2-mkconfig -o /boot/grub2/grub.cfg
# Regenerate the compiled GRUB configuration from /etc/default/grub
# The -o flag specifies the output path for BIOS systems
# The generator parses /etc/default/grub and applies it to shell scripts in /etc/grub.d/

If you are on a UEFI machine, the output path changes. Run the correct command for your firmware.

sudo grub2-mkconfig -o /boot/efi/EFI/fedora/grub.cfg
# Write the new configuration to the EFI system partition
# UEFI firmware expects the bootloader config in this exact directory
# The generator creates a symlink to the actual config if the path differs

Reboot before you debug. Half the time the symptom is gone.

Verify the new default

Do not guess whether the change took effect. Check the generated configuration file directly. The compiled file contains the set default= directive that GRUB actually reads at startup.

grep "^set default=" /boot/grub2/grub.cfg
# Show the exact default value written to the compiled config
# The output should match your index, title, or saved keyword
# If you see set default=saved, the state file controls the boot target

If you used an index number, verify that the index still points to the right entry. Menu positions shift when you install or remove kernels. Run this command to see the current order.

grep -i menuentry /boot/grub2/grub.cfg | head -10
# List the first ten menu entries to confirm your index matches the target
# Count from zero to verify the position aligns with your GRUB_DEFAULT value
# Submenu headers do not count toward the index unless they are selectable

If the output shows a different entry at your chosen index, update the number or switch to a quoted title. Titles are immune to index drift.

Run the grep command before you reboot. A mismatched index boots the wrong kernel.

Common pitfalls and error messages

The most frequent mistake is using a title that does not match the generated menu exactly. GRUB performs a literal string comparison. Extra spaces, missing quotes, or version number mismatches cause the fallback to entry 0. If your system boots the wrong kernel after a change, check the exact title in the generated config.

menuentry 'Fedora Linux (43.20241115.0 (Silverblue))' --class fedora --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-6.8.9-200.fc40.x86_64-advanced-12345678-1234-1234-1234-1234567890ab' {

Copy the string between the single quotes. Paste it into your GRUB_DEFAULT line wrapped in double quotes. Run the generator again.

Another common issue is a missing output directory. If /boot is on a separate partition and it is not mounted, the generator fails silently or throws a path error.

grub2-mkconfig: error: cannot find /boot/grub2/grub.cfg

Mount the boot partition first. Run findmnt /boot to verify it is active. If it is missing, mount it manually or check your /etc/fstab entries.

UEFI systems sometimes show a different error when the EFI system partition is not mounted at /boot/efi.

grub2-mkconfig: error: cannot find /boot/efi/EFI/fedora/grub.cfg

Mount the EFI partition and rerun the generator. The path must exist before the command writes to it.

Check the mount table before you run the generator. A missing mount point breaks the whole process.

Choose the right default strategy

Use an index number when you are comfortable tracking menu positions and you only boot one operating system. Use an exact title when you dual-boot or install multiple kernels and want the default to survive package updates. Use saved when you want the bootloader to remember your last manual selection and you rarely need a fixed default. Use GRUB_DEFAULT=0 when you want the system to always boot the newest available kernel without manual configuration.

Where to go next