0

I recently hit a relatively common problem when the 16.04 installer misconfigures the location of the GRUB folder. In such cases the system boots into a rescue shell with the following messages:

error: file '/grub/i386-pc/normal.mod' not found.
Entering rescue mode...
grub rescue>

This means GRUB was able to boot, but it is looking for its modules in the wrong place. The well known solution is to instruct GRUB on the fly on the location of its modules. In my case this is:

grub rescue> set prefix=(hd1,msdos2)/boot/grub
grub rescue> insmod normal
grub rescue> normal

This resumes the boot process successfully. However, the next time the system is booted GRUB falls back again to the rescue console, and it must be instructed again on the location of its modules. I have reinstalled GRUB but it did not fix the issue.

How can GRUB be permanently instructed of the correct location of its modules?

Update: I followed the suggestion by WinEunuuchs2Unix and tried the Boot-Repair tool. I first verified the GRUB location and it is apparently correct: /boot/grub on sdg2.

I then ran the Recommended Repair diagnosis, which produced this output. Here is again reported the correct GRUB location:

sdg2: __________________________________________________________________________

    File system:       ext4
    Boot sector type:  -
    Boot sector info: 
    Operating System:  Ubuntu 16.04.3 LTS
    Boot files:        /boot/grub/grub.cfg /etc/fstab 
                       /boot/grub/i386-pc/core.img

However, there is an error at the very end of the report, that points to an issue with device.map:

grub-probe: error: cannot find a GRUB drive for /dev/sdi1.  Check your device.map.
Unhide GRUB boot menu in sdg2/boot/grub/grub.cfg

An error occurred during the repair.

Any suggestion on what can be made about it?

Luís de Sousa
  • 13,227
  • 26
  • 81
  • 128

1 Answers1

0

The key to understand what was wrong was the need to instruct GRUB towards hd1. The BIOS boots by default to hd0, and in this workstation there were remnants of an MBR that tried to load a GRUB once installed in that disk (hence the reference to /grub instead of /boot/grub).

The solution to this was to change the boot order of internal disks in the BIOS. With hd1 in first place the boot process concludes successfully without human intervention. In some BIOS it might no be possible to modify the boot order of internal disks; in such cases the disks must be re-wired to the board.

Luís de Sousa
  • 13,227
  • 26
  • 81
  • 128