user@argobox:~/journal/2025-09-25-the-grub-that-forgot-everything
$ cat entry.md

The GRUB That Forgot Everything

○ NOT REVIEWED

The GRUB That Forgot Everything

Date: 2025-09-25 Duration: About an hour of GRUB archaeology Issue: Deleted corrupted GRUB, now nothing works Root Cause: Missing scripts, wrong NVIDIA parameters, empty configs


The Starting Point

GRUB was corrupted. I deleted it. Classic move.

Now I needed to rebuild it from scratch on openSUSE Tumbleweed. Multi-boot system with Windows, CachyOS, Nobara, and the openSUSE install. RTX 4070 Ti that tends to hang at boot if you look at it wrong.


The First Problem

Ran grub2-mkconfig. Got essentially nothing back.

Checked /etc/grub.d/:

ls /etc/grub.d/
# (empty)

The entire directory was empty. All the scripts that generate menu entries — 00_header, 10_linux, everything — just gone.

The package was installed according to zypper, but the files weren’t there.


The Fix for Empty Scripts

sudo zypper in -f grub2-common

Force reinstall grub2-common. That’s where all the generation scripts live.

Suddenly:

ls /etc/grub.d/
00_header  05_savedefault  10_linux  20_linux_xen  30_os-prober  40_custom  41_custom  80_suse_btrfs_snapshot  90_persistent

The directory repopulated. Now GRUB had something to work with.


The Second Problem

Ran grub2-mkconfig again:

Found linux image: /boot/vmlinuz-6.16.8-1-default
Found initrd image: /boot/initrd-6.16.8-1-default
Warning: os-prober will not be executed to detect other bootable partitions.

It found the openSUSE kernels but nothing else. Windows, CachyOS, Nobara — all invisible.

os-prober was disabled.


Enabling os-prober

In /etc/default/grub:

GRUB_DISABLE_OS_PROBER=false

Also needed to make sure os-prober was installed:

sudo zypper install os-prober

Regenerated:

Found Windows Boot Manager on /dev/nvme1n1p1@/EFI/Microsoft/Boot/bootmgfw.efi
Found CachyOS (rolling) on /dev/nvme1n1p7
Found Nobara Linux 42 (KDE Plasma Desktop Edition) on /dev/nvme1n1p9

All four operating systems detected.


The Third Problem: NVIDIA Parameters

I had been using:

GRUB_CMDLINE_LINUX_DEFAULT="quiet nvidia.modeset=0 rd.driver.blacklist=nouveau"

The system boots, but sometimes hangs. Sometimes the display doesn’t initialize. Classic NVIDIA lottery.

Then I remembered: there should be backup files.

ls /etc/default/grub*
grub  grub.bak  grub.old

Checked grub.bak:

GRUB_CMDLINE_LINUX_DEFAULT="quiet rd.driver.blacklist=nouveau nvidia_drm.modeset=1"

Wait. The working configuration used nvidia_drm.modeset=1. Not nvidia.modeset=0.

These are completely opposite approaches:

  • nvidia.modeset=0 — Disable modesetting, fall back to basic mode
  • nvidia_drm.modeset=1 — Enable DRM kernel mode setting, use proper NVIDIA driver

I had been fighting the wrong battle. The system was designed for full NVIDIA DRM support, and I was forcing it into compatibility mode.


The Correct Configuration

Updated /etc/default/grub:

GRUB_DEFAULT=0
GRUB_TIMEOUT=10
GRUB_CMDLINE_LINUX_DEFAULT="quiet rd.driver.blacklist=nouveau nvidia_drm.modeset=1"
GRUB_TERMINAL="gfxterm"
GRUB_GFXMODE="1920x1080"
GRUB_DISABLE_OS_PROBER=false

Regenerated GRUB:

sudo grub2-mkconfig -o /boot/grub2/grub.cfg
sudo grub2-mkconfig -o /boot/efi/EFI/opensuse/grub.cfg

Installed to both EFI and legacy:

sudo grub2-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=opensuse
sudo grub2-install --target=i386-pc /dev/nvme1n1

The Theme Situation

After all that, GRUB worked but looked terrible. Plain text menu. No graphics.

The backup showed:

GRUB_THEME="/boot/grub2/themes/darkmatter/theme.txt"

That theme was gone too. But I had a Solara-left theme downloaded:

sudo cp -r /home/argo/Downloads/Solara-left-grub-themes/1080p/Solara-left /boot/grub2/themes/
sudo chmod -R 755 /boot/grub2/themes/Solara-left

Added to GRUB config:

GRUB_THEME="/boot/grub2/themes/Solara-left/theme.txt"
GRUB_GFXPAYLOAD_LINUX="keep"

Regenerated again. GRUB now shows:

Found theme: /boot/grub2/themes/Solara-left/theme.txt

Graphical boot menu restored.


What I Learned

Backup files are gold. The .bak file in /etc/default/ had the working NVIDIA parameters I’d forgotten about. Check for backups before guessing.

nvidia_drm.modeset=1 vs nvidia.modeset=0 are opposites. One enables DRM support, the other disables modesetting entirely. Know which one your system expects.

grub2-common contains the scripts. If /etc/grub.d/ is empty after GRUB corruption, reinstall that package.

os-prober is disabled by default. Set GRUB_DISABLE_OS_PROBER=false for multi-boot systems.

GRUB needs both configs on UEFI. Generate to both /boot/grub2/grub.cfg and /boot/efi/EFI/opensuse/grub.cfg.


The Recovery Reference

For future openSUSE GRUB rebuilds:

# Restore missing scripts
sudo zypper in -f grub2-common

# Enable multi-boot detection
# In /etc/default/grub: GRUB_DISABLE_OS_PROBER=false

# Check for backup configs
ls /etc/default/grub*
cat /proc/cmdline  # Current working parameters

# Regenerate
sudo grub2-mkconfig -o /boot/grub2/grub.cfg
sudo grub2-mkconfig -o /boot/efi/EFI/opensuse/grub.cfg

# Install bootloader
sudo grub2-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=opensuse

Deleted GRUB, rebuilt it wrong three times, found the answer in a backup file. The working config was there the whole time.