Package: grub2-common Version: 2.02+dfsg1-9 Severity: normal Below is one example of the problem. A trivial fix for this sort of problem would be to have the /usr/sbin/update-grub shell script do "cd /" before running grub-mkconfig (as update-grub is the documented way of doing things on Debian). But a better solution would be to make grub-mkconfig either give useful error messages, or even better just not care about whether it can read the current directory.
root@server:/tmp/a# update-grub Generating grub configuration file ... Found linux image: /boot/vmlinuz-4.19.0-1-amd64 Found initrd image: /boot/initrd.img-4.19.0-1-amd64 Found linux image: /boot/vmlinuz-4.18.0-3-amd64 Found initrd image: /boot/initrd.img-4.18.0-3-amd64 Found linux image: /boot/vmlinuz-4.18.0-2-amd64 Found initrd image: /boot/initrd.img-4.18.0-2-amd64 Found memtest86+ image: /memtest86+.bin Found memtest86+ multiboot image: /memtest86+_multiboot.bin done root@server:/tmp/a# rmdir /tmp/a root@server:/tmp/a# update-grub sh: 0: getcwd() failed: No such file or directory sh: 0: getcwd() failed: No such file or directory sh: 0: getcwd() failed: No such file or directory /usr/sbin/grub-probe: error: out of memory. root@server:/tmp/a#

