How to fix grub/i386-pc/normal.mod not found

How to fix grub/i386-pc/normal.mod not found

Sometimes when dealing with 32-bit Linux distributions, you may run into Grub error: file '/grub/i386-pc/normal.mod' not found error even on a fresh installation. For example, Debian Bullseye’s 32-bit install (full DVD version) has this issue occasionally. The simplest, yet the most time-consuming, approach is reinstallation. But there’s a much better way to fix this issue. In this article, we cover how to fix grub/i386-pc/normal.mod not found error.

The root cause

The root cause of the issue could be due to two reasons:

  1. Lack of files in /boot/grub/ because of unintentional deletion or faulty installation process
  2. Corrupted file system or hard drive

We can only resolve the matter if GRUB files are missing. Otherwise, if the file system is corrupted reinstallation is required. In the worst case, the hard drive should be replaced.

Fixing missing grub/i386-pc files

We need to copy missing files to /boot/grub. However, the grub rescue mode doesn’t allow any copy operations. Hence we first somewhat have to boot the system and then copy files as needed. The positive thing is that a copy of missing files is available under the /usr/lib/grub/i386-pc path.

To boot the system, we need to get out of rescue mode and switch to the normal grub mode where we have commands like linux and boot that allow us to load the kernel manually and boot the system.

Going from grub rescue to grub normal mode

The first thing is to find your Linux partition (or /boot partition if it’s separate from the / partition). For that run,

grub rescue> set pager=1
grub rescue> ls

You should get something like this,

(hd0) (hd0,msdos1) (hd0,msdos2) (hd0,msdos3) (hd0,msdos4)

Now you need to ls each partition to find out which points to your Linux installation if you don’t know already. For that run,

grub rescue> ls (hd0,msdosX) # X can be any number based on previous command output

Take note of the partition number and then run,

grub rescue> set root=(hd0,msdos2) # replace `msdos2` with your Linux partition
grub rescue> set prefix=(hd0,msdos2)/usr/lib/grub/
grub rescue> insmod normal
grub rescue> normal

After that, you should see your grub prompt has changed from grub rescue> to grub>. Now we are in normal GRUB mode.

Boot the system by loading the kernel manually

The next step is to load the kernel and boot the system as follows,

grub> linux /boot/vmlinuz-X.YY.Z root=/dev/sda1
grub> initrd /boot/initrd.img-X.YY.Z
grub> boot

Once you run the boot command, your Linux should start booting.

Copy grub files to /boot/grub

After booting the system successfully the last step is to copy the missing files and update the GRUB for safety as follows:

$ sudo cp -r /usr/lib/grub/i386-pc /boot/grub
$ sudo update-grub # or grub-mkconfig -o /boot/grub/grub.cfg 

To ensure everything is working, do a reboot. Hopefully, you won’t see grub/i386-pc/normal.mod not found anymore 😀


Inline/featured images credits