Fedora stopped showing up in GRUB menu

I am particularly new to Linux and recently installed Fedora-36. I had multiple crashes on my first day of usage and decided to install NVIDIA drivers to fix the issue.

After installation, there were far less crashes than my previous days but I kept getting a lot of notifications for Unexpected System Errors something involving xorg x11 nouveau but I am not sure what it was exactly. I looked up online and in forums and the most common suggestion which worked was to basically remove and reinstall, which I did and still kept getting the same errors when I logged in.

I later found this post on reddit: Reddit - Dive into anything and one of the suggestions in the comment section were as follows:

"Reinstalling will just give you the same errors again.

That parameter should solved that and not show new errors. Clean the Problem Report list.

Since this worked change the /etc/default/grub file by adding nouveau.modeset=0 to the end of the GRUB_CMDLINE_LINUX line after rhgb quiet. And generate the grub.cfg file again.

Run:

sudo grub2-mkconfig -o $(sudo find /boot/ -iname grub.cfg)

Restart the system to check if the Problem Report"

I followed this, obviously without knowing what I was doing and upon restart fedora was no longer in the grub menu and I could only get into windows.

I would be really grateful if someone could help me out of this, I got a couple of important files I lost access to due to this and no I unfortunately did not have a separate /home directory.

That find command you used returns 2 results and likely messed up the grub config.

You will need to use a fedora 36 live install media to boot, then do a recovery procedure to restore grub properly. In the future, when you feel the need to do anything with grub, use this as a reference.

Please, if there are any problems at all with the steps below STOP immediately and communicate to fix that before you blindly continue and cause more issues.

  1. boot the live media
  2. open a terminal window
  3. use the lsblk command to find and identify the partitions containing fedora. You should locate the main partition you mount as /
    If you installed using btrfs, the output of the lsblk command should show something like this
$ lsblk
NAME   MAJ:MIN RM  SIZE RO TYPE MOUNTPOINTS
sr0     11:0    1 1024M  0 rom  
zram0  251:0    0  3.8G  0 disk [SWAP]
vda    252:0    0   40G  0 disk 
├─vda1 252:1    0  600M  0 part /boot/efi
├─vda2 252:2    0    1G  0 part /boot
└─vda3 252:3    0 38.4G  0 part /home
                                /

Note that on my VM vda3 shows both / and /home, so vda3 is the proper partition.
4. now we can mount that btrfs file system. Note that I am using what is found on my system, you replace that with what is appropriate for yours. sudo mount -t btrfs -o subvol=root,compress=zstd:1 /dev/vda3 /mnt
5. now confirm the main root filesystem is mounted ls /mnt which should show something like this.

$ ls /mnt
afs  bin  boot  dev  etc  home  lib  lib64  lost+found  media  mnt  opt  proc  root  run  sbin  srv  sys  tmp  usr  var

After confirming the proper file sytem is mounted there then
6. su
for i in proc sys run dev ; do mount -o bind /$i /mnt/$i ; done
7. sudo chroot /mnt
8. mount -a
9. ls /boot/grub2/grub.cfg if that returns a result then rm /boot/grub2/grub.cfg
10. ls /boot/efi/EFI/fedora/grub.cfg Again, if that returns a result then rm /boot/efi/EFI/fedora/grub.cfg
11. Now you need the network so start it as you normally would if not already connected.
12. dnf reinstall grub2-efi* grub2-common and wait for everything to finish (may take a few minutes).
13. exit to get out of the chroot environment then reboot. Things should now work properly.

1 Like

I used lsblkon a live usb yesterday, the mountpoints showed up. Not sure what went wrong, nvme0n1p5 and nvme0n1p6 is supposed to be used here.
4c02b9838fa50920be065edb1f560ac42c3ddb60.png

That probably means you need to do the steps I outlined, using /dev/nvme0n1p6 for the root partition when you mount it at /mnt in step 4. You posted the output of step 3, so that can be skipped going forward.

nvme0n1p6 does not show as mounted in that since you booted from the live media.

1 Like

thank you! i thought something was wrong so waited for you to say it was alright before I messed up again.

I seem to have gotten stuck at step 6 again

[liveuser@localhost-live ~]$ sudo for i in proc sys run dev ; do mount -o bind /$i /mnt/$i ; done
bash: syntax error near unexpected token `do'

I have edited step 6. I forgot that sudo only works on the first command and thus the ‘;’ before the ‘do’ broke the line out of the sudo environment.
Use su before using the ‘for’ loop then use that as it was edited (without sudo).

1 Like

thank you so much! something off topic
how do i learn not to be a script-kiddie?

Please explain your definition of that term.

If you mean ‘How do I learn not to arbitrarily execute commands I find online?’ then that is something you learn by trial and error. This is one example of the need to analyze the command and fully understand what it does before executing it (especially as root).

There are a lot of good posts and advice on the internet and forums, but what works on one system may not work on another, especially if it is outdated or for a different distro.

There are just as many or more that may break your system. Some people tend to believe everything they see on youtube or on a forum and blindly execute the actions given without understanding what that may do.

Best advice:

  1. Always verify what you see before you do it. If any questions then ask and someone should be able to say yeah or nay to whether it would work for you.
  2. Most commands when run as a regular user will not break your system. They may mess up a config for your user but will not break the OS.
  3. Any command when run with sudo or as root has the potential to break the OS (as this case shows) so extra care and understanding is mandatory if you do not wish to do the recovery as was just done.

Overall, Stop → think → verify → then execute (or not).

2 Likes

that’s exactly what I meant!
thanks again for all the help! really appreciate it!

1 Like