I get this error too, and I don't think it happens in a chroot.
Background
I think this is when systemd cannot find the path because it is mounted in a directory. So, the difference is when you setup a chroot you already configure access to hardware, including drives.
Though you can configure this access inside Systemd that does not mean you can configure permissions for those drives the same way.
For instance, I created this file:
/etc/systemd/system/[email protected]/override.conf
And it contains these settings:
[Service]
DeviceAllow=char-usb_device rwm
DeviceAllow=char-usb
[Files]
Bind=/var/cache/apt/pkgcache.bin
Bind=/var/cache/apt/srcpkgcache.bin
This still does not work when using grub-install /dev/sda
or update-grub
for a USB on Pi debootstrapped with Debian Stretch. Even using grub-uboot and grub-efi-arm there is still that error the grub-probe
cannot find the canonical path.
Not only that but though update-grub
will see and know what the operating systems are, but interestingly grub-install
does not recognize the Debian operating system is on USB.
Example
root@raspixmc:/home/pi# grub-install /dev/sda
Installing for arm-uboot platform.
grub-install: warning: no hints available for your platform. Expect
reduced performance.
grub-install: warning: WARNING: no platform-specific install was
performed.
Installation finished. No error reported.
root@raspixmc:/home/pi#
Interesting, when I create a chroot and can run update-grub
, even though I am on the operating system that I debootstrapped to the USB itself it does not see its own operating system!
root@raspixmc:/home/pi# mount /dev/sda1 /mnt
root@raspixmc:/home/pi# cd /mnt
root@raspixmc:/mnt# mount --bind /dev dev/
root@raspixmc:/mnt# mount --bind /sys sys/
root@raspixmc:/mnt# mount --bind /proc proc/
root@raspixmc:/mnt# mount --bind /dev/pts dev/pts
root@raspixmc:/mnt# chroot . bin/bash
root@raspixmc:/# update-grub
Generating grub configuration file ...
Found Raspbian GNU/Linux 9 (stretch) on /dev/mmcblk0p2
done
root@raspixmc:/#
It only sees Raspbian. This happens only when trying to install and update GRUB inside the container, but when I exit the chroot.
Watch how it now works because I did not unmount the chroot directories:
/dev dev/
/sys sys/
/proc proc/
/dev/pts dev/pts
From outside the container mind you, I am running this command with grub-uboot
installed on Raspbian and no Grub on the USB containing debootstrapped Debian.
root@raspixmc:/mnt# update-grub
Generating grub configuration file ...
Found Raspbian GNU/Linux 9 (stretch) on /dev/mmcblk0p2
Found Debian GNU/Linux 9 (stretch) on /dev/sda1
done
root@raspixmc:/mnt#
This does not happen using one of the unofficially available images for Debian ARM, but obviously this is still a customization not yet available for debootstrapping.
Troubleshooting
Really there are times when it is better just to create a path. The only next possibility (and a probable one) is to simply write GRUB. And for that I am just going to read on this page.
https://www.dedoimedo.com/computers/grub-2.html
Another thing I want to share about this issue is a solution that might work, but realize microSD cards are very sensitive. I have been building my own Linux images and learned this fast. The best thing to do is use Qemu whenever you can, but to attempt to clear an old partition table you might try running sgdisk --zap-all
on the drive.
sgdisk --zap-all /dev/sdd
In fact, sometimes if it gives an error the first time and it is not a read-only error, you can run it again and it will finally all the partition tables new or old.
And you can use Qemu to emulate Raspberry Pi on a standard AMD/Intel-based PC. I would recommend it. I know this is more information than pertains to the original post, but I think that is likely how this error is derived. It is the container age.
sda6
? Does my answer here help?/cow
seems to refer to the Copy-on-write filesystem which is mounted at/
when booting from a CD or USBcow
word at all.