package: grub2-common<br>
severity: grave<br>
Version: 2.02~beta2-22+deb8u1<br>
<br>
After installing debian 8.5 jessie, I installed Windows. It removed grub from mbr, so booted into rescue mode using the same cd 1 image, but grub-install failed with this error.<br>
<br>
grub-install: error /usr/lib/grub/i386-pc/<a href="http://modinfo.sh">modinfo.sh</a> doesn't exist. Please specify --target --directory.<br>
<br>
Same error when manually run<br>
<br>
# chroot /target<br>
# grub-install /dev/sda<br>
<br>
I can see /usr/lib/grub/x86_64-efi/<a href="http://modinfo.sh">modinfo.sh</a> present instead.<br>
<br>
When I run <br>
<br>
grub-install -d /usr/lib/grub/x86_64-efi /dev/sda<br>
<br>
I get the following error<br>
<br>
grub-install: error: cannot find EFI directory<br>
<br>
After mounting efi partition<br>
<br>
/dev/sda4 under /mnt and passing --efi-directory /mnt<br>
<br>
The command succeeded and I could boot into debian after going to boot menu and choosing debian.<br>