1

I boot a diskless debian linux (ubuntu 20.04) via pxe and nfs. All works fine and I can boot my host. When I run an apt upgrde I get an error message

/usr/sbin/grub-probe: error: failed to get canonical path of `10.0.0.1:/export/host1'

when I run mount I see

10.0.0.1:/export/host1 on / type nfs (rw,relatime,vers=3,rsize=1048576,wsize=1048576,namlen=255,hard,nolock,proto=tcp,port=2049,timeo=600,retrans=10,sec=sys,local_lock=all,addr=10.0.0.1)

in df I see:

10.0.0.1:/export/host1  500G   39G  462G   8% /

In /etc/fstab I have:

#/swap.img      none    swap    sw      0       0
/dev/nfs       /               nfs    defaults          1       1

I do not see anything in the logs.

1

You have the GRUB bootloader installed on a diskless system? Your bootloader lives on the PXE server - you could just remove the local GRUB packages.

The error message is caused after each kernel update as /etc/kernel/post(inst|rm).d/zz-update-grub runs update-grub, which is just a wrapper for grub-mkconfig, which will among other things run grub-probe that causes the error message. The grub-probe has a built-in assumption that whenever it's run, a local bootloader is being used, and it's confused by the NFS-mounted root filesystem.

If you prefer to have the GRUB packages around for whatever reason (e.g. to allow easy access to GRUB documentation and man pages), you might instead delete /etc/kernel/postinst.d/zz-update-grub and /etc/kernel/postrm.d/zz-update-grub, or preferably change them to just run exit 0 because there will be no local bootloader to update on a diskless system.

(Deleting them would just cause them to get reinstalled by the next GRUB package update; replacing them with a custom no-op script will have the package management leave your customizations alone unless major changes happen in Debian's GRUB integration, as they are declared as configuration files by the grub2-common package. And even if major changes happen, you would get a prompt from the package management, asking you whether or not the customized file should be replaced.)

You might also consider creating your own script in /etc/kernel/postinst.d/ and /etc/kernel/postrm.d/ that would copy the most up-to-date kernel and its initramfs file to the appropriate location in the PXE boot server, if you haven't already done that. Otherwise you will have to do the copying manually at every kernel update... which usually means you will be stuck with an unpatched kernel until you get around to doing it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.