Repairing unbootable system from live usb: grub2-probe: error: cannnot find a device for /

I’m new to Fedora. I was messing up with drivers for getting my hardware work properly and also updated the system through dnf. Fedora is now unbootable. I guess i also updated grub2 and forgot to mkconfig.
Now grub only shows windows boot loader menu entry. I tried to manually boot using grub command line: seemed to work but nothing happened later, just black screen.

Now I’m trying to regenerate the grub.cfg from fedora39 workstation live usb:

I mounted root partition to /mnt and EFI to /mnt/root/boot/efi, also:

sudo mount --rbind /dev /mnt/root/dev
sudo mount --bind /proc /mnt/root/proc
sudo mount --bind /sys /mnt/root/sys
sudo chroot /mnt/root

In my root I run:

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

which gives me this error:
/usr/sbin/grub2-probe: error: cannot find a device for / (is /dev mounted?).

I tried all day to fix this…
Thank you for your time.

SOLVED:
New to fedora and also new to Fedora Discussion…
this solved my issue

Welcome to :fedora:

Glad that you were able to find the fix and repair the error caused by running that command.

Just for further reference,

When you have an issue with fedora it is usual that someone here has already seen the same problem you encounter and by asking here before making changes to your system you can often find an answer without the risk of breaking the system. We are always glad to provide suggestions since at one point we all were beginners as well.

Just as a nit as well, it is usually wise to always mount every partition before doing fixes. In your description you skipped over mounting /boot which should have been done before mounting /boot/efi. Since grub writes file to /boot/grub2/ and /boot/loader/entries/ as well as into /boot/efi/ it is always necessary to have both mounted when installing grub files or using the grub2-mkconfig command.

If you actually skipped mounting /boot during the recovery it would be wise to repeat the steps you followed while actually booted just to ensure all necessary files are 100% up to date.

1 Like

Thank you for both of your answers!
I really needed the system so i rushed a little bit to fix it, and didn’t check enough in this forum… my bad.
I actually skipped to mount the /boot partition cause i think i don’t have one since my lsblk output is:

sda           8:0    0   3.6T  0 disk 
├─sda1        8:1    0    16M  0 part 
└─sda2        8:2    0   3.6T  0 part 
zram0       252:0    0     8G  0 disk [SWAP]
nvme0n1     259:0    0   1.8T  0 disk 
├─nvme0n1p1 259:1    0    16M  0 part 
├─nvme0n1p2 259:2    0   1.8T  0 part 
└─nvme0n1p3 259:3    0     2G  0 part 
nvme1n1     259:4    0 931.5G  0 disk 
├─nvme1n1p1 259:5    0   100M  0 part 
├─nvme1n1p2 259:6    0    16M  0 part 
├─nvme1n1p3 259:7    0   521M  0 part 
├─nvme1n1p4 259:8    0     1G  0 part /boot/efi
├─nvme1n1p5 259:9    0    20G  0 part [SWAP]
└─nvme1n1p6 259:10   0   600G  0 part /var/lib/snapd/snap
                                      /

Maybe I’m missing something in the understanding of partitions. Am I safe without boot partition? Or maybe I have one without knowing.

Try using lsblk -f to show the file systems detected and more info. Also the output of cat /etc/fstab and mount so we can see what the system expects to mount as well as what is actually mounted.

That lsblk output shows many partitions on 3 drives but only 3 mounted, and one of those is a snapd volume.

A default automatic install of fedora workstation creates 3 partitions. /boot as ext4, /boot/efi as vfat, and then a btrfs volume containing 2 sub-volumes, “root” mounted at /, and “home” mounted at /home.

I’m in a dual boot system with Windows11 in nmve0n1, Fedora in nvme1n1 and an HD.
I previously installed arch and probably the other vfat partition in nvme0n1 was created by archinstall and still there.
I also modified the default Workstation istallation not partitioning any boot or home, just EFI and root. But again, not an expert linux user so i may have missed something.
Here’s what you asked:

lsblk -f

NAME        FSTYPE FSVER LABEL      UUID                                 FSAVAIL FSUSE% MOUNTPOINTS
loop0                                                                          0   100% /var/lib/snapd/snap/bare/5
                                                                                        /var/lib/snapd/snap/bare/5
loop1                                                                          0   100% /var/lib/snapd/snap/core20/2105
                                                                                        /var/lib/snapd/snap/core20/2105
loop2                                                                          0   100% /var/lib/snapd/snap/gnome-3-38-2004/143
                                                                                        /var/lib/snapd/snap/gnome-3-38-2004/143
loop3                                                                          0   100% /var/lib/snapd/snap/gtk-common-themes/1535
                                                                                        /var/lib/snapd/snap/gtk-common-themes/1535
loop4                                                                          0   100% /var/lib/snapd/snap/spotify/74
                                                                                        /var/lib/snapd/snap/spotify/74
loop5                                                                          0   100% /var/lib/snapd/snap/snapd/20671
                                                                                        /var/lib/snapd/snap/snapd/20671
sda                                                                                     
├─sda1                                                                                  
└─sda2      ntfs         HD Interno C01469A0146999E4                                    
zram0                                                                                   [SWAP]
nvme0n1                                                                                 
├─nvme0n1p1                                                                             
├─nvme0n1p2 ntfs         Windows 11 D0C6C6C6C6C6AC52                                    
└─nvme0n1p3 ntfs                    DE0CD4F90CD4CE21                                    
nvme1n1                                                                                 
├─nvme1n1p1 vfat   FAT32            76B4-4344                                           
├─nvme1n1p2                                                                             
├─nvme1n1p3 ntfs                    14D2950DD294F468                                    
├─nvme1n1p4 vfat   FAT32            60A1-9F48                            1004.6M     2% /boot/efi
├─nvme1n1p5 swap   1                1275f3ae-ba82-4866-ae8e-88ec68d1f6c6                [SWAP]
└─nvme1n1p6 btrfs        fedora     c8be9205-283d-4a4b-8c88-964a3e23c2ce  544.1G     9% /var/lib/snapd/snap
                                                                                       /

cat /etc/fstab

#
# /etc/fstab
# Created by anaconda on Sun Jan 14 19:03:59 2024
#
# Accessible filesystems, by reference, are maintained under '/dev/disk/'.
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info.
#
# After editing this file, run 'systemctl daemon-reload' to update systemd
# units generated from this file.
#
UUID=c8be9205-283d-4a4b-8c88-964a3e23c2ce /                       btrfs   subvol=root,compress=zstd:1 0 0
UUID=60A1-9F48          /boot/efi               vfat    umask=0077,shortname=winnt 0 2
UUID=1275f3ae-ba82-4866-ae8e-88ec68d1f6c6 none                    swap    defaults        0 0

mount

/dev/nvme1n1p6 on / type btrfs (rw,relatime,seclabel,compress=zstd:1,ssd,discard=async,space_cache=v2,subvolid=256,subvol=/root)
rpc_pipefs on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw,relatime)
devtmpfs on /dev type devtmpfs (rw,nosuid,seclabel,size=4096k,nr_inodes=4059321,mode=755,inode64)
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev,seclabel,inode64)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,seclabel,gid=5,mode=620,ptmxmode=000)
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime,seclabel)
securityfs on /sys/kernel/security type securityfs (rw,nosuid,nodev,noexec,relatime)
cgroup2 on /sys/fs/cgroup type cgroup2 (rw,nosuid,nodev,noexec,relatime,seclabel,nsdelegate,memory_recursiveprot)
pstore on /sys/fs/pstore type pstore (rw,nosuid,nodev,noexec,relatime,seclabel)
efivarfs on /sys/firmware/efi/efivars type efivarfs (rw,nosuid,nodev,noexec,relatime)
bpf on /sys/fs/bpf type bpf (rw,nosuid,nodev,noexec,relatime,mode=700)
configfs on /sys/kernel/config type configfs (rw,nosuid,nodev,noexec,relatime)
proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)
tmpfs on /run type tmpfs (rw,nosuid,nodev,seclabel,size=6518872k,nr_inodes=819200,mode=755,inode64)
selinuxfs on /sys/fs/selinux type selinuxfs (rw,nosuid,noexec,relatime)
systemd-1 on /proc/sys/fs/binfmt_misc type autofs (rw,relatime,fd=34,pgrp=1,timeout=0,minproto=5,maxproto=5,direct,pipe_ino=18515)
hugetlbfs on /dev/hugepages type hugetlbfs (rw,nosuid,nodev,relatime,seclabel,pagesize=2M)
mqueue on /dev/mqueue type mqueue (rw,nosuid,nodev,noexec,relatime,seclabel)
debugfs on /sys/kernel/debug type debugfs (rw,nosuid,nodev,noexec,relatime,seclabel)
tracefs on /sys/kernel/tracing type tracefs (rw,nosuid,nodev,noexec,relatime,seclabel)
fusectl on /sys/fs/fuse/connections type fusectl (rw,nosuid,nodev,noexec,relatime)
/dev/nvme1n1p6 on /var/lib/snapd/snap type btrfs (rw,relatime,seclabel,compress=zstd:1,ssd,discard=async,space_cache=v2,subvolid=256,subvol=/root)
/var/lib/snapd/snaps/bare_5.snap on /var/lib/snapd/snap/bare/5 type squashfs (ro,nodev,relatime,context=system_u:object_r:snappy_snap_t:s0,errors=continue,x-gdu.hide,x-gvfs-hide)
/var/lib/snapd/snaps/bare_5.snap on /var/lib/snapd/snap/bare/5 type squashfs (ro,nodev,relatime,context=system_u:object_r:snappy_snap_t:s0,errors=continue)
/var/lib/snapd/snaps/gnome-3-38-2004_143.snap on /var/lib/snapd/snap/gnome-3-38-2004/143 type squashfs (ro,nodev,relatime,context=system_u:object_r:snappy_snap_t:s0,errors=continue,x-gdu.hide,x-gvfs-hide)
/var/lib/snapd/snaps/gnome-3-38-2004_143.snap on /var/lib/snapd/snap/gnome-3-38-2004/143 type squashfs (ro,nodev,relatime,context=system_u:object_r:snappy_snap_t:s0,errors=continue)
/var/lib/snapd/snaps/gtk-common-themes_1535.snap on /var/lib/snapd/snap/gtk-common-themes/1535 type squashfs (ro,nodev,relatime,context=system_u:object_r:snappy_snap_t:s0,errors=continue,x-gdu.hide,x-gvfs-hide)
/var/lib/snapd/snaps/gtk-common-themes_1535.snap on /var/lib/snapd/snap/gtk-common-themes/1535 type squashfs (ro,nodev,relatime,context=system_u:object_r:snappy_snap_t:s0,errors=continue)
/var/lib/snapd/snaps/snapd_20671.snap on /var/lib/snapd/snap/snapd/20671 type squashfs (ro,nodev,relatime,context=system_u:object_r:snappy_snap_t:s0,errors=continue,x-gdu.hide,x-gvfs-hide)
/var/lib/snapd/snaps/snapd_20671.snap on /var/lib/snapd/snap/snapd/20671 type squashfs (ro,nodev,relatime,context=system_u:object_r:snappy_snap_t:s0,errors=continue)
/var/lib/snapd/snaps/core20_2105.snap on /var/lib/snapd/snap/core20/2105 type squashfs (ro,nodev,relatime,context=system_u:object_r:snappy_snap_t:s0,errors=continue,x-gdu.hide,x-gvfs-hide)
/var/lib/snapd/snaps/core20_2105.snap on /var/lib/snapd/snap/core20/2105 type squashfs (ro,nodev,relatime,context=system_u:object_r:snappy_snap_t:s0,errors=continue)
/var/lib/snapd/snaps/spotify_74.snap on /var/lib/snapd/snap/spotify/74 type squashfs (ro,nodev,relatime,context=system_u:object_r:snappy_snap_t:s0,errors=continue,x-gdu.hide,x-gvfs-hide)
/var/lib/snapd/snaps/spotify_74.snap on /var/lib/snapd/snap/spotify/74 type squashfs (ro,nodev,relatime,context=system_u:object_r:snappy_snap_t:s0,errors=continue)
tmpfs on /tmp type tmpfs (rw,nosuid,nodev,seclabel,size=16297176k,nr_inodes=1048576,inode64)
/dev/nvme1n1p4 on /boot/efi type vfat (rw,relatime,fmask=0077,dmask=0077,codepage=437,iocharset=ascii,shortname=winnt,errors=remount-ro)
binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,nosuid,nodev,noexec,relatime)
tmpfs on /run/user/1000 type tmpfs (rw,nosuid,nodev,relatime,seclabel,size=3259432k,nr_inodes=814858,mode=700,uid=1000,gid=1000,inode64)
gvfsd-fuse on /run/user/1000/gvfs type fuse.gvfsd-fuse (rw,nosuid,nodev,relatime,user_id=1000,group_id=1000)
portal on /run/user/1000/doc type fuse.portal (rw,nosuid,nodev,relatime,user_id=1000,group_id=1000)

I also don’t want to drive the issue off topic, but appreciate any suggestion.