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.
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.
boot the live media
open a terminal window
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
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.
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.
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).
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.
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.
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.
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.