How to permanently hide the GRUB menu in Ubuntu and Kubuntu [26.04]

hide the GRUB menu

When I set up my single-boot rig, I wanted it to boot straight to the desktop. But when I tried to hide the GRUB menu in Ubuntu and Kubuntu, the system actively fought me. Instead of a clean boot, I was stuck staring at the bootloader menu, eventually getting locked into a forced 30 second countdown on every startup.

The Cause

I discovered that Ubuntu-based systems rely on hardcoded safety mechanisms that refuse to be ignored. GRUB overrides your hidden settings if os-prober detects a phantom OS entry in your NVRAM, or if it suspects a system crash via the recordfail script. Because my root partition is formatted as BTRFS without a separate ext4 /boot partition, GRUB physically lacks the ability to clear the crash flag, permanently triggering the fail-safe.

The Solution: You might not have every underlying issue. Apply Step 1. If it doesn't work, proceed down the list until the menu is gone.

Step 1: The Basic Configuration

If you have a perfectly clean single-OS installation, this is all you should run. Open your terminal:

sudo nano /etc/default/grub

Change these lines to match exactly:

GRUB_TIMEOUT_STYLE=hidden
GRUB_TIMEOUT=0

Save the file, run sudo update-grub, and reboot.

  • If it works: You are done. The trade-off is that if you need advanced boot options later, you must manually spam the Esc or Shift key during boot.
  • If the menu is still there: Move to Step 2. GRUB thinks you are dual-booting.

Step 2: Destroying Phantom UEFI Entries (os-prober)

If you previously installed Windows or another distro and wiped the drive, your motherboard's NVRAM usually keeps the dead boot entry. GRUB's os-prober sees this ghost, assumes a dual-boot, and forces the menu.

  1. Run efibootmgr in your terminal and look for a dead OS (e.g., "Boot0001* Windows Boot Manager").
  2. Identify the four-digit hex number.
  3. Delete it by running: sudo efibootmgr -b 0001 -B. Do NOT delete your active Ubuntu entry.

Force GRUB to ignore other OSes entirely. Open /etc/default/grub and add:

GRUB_DISABLE_OS_PROBER=true

Save, run sudo update-grub, and reboot.

If you now get a 30-second countdown: Move to Step 3. You are caught in the BTRFS trap.

Step 3: Bypassing the BTRFS Trap (recordfail)

If you installed your root directory (/) as BTRFS, GRUB cannot write to the filesystem during the early boot phase. Because it cannot write, it cannot change the recordfail=1 flag back to a "successful boot" state in /boot/grub/grubenv. GRUB panics and forces a 30-second fail-safe menu every single time.

Note: Your /boot/efi partition is FAT32. This is a strict UEFI requirement and has nothing to do with this BTRFS limitation. Leave it alone.

I had to tell GRUB to completely ignore the safety net. Open /etc/default/grub and append this line:

GRUB_RECORDFAIL_TIMEOUT=0

Save, run sudo update-grub, and reboot.

Warning: You have permanently killed the crash recovery safety net. If your system loses power or breaks, GRUB will not give you a menu; it will blindly attempt to boot again.

Conclusion: Summary & Next Steps

To guarantee a single-boot system hides its menu—regardless of BTRFS write limitations or phantom UEFI entries—verify your final /etc/default/grub configuration contains these four exact lines:

GRUB_TIMEOUT_STYLE=hidden
GRUB_TIMEOUT=0
GRUB_DISABLE_OS_PROBER=true
GRUB_RECORDFAIL_TIMEOUT=0
Final Verification: Run sudo update-grub one last time to commit all changes to the bootloader.

Post a Comment

Previous Post Next Post