I upgraded some packages earlier (including a kernel) and received an odd error from grub (version 1.99-21ubuntu3.9)
$ sudo grub-install --recheck /dev/sda /usr/sbin/grub-probe: error: not a directory. Auto-detection of a filesystem of /dev/sdb1 failed. Try with --recheck. If the problem persists please report this together with the output of "/usr/sbin/grub-probe --device-map="/boot/grub/device.map" --target=fs -v /boot/grub" to <bug-grub@gnu.org>
I couldn't complete the configuration of the updates that I had downloaded, and worse the machine was probably now unbootable. Poking around a bit, I find that the error reported by grub-probe could be reproduced with:
$ sudo grub-probe -d /dev/sdb1 --target=fs_uuid grub-probe: error: not a directory.
I didn't know where to go from here so the first thing I tried was to purge grub and reinstall it.
sudo apt-get purge grub* sudo apt-get install grub-pc
Didn't make any difference, so the next thing I tried was to downgrade to an earlier version of grub (1.99-21ubuntu3).
sudo apt-get purge grub* sudo apt-get install grub-pc=1.99-21ubuntu3 grub2-common=1.99-21ubuntu3 grub-pc-bin=1.99-21ubuntu3 grub-common=1.99-21ubuntu3
Unfortunately this made no difference either. So the next thing I tried was to install the version of grub from Ubuntu 12.10. There were some dependency conflicts which I had to manually fix as you can see here:
sudo apt-get remove apport-hooks-medibuntu apport-gtk apport sudo dpkg -i liblzma5_5.1.1alpha+20120614-1_amd64.deb grub2-common_2.00-7ubuntu11_amd64.deb grub-common_2.00-7ubuntu11_amd64.deb grub-gfxpayload-lists_0.6_amd64.deb grub-pc_2.00-7ubuntu11_amd64.deb grub-pc-bin_2.00-7ubuntu11_amd64.deb
Finally, grub installed ok! Crisis averted.