Wednesday, November 28, 2012

Fix: New Install of Ubuntu 12.10 Won't Boot

I recently installed Ubuntu 12.10 on my Dell Lattitude work laptop, dual booting with Windows 7. Though the install was successful, the system then booted to the GRUB rescue prompt, with the message:

error: file '/boot/grub/i386-pc/normal.mod' not found.

After re-installing several times, and a couple hours of finding nothing on Google. I found the solution  here. It appears the problem was caused by the Ubuntu installer, which installed the GRUB for EFI bootloader instead of the standard version.

I won't go into the whole EFI secure boot controversy, as it's been abundantly covered elsewhere. My laptop is secure boot capable, but this feature had already been disabled when I received it. However, Ubuntu still installed the secure boot version of GRUB, apparently because it detected that my system had EFI capability.

So, and I'm guessing here, that when the laptop started to boot, the BIOS transferred control to GRUB, which tried to boot as it would for a non-EFI system. However, because the wrong variant of GRUB was installed, it was unable to find the necessary files to complete the boot process. GRUB thought it was on a non-EFI system, but the Ubuntu installer hadn't installed the necessary files for a non-EFI boot.

The solution: boot the live DVD, mount the root partition, and re-install grub with --root-directory flag set. Example:

# mount /dev/sda5 /mnt

# grub-install /dev/sda --root-directory=/mnt

This mounts the root partition (assuming it's on /dev/sda5), and then installs grub to the drive's master boot record. Passing it the path to the root directory will cause grub to install it's files into the "boot" directory in that path; in this case "/mnt/boot".  This will install the non-EFI version of GRUB, and the system will then boot normally.

I admit that my understanding of what caused the problem isn't totally clear, so feel free to correct me in the comments.

Incidentally, I installed Fedora 17 on the same laptop, with device encryption set, and experienced no issues. IMHO, Fedora's installer makes Ubuntu's look like a CS class project. I just wish the installed system worked as well. I've long found the Ubuntu installer to have an unpredictable outcome.

4 comments:

  1. It still won't boot, I get the same error. I look inside the folder (booting from LiveCD), and the file is there. For some reason, Grub isn't seeing it when I boot my computer proper.

    ReplyDelete
    Replies
    1. Unfortunately, as I mentioned above, I don't understand the problem that well myself. This solution worked for me, but I'm very new to EFI. I'm actually not running 12.10 any more, and have reverted to LTS. Have you tried updating the bios? Many boot problems can be resolved by updating an out of date bios.

      Delete
  2. Above solution have worked for me. But now the boot is missing the splash screen and I'm seeing a text / command line based output throughout the booting process. Any idea how it can be resolved ?

    ReplyDelete
  3. Sorry about the delayed response. Look at the kernel options line in your grub config file. I believe it's in /etc/defaults/grub on Ubuntu.

    I mostly use Fedora these days. But I haven't lost hope for Ubuntu. I like where it seems to be going, I just don't like where it is. IMHO, Unity has gone downhill since 11.04. Slow and buggy. I'm fine with the new paradigm, but if you're going to do it, do it well.

    ReplyDelete