Fix grub from fedora 39 live usb

I have an nvidia gpu on fedora 39 (kde spin) and a recent ‘dnf upgrade’ caused the nvidia drivers to crash when loading plasma.

I tried restoring the nouveau drivers by removing the nvidia drivers and rebooting. However, the nouveau drivers did not load and I still could not start plasma.

I noticed that the nouveau drivers were blacklisted in my grub config (with rd.driver.blacklist=nouveau modprobe.blacklist=nouveau specified in GRUB_CMDLINE_LINUX), so I edited /etc/default/grub and removed those blacklist entries then tried to update grub (UEFI) with:

sudo grub2-mkconfig -o /boot/grub2/grub.cfg.

I think this command was not correct for my system as now it will not even get past the splash screen when booting.

I had made a backup of the old grub file in /etc/default/grub and I don’t know if the presence of that file in the directory could be causing an issue, but either way I cannot boot into my system now.

I have found many conflicting instructions on how to repair grub by booting from a live usb/creating a chroot environment and reinstalling grub. What can I do to get my system to boot again? Any help would be greatly appreciated!

Added f39, grub

Can you provide the content of /etc/default/grub for us?

Also, can you boot to the grub menu then edit the kernel command line (begins with linux= to remove rhgb quiet and add 3 at the end of that line so the system will boot to a text screen where more info can be obtained.

Thanks very much for your response. Here is /etc/default/grub:

GRUB_TIMEOUT=5
GRUB_DISTRIBUTOR="$(sed 's, release .*$,,g' /etc/system-release)"
GRUB_DEFAULT=saved
GRUB_DISABLE_SUBMENU=true
GRUB_TERMINAL_OUTPUT="console"
GRUB_CMDLINE_LINUX="rhgb quiet"
GRUB_DISABLE_RECOVERY="true"
GRUB_ENABLE_BLSCFG=true

The line GRUB_CMDLINE_LINUX= was previously GRUB_CMDLINE_LINUX="rhgb quiet rd.driver.blacklist=nouveau modprobe.blacklist=nouveau"
(before I removed the two blacklist entries)

I am sorry but I don’t understand how to edit the kernel command line. I can get to the grub boot menu (with different linux kernels to boot into) and at that menu I can press ‘c’ to get to a grub prompt. But after that I’m lost … it’s just a grub prompt so I don’t know what to do at that point!

At the grub menu you press e instead of the ‘c’ which allows you to edit the entries. A prompt should show how to continue booting after performing the edit.
I believe that will be either ‘ctrl-X’ or ‘F10’

It may be more advantageous to use a live media usb for booting since a copy & paste is difficult when in a text screen. We can still see the inxi output from a terminal there. We could also use a chroot environment to see the installed nvidia driver packages.

Ok thanks for explaining - I’m happy to try editing the kernel command line and manually copy the info (unless there’s just too much). Or I can boot from the live media usb if you think that will be best anyway?

Since I removed all the nvidia driver packages before this whole problem occurred, I would guess that there shouldn’t be any of those still installed …

Depending upon how you removed the drivers it is possible that action triggered part of this issue. There is a firmware package (nvidia-gpu-firmware) that is installed by fedora and is often required before the gpu can have a driver loaded and become active.

Please show the output of dnf list installed '*nvidia*' as requested as soon as possible.

I booted from the grub prompt as you described (thanks for showing me how to do that!) and this is the output:

$ dnf list installed "*nvidia*"
Installed Packages
nvidia-gpu-firmware.noarch         20248989-1.fc39         @updates

The version number you show does not appear valid - possibly due to a type.
The current version of that firmware package as updated on my system should be

nvidia-gpu-firmware.noarch                     20240909-1.fc39                        @updates                  

It appears that package is up to date so now the inxi output would be helpful.
You could run that as inxi -Fzxx > myfile.txt then copy the myfile.txt to a usb device and would be able to upload the full output as text here from a different machine.

Please note that very soon f41 will be released and a month later f39 will become EOL so it may be of more advantage to update now to f40 or f41 rather that fight this problem with a release that is soon to become EOL

You could even do the full upgrade from within the text screen you get as you are able to log in right now and the upgrade probably would fix the current problems. Use the method shown at Upgrading Fedora Linux Using DNF System Plugin :: Fedora Docs

I have got the output of the inxi command (luckily I was able to install inxi) which I will paste below.

Re f41 I know that f39 has a very limited life now and am completely with you about the (lack of) value in fighting this problem with a release that is soon to become EOL.

Still, the difficulty is that I am running the KDE spin which now comes with Plasma 6 and despite upgrading to f40 some time ago, I unfortunately needed to reinstall f39 again as there were bugs in Plasma 6 which made the system unusable for me … so I’m hanging on till I have enough time to switch to a different desktop but for now I need to keep my system going as best I can.

I would actually be quite fine with running the nouveau drivers as I can manage without the nvidia drivers for now, so until I have the time to upgrade from f39 I would most like to restore grub/my system to a working version and get my desktop back.

I did check the version number of my installed nvidia-gpu-firmware.noarch and you’re 100% right - my eyesight haha I thought the zeroes were 8’s and it is actually:

nvidia-gpu-firmware.noarch         20240909-1.fc39         @updates

I really appreciate all your help thank you … here is the inxi output:

System:
  Kernel: 6.10.11-100.fc39.x86_64 arch: x86_64 bits: 64 compiler: gcc v: 2.40-14.fc39
  Console: tty 1 DM: SDDM Distro: Fedora Linux 39 (KDE Plasma)
Machine:
  Type: Desktop System: Punch product: 489-487 v: 1.0 serial: <superuser required>
    Chassis: Corsair type: 3 v: Carbide 100R serial: <superuser required>
  Mobo: Micro-Star model: Z370-A PRO (MS-7B48) v: 1.0 serial: <superuser required>
    UEFI: American Megatrends v: 2.31 date: 12/14/2017
Battery:
  Device-1: hidpp_battery_0 model: Logitech Wireless Keyboard K270 serial: <filter>
    charge: 55% (should be ignored) status: discharging
CPU:
  Info: 6-core model: Intel Core i7-8700K bits: 64 type: MT MCP arch: Coffee Lake rev: A cache:
    L1: 384 KiB L2: 1.5 MiB L3: 12 MiB
  Speed (MHz): avg: 800 min/max: 800/4700 cores: 1: 800 2: 800 3: 800 4: 800 5: 800 6: 800
    7: 800 8: 800 9: 800 10: 800 11: 800 12: 800 bogomips: 88796
  Flags: avx avx2 ht lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx
Graphics:
  Device-1: NVIDIA GP106 [GeForce GTX 1060 6GB] vendor: ZOTAC driver: nouveau v: kernel
    arch: Pascal pcie: speed: 2.5 GT/s lanes: 16 ports: active: DP-3 empty: DP-1, DP-2, DVI-D-1,
    HDMI-A-1 bus-ID: 01:00.0 chip-ID: 10de:1c03 temp: 32.0 C
  Display: server: X.org v: 1.20.14 with: Xwayland driver: X: loaded: modesetting,nouveau,vesa
    unloaded: fbdev alternate: nv gpu: nouveau tty: 320x90
  Monitor-1: DP-3 model: Dell P2418D res: 2560x1440 dpi: 124 diag: 604mm (23.8")
  API: EGL Message: No EGL data available.
  API: OpenGL Message: GL data unavailable in console. Try -G --display
  API: Vulkan v: 1.3.275 surfaces: N/A device: 0 type: cpu driver: N/A device-ID: 10005:0000
Audio:
  Device-1: Intel 200 Series PCH HD Audio vendor: Micro-Star MSI driver: snd_hda_intel v: kernel
    bus-ID: 00:1f.3 chip-ID: 8086:a2f0
  Device-2: NVIDIA GP106 High Definition Audio vendor: ZOTAC driver: snd_hda_intel v: kernel
    pcie: speed: 2.5 GT/s lanes: 16 bus-ID: 01:00.1 chip-ID: 10de:10f1
  API: ALSA v: k6.10.11-100.fc39.x86_64 status: kernel-api
  Server-1: PipeWire v: 1.0.8 status: off with: 1: pipewire-pulse status: off 2: wireplumber
    status: off 3: pipewire-alsa type: plugin 4: pw-jack type: plugin
Network:
  Device-1: Realtek RTL8111/8168/8211/8411 PCI Express Gigabit Ethernet vendor: Micro-Star MSI
    driver: r8169 v: kernel pcie: speed: 2.5 GT/s lanes: 1 port: d000 bus-ID: 03:00.0
    chip-ID: 10ec:8168
  IF: enp3s0 state: up speed: 1000 Mbps duplex: full mac: <filter>
  Device-2: Intel Wireless 8265 / 8275 driver: iwlwifi v: kernel pcie: speed: 2.5 GT/s lanes: 1
    bus-ID: 04:00.0 chip-ID: 8086:24fd
  IF: wlp4s0 state: down mac: <filter>
Bluetooth:
  Device-1: Intel Bluetooth wireless interface driver: btusb v: 0.8 type: USB rev: 2.0
    speed: 12 Mb/s lanes: 1 bus-ID: 1-2:2 chip-ID: 8087:0a2b
  Report: btmgmt ID: hci0 rfk-id: 0 state: up address: <filter> bt-v: 4.2 lmp-v: 8
Drives:
  Local Storage: total: 9.56 TiB used: 3.25 TiB (34.0%)
  ID-1: /dev/nvme0n1 vendor: A-Data model: SX8000NP size: 476.94 GiB speed: 31.6 Gb/s lanes: 4
    serial: <filter> temp: 33.9 C
  ID-2: /dev/sda vendor: Western Digital model: WD4003FFBX-68MU3N0 size: 3.64 TiB
    speed: 6.0 Gb/s serial: <filter> temp: 25 C
  ID-3: /dev/sdb vendor: Western Digital model: WD4003FFBX-68MU3N0 size: 3.64 TiB
    speed: 6.0 Gb/s serial: <filter> temp: 25 C
  ID-4: /dev/sdc vendor: Seagate model: ST2000DM006-2DM164 size: 1.82 TiB speed: 6.0 Gb/s
    serial: <filter> temp: 23 C
Partition:
  ID-1: / size: 475.35 GiB used: 49.18 GiB (10.3%) fs: btrfs dev: /dev/nvme0n1p3
  ID-2: /boot size: 973.4 MiB used: 425.1 MiB (43.7%) fs: ext4 dev: /dev/nvme0n1p2
  ID-3: /boot/efi size: 598.8 MiB used: 19 MiB (3.2%) fs: vfat dev: /dev/nvme0n1p1
  ID-4: /home size: 475.35 GiB used: 49.18 GiB (10.3%) fs: btrfs dev: /dev/nvme0n1p3
Swap:
  ID-1: swap-1 type: zram size: 8 GiB used: 0 KiB (0.0%) priority: 100 dev: /dev/zram0
Sensors:
  System Temperatures: cpu: 27.0 C mobo: N/A gpu: nouveau temp: 32.0 C
  Fan Speeds (rpm): N/A gpu: nouveau fan: 1617
Info:
  Memory: total: 32 GiB available: 31.3 GiB used: 919.7 MiB (2.9%)
  Processes: 330 Power: uptime: 2m wakeups: 0 Init: systemd v: 254 target: multi-user (3)
    default: graphical
  Packages: Compilers: gcc: 13.3.1 Shell: Bash v: 5.2.26 running-in: tty 1 inxi: 3.3.34

With what you display there the kernel seems quite old.
The latest kernel for f39 is 6.11.4 with an update I just did today.

That gpu should be quite happy with the latest 560.35.03 driver from rpmfusion.

I would suggest that you first do a full system upgrade with sudo dnf upgrade so you have the latest kernel and all other packages. I would anticipate that your grub issues would be fixed with the kernel upgrade.

There is one other thing I would like to confirm before you do this. We have not discussed if you are booting with uefi or legacy boot. If you do not know then run cat /sys/firmware/efi/efivars. If that returns a notice the file is a directory then you are doing uefi boot. Following a positive confirmation that you are using uefi boot then run sudo cat /boot/efi/EFI/fedora/grub.cfg and it should return something that looks similar to this.

$ sudo cat /boot/efi/EFI/fedora/grub.cfg
search --no-floppy --fs-uuid --set=dev <UUID>
set prefix=($dev)/grub2

export $prefix
configfile $prefix/grub.cfg

If the result is significantly different than this then we have another problem to fix.

Once the system boots properly after the upgrade we can discuss the nvidia drivers themselves.

I have now done a sudo dnf upgrade which went smoothly though I still cannot boot - the process does not get past the splash screen and I need to get to the grub command to boot as before.

I’m a bit surprised that my kernel 6.10.11-100.fc39 was quite old as it was in fact an update which I did yesterday (with sudo dnf upgrade) which then caused my system to crash when attempting to load the desktop.

Anyhow, it does have the new kernel installed now.

I am booting with uefi and sudo cat /boot/efi/EFI/fedora/grub.cfg returns something almost identical to what you have shown, the only difference I can see is that there is an extra switch to the ‘search’ (--root-dev-only) as follows:

search --no-floppy --root-dev-only --fs-uuid --set=dev <UUID>

The other lines are identical.

Are you willing to try something just a bit different?

If so then try these few steps which should work.

  1. sudo rm /boot/grub2/grub.cfg /boot/efi/EFI/fedora/grub.cfg to remove the exiting grub.cfg files.
  2. sudo dnf reinstall grub2-common which should recreate both files based on the current hardware and os status
  3. reboot

If that works as expected the system may boot properly now.

I have executed those commands (1 and 2 above) then rebooted, but unfortunately my system still won’t boot.

If I press spacebar as the system is starting up, it brings up the grub menu (as before) and I can see that the new kernel 6.11.4 is in the grub menu but selecting it has the same issue (gets stuck at the splash screen).

Are you booting any other OS’s?

Kernel and UEFI are both old – best to update so you aren’t wasting time on a problem that has been fixed with newer versions. You can try booting a Fedora 41 Beta Live USB to see if the Plasma 6 problems you had with F40 have been fixed.

I grew up in New Mexico. Before TV the local culture respected elders and the humorous effects of old age were a source of entertainment.

1 Like

We know the kernel is installed now and boots to the splash screen.
This indicates that the issue now may be the graphics drivers.

Can you boot using the 3 added to the kernel command line in the grub edit menu, then go ahead and do the upgrade to fedora 40? If you think that is possible then do it as shown here.

I discourage repairs on f39 since it only has a short time remaining with support. F40 has already been in use for 6 months and most issues have already been solved with software updates over that time period. It also is the version that most seem to be using at present.

Well yes I could hope that Plasma 6 on f41 might work better for me than f40 - as you say worth a try (will do when I can get some time).

No, just fedora.

Totally understand your point of view re fixing a system that is close to EOL - I could try upgrading to see if that works when I can find some time.

Thanks for all your help, will have to accept that my system is broken for now and pick this up when I have a chance!

Added system-recovery