I am facing a case that the the 1MB GRUB partition on an Ubuntu 18.04 server has been accidentially formatted. The server has not been restarted yet.
Upon running sudo update-grub
the following errors occur:
Sourcing file `/etc/default/grub'
Sourcing file `/etc/default/grub.d/50-curtin-settings.cfg'
Generating grub configuration file ...
grub-probe: error: cannot find a GRUB drive for /dev/sdd2. Check your device.map.
grub-probe: error: cannot find a GRUB drive for /dev/sdd2. Check your device.map.
Found linux image: /boot/vmlinuz-4.15.0-74-generic
Found initrd image: /boot/initrd.img-4.15.0-74-generic
/usr/sbin/grub-probe: error: cannot find a GRUB drive for /dev/sdd2. Check your device.map.
/usr/sbin/grub-probe: error: cannot find a GRUB drive for /dev/sdd2. Check your device.map.
/usr/sbin/grub-probe: error: cannot find a GRUB drive for /dev/sdd2. Check your device.map.
Found linux image: /boot/vmlinuz-4.15.0-72-generic
Found initrd image: /boot/initrd.img-4.15.0-72-generic
/usr/sbin/grub-probe: error: cannot find a GRUB drive for /dev/sdd2. Check your device.map.
/usr/sbin/grub-probe: error: cannot find a GRUB drive for /dev/sdd2. Check your device.map.
Found linux image: /boot/vmlinuz-4.15.0-54-generic
Found initrd image: /boot/initrd.img-4.15.0-54-generic
/usr/sbin/grub-probe: error: cannot find a GRUB drive for /dev/sdd2. Check your device.map.
/usr/sbin/grub-probe: error: cannot find a GRUB drive for /dev/sdd2. Check your device.map.
done
How can I safely repair grub partition without having to reboot the server first?