2

I installed Lubuntu on a flash drive as you would an HD (not live/squashfs). But whenever I boot it I get a grub rescue prompt.

It says it can't find /boot/grub/i386-pc/normal.mod which explains the rescue prompt. However, it's installed for x86_64. The folder for that arch is there with all the modules. When I did grub-install I targeted it to x86_64. When I try to explicitly insmod it it says wrong arch elf magic. So it is definitely looking for i386 and in the right place, but why and how do I fix it?

My question is different than the suggested duplicates because there is no Windows installation on the flash drive, which must be machine-independent. Also, the solutions provided in either do not help - even boot-repair doesn't fix it.

Dessa Simpson
  • 647
  • 7
  • 19
  • Please [repair/re-install Grub](/q/88384)! Boot-Repair might work for installations on external drives, but if it fails, use the manual method. – David Foerster Dec 29 '15 at 15:48
  • I have already reinstalled using `grub-install /dev/sdb --root-directory /mnt` where the Lubuntu partition is /dev/sdb1 mounted on /mnt – Dessa Simpson Dec 29 '15 at 16:48
  • @Eric Carvalho I will try boot repair but none of the other solutions worked for me. – Dessa Simpson Dec 29 '15 at 16:54
  • 4
    Is your system UEFI. Error is typical of installing in one mode UEFI or BIOS, but trying to boot in other mode. There are two grub2s. grub-pc (BIOS) and grub-efi-amd64(UEFI). And how you install, is then how you must set UEFI/BIOS to boot. – oldfred Dec 29 '15 at 16:58
  • That is probably it. It's installed as EFI. Let me see how it's trying to boot. While I do that feel free to provide this as an answer. – Dessa Simpson Dec 29 '15 at 17:02
  • Okay, so it is installed as UEFI but the disk does not show up as a UEFI option in my boot menu. I created anmmm – Dessa Simpson Dec 29 '15 at 17:44
  • Sorry, my computer froze up. I created an EFI boot partition in GParted so I doubt that's the problem. – Dessa Simpson Dec 29 '15 at 17:45
  • 1
    Possible duplicate of [error: file '/grub/i386-pc/normal.mod' not found](http://askubuntu.com/questions/266429/error-file-grub-i386-pc-normal-mod-not-found) – Rod Smith Jan 05 '16 at 16:32

1 Answers1

2

I found the solution. It was booting in Legacy mode because it failed to boot in UEFI. The EFI partition contained EFI/Boot and EFI/ubuntu. It was looking for two files, grubx64.efi and MokManager.efi, in /EFI/Boot, but they were in ubuntu, so I did cp EFI/ubuntu/*.efi EFI/Boot and that fixed it! To clarify, the root problem was that the installer put the boot files in a location that is only suitable for fixed drives, and the solution was to cp -r the files to the correct location.

Dessa Simpson
  • 647
  • 7
  • 19
  • 1
    That's the correct observation UEFI booting from external media is only supported from \EFI\Boot, I wrote about it here: http://askubuntu.com/q/559007/40581 – LiveWireBT Dec 31 '15 at 21:56
  • Question: Why does Ubuntu install it to EFI/ubuntu if it doesn't always work and in what cases does it work? – Dessa Simpson Jan 02 '16 at 05:50
  • 1
    As far as I understand the UEFI spec, which I recommend to look up yourself, the way Ubuntu does it is considered expected behavior from a UEFI computer: boot the first bootloader entry in the boot catalog. \EFI\Boot was initially only for removable media, but was later added for internal drives as a fallback if the catalog has no valid entries. Example: Asus motherboard firmware updates deleted the entire catalog. You can find these issues where manufacturers weren't considerate enough about users wanting to install something else than Windows. I filed a bug, but it didn't get much attention. – LiveWireBT Jan 03 '16 at 19:11
  • Alright. Why is it that that doesn't work for removable drives? – Dessa Simpson Jan 03 '16 at 20:38
  • 1
    The boot catalog is stored in the platform (on the mainboard) and each operating system is responsible for registering it's bootloader in the catalog (basically telling the firmware where the file is and a corresponding name to display , this is done on Linux with `efibootmgr`). In case of removable media, if you use the storage device on another computer this information is not available and would not make much sense (you could still add it though). – LiveWireBT Jan 03 '16 at 23:00
  • Ah, I see. I've never liked that method because I like things to be hardware-independent, but I understand. Thanks! – Dessa Simpson Jan 04 '16 at 20:47