You are not logged in.

#1 2024-05-18 08:52:42

worbgge
Member
Registered: 2021-07-18
Posts: 48

[SOLVED] /usr/bin/grub-probe: error: cannot find a device for /

hello, i tried changing from the linux kernal to linux-lts and i've been trying to make a new config for grub but i keep getting this error, i use btrfs so i have to arch-chroot into /mnt/@ instead of just /mnt, i've tried multiple methods but i can't get it to work:
Error 1:

sudo cryptsetup luksOpen /dev/sda2 encrypted
mount /dev/mapper/encrypted /mnt
mount /dev/sda1 /mnt/@/boot
arch-chroot /mnt/@
grub-install --target=x86_64-efi --efi-directory=/boot/EFI/ --bootloader-id=GRUB
grub-mkconfig -o /boot/grub/grub.cfg
/usr/bin/grub-probe: error: cannot find a device for / (is /dev mounted

after this, i tried to mount /dev /proc and /sys to see if that would fix the issue, i then got
Error 2:

sudo cryptsetup luksOpen /dev/sda2 encrypted
mount /dev/mapper/encrypted /mnt
mount /dev/sda1 /mnt/@/boot
mount --rbind /dev /mnt/@/dev
mount --rbind /proc mnt/@/proc
mount --rbind /sys /mnt/@/sys
arch-chroot /mnt/@
mount: /mnt/@/sys: sys already mounted on sys
==>ERROR: failed to set up chroot /mnt/@

after arch-chroot i tried just chroot but got the same erorr as error 1
Error 3:

sudo cryptsetup luksOpen /dev/sda2 encrypted
mount /dev/mapper/encrypted /mnt
mount /dev/sda1 /mnt/@/boot
mount --rbind /dev /mnt/@/dev
mount --rbind /proc mnt/@/proc
mount --rbind /sys /mnt/@/sys
chroot /mnt/@
grub-install --target=x86_64-efi --efi-directory=/boot/EFI/ --bootloader-id=GRUB
grub-mkconfig -o /boot/grub/grub.cfg
/usr/bin/grub-probe: error: cannot find a device for / (is /dev mounted

Last edited by worbgge (2024-05-18 09:59:07)

Offline

#2 2024-05-18 09:10:13

snowfiig
Member
Registered: 2024-05-18
Posts: 3

Re: [SOLVED] /usr/bin/grub-probe: error: cannot find a device for /

What i usually do is open luks partition, mount the main subvolume with

$ mount -o subvol=@ /dev/mapper/encrypted /mnt

then mount the other ones by adding the name of the subvolume after @ and the name of the directory after /mnt, and run

$ arch-chroot /mnt

i don't know if mounting all the subvolumes is necessary but i always do it just in case.

Offline

#3 2024-05-18 09:58:57

worbgge
Member
Registered: 2021-07-18
Posts: 48

Re: [SOLVED] /usr/bin/grub-probe: error: cannot find a device for /

thank you this solved it, closing topic

Offline

Board footer

Powered by FluxBB