No idea why grub-probe fails finding the / disk. To make the update-grub script work, could it be a workaround to replace grub-probe with a dummy script that just echoes "hd0,gpt4" or such?
How does look a correct output when grub-probe does not fail? On 11/14/21, Stefan Blachmann <[email protected]> wrote: > Thank you for the quick reply, Andrei! > > I have mounted not only /dev, but also /sys, /proc and /run into the > chroot, too. Didn't mention that to keep mail short. > > Meanwhile I found a possible hint: > As there was no device.map file, I ran grub-mkdevicemap. > This did no change again, update-grub still fails. > > Then, after a lot of searching the web, I found the second answer on > this page might be a hint: > https://serverfault.com/questions/401351/update-grub2-without-hardware-access-e-g-in-a-chroot > > It basically says that I should use disk UUIDs instead of disk ids. > Now the problem is that grub-mkdevicemap does not make a device.map > using UUIDs, it uses the IDs under /dev/disk/by-id. > > And I cannot add links to UUIDs as the answer on that page recommends. > Because for reasons I do not understand, in /dev/disk/by-uuid I can > see only the UUIDs of the *mounted* file systems (eg the live CD, and > the ZFS boot and root filesystems), but of the drives themselves. I > can not see UUIDs. > > When I manually change the /dev/disk/by-id/ device.map file entries to > /dev/sda, sdb etc, there is no change in behaviour, update-grub still > fails the same way. > > This is on Debian bullseye, which I assume uses GRUB 2. > > Any idea what could be done to make update-grub succeed? > > > > On 11/14/21, Andrei Borzenkov <[email protected]> wrote: >> On 14.11.2021 16:31, Stefan Blachmann wrote: >>> When I enter >>> # update-grub >>> I get an error message: >>> /usr/sbin/grub-probe: error: cannot find a device for / (is /dev >>> mounted?). >>> >>> /dev has been mounted before entering the chroot /mnt environment using >>> # mount --rbind /dev /mnt/dev >>> >> >> In chroot you need at least /sys and /proc in addition to /dev, /run may >> also be needed. >> >>> If I enter >>> # grub-probe >>> it answers: >>> No path or device is specified. >>> >>> If I enter >>> # grub-probe /boot >>> it answers: >>> zfs >>> >>> So, what do I need to do to make update-grub work? >>> >> >> >> >
