Score:0

Can't boot to GRUB2 menu after Kubuntu 22.04.2 install

cn flag

I'm replacing the old Ubuntu MATE 16.04 on my Thinkpad T430 with Kubuntu 22.04.2, freshly downloaded and SHA256SUM checked.

The 300 GB platter drive is partitioned as follows:

sda1 499 MB System Reserved (now tagged boot, esp)
sda2 58.3 GB Windows
sda3 3 GB blank FAT32 (formerly Windows Recovery, deleted trying to get a recognized ESP)
sda5 38.1 GB Kubuntu (/) (this is where Ubuntu MATE was installed)
sda6 7.6 GB swap
sda7 190.5 GB /home (being reused without formatting)

I've managed to get the installer to finish without error, after marking the System Reserved volume as esp (I'm pretty sure that's where that tag was before I started this reinstall), but when I try to boot from the HDD I get GRUB Rescue Mode with "error: file '/boot/grub/i386-pc/normal.mod' not found".

System firmware settings are currently Secure Boot disabled, both for USB and for HDD, and UEFI/Legacy set to "both" with "Legacy First".

Prompted by comments, I found that the hard disk is formatted to mbr/BIOS mode, while the USB key is gpt -- which presumably means the Live Session is running in UEFI mode rather than CSM. Unfortunately, that means it wants to install the UEFI version of GRUB2.

All devices in the desktop machine that wrote this USB are mbr; I tried deleting the partition on the USB key and recreating it in mbr with FAT32, but Startup Disk Creator converted it to gpt when it wrote the .iso image. I'm going to try dd to write the iso and see if that will leave the mbr setting intact.

And now that I've tried using dd to write the .iso to the USB key, I find that even that converts the mbr/FAT32 USB key to gpt:

Model: Generic Flash Disk (scsi)
Disk /dev/sdc: 31.5GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags: 

Number  Start   End     Size    File system  Name       Flags  
 1      32.8kB  5018MB  5018MB               ISO9660    hidden, msftdata  
 2      5018MB  5024MB  5155kB               Appended2  boot, esp  
 3      5024MB  5024MB  307kB                Gap1       hidden, msftdata  

I'm told in comments I should have two boot options when i start from the USB key, but I'm not being offered those, perhaps because this is a 10+ year old computer and UEFI was new when it was made.

New related question here.

oldfred avatar
cn flag
You cannot mix UEFI & BIOS on same drive. Windows requires MBR(msdos) if booting in BIOS/CSM/Legacy mode or gpt(GUID) if booting in UEFI mode. Which partitioning is your drive? `sudo parted -l` Then you have to install Ubuntu in same boot mode. Windows in BIOS mode has to have boot flag on its boot partition. But UEFI installs require boot,esp flags on ESP - efi system partition. Only one boot flag per drive. Systems since 2012 are UEFI and really both Windows & Ubuntu should be UEFI installs. But conversion of drive from MBR to gpt generally totally erases drive, so good backups required.
Zeiss Ikon avatar
cn flag
@oldfred See edits made while you were commenting. I've just changed the tags on the System Reserved partition to boot, esp and installer has completed without errors, but still can't get a boot to GRUB2 menu. My partition table is "msdos" -- so how do I install Kubuntu 22.04 in MBR mode? Ubiquity gives an error before copying files if there isn't an ESP found. My USB key is gpt -- do I need to write it again some special way?
Zeiss Ikon avatar
cn flag
Everything in the working desktop Kubuntu 22.04.2 system is mbr, that's the system I used to create the USB key.
Zeiss Ikon avatar
cn flag
Additional followup -- I just reformatted my USB key to MBR/FAT32, and rewrote with Ubuntu's Startup Disk Creator. The USB was converted to gpt. Let me see if "Legacy Only" setting in the laptop's firmware will let me boot in mbr mode. And the T430 will not boot from the gpt formatted USB key when in Legacy Only.
oldfred avatar
cn flag
System Reserved in UEFI mode is unformatted space for Windows. Was it the boot partition? The default boot mode in UEFI settings is for the installed system. How you boot live installer UEFI or BIOS is both how it installs or how it repairs. You should have two boot modes with normal USB flash drive live installer. One Clearly UEFI:xxx and one xxx which is the BIOS one. Some tools to create an install may make a BIOS only or UEFI only installer, but that depends on what tool you used to make installer & choices you make.
Zeiss Ikon avatar
cn flag
@oldfred See new edits. No boot modes offered and machine won't boot from the USB when set to Legacy Only. When I allow UEFI boot I get the installer's GRUB menu and a boot into gpt/UEFI mode. I've used the Ubuntu Startup Disk Creator as well as `dd` with the same result, suggesting that the .iso file (which is copied block by block with `dd`) contains the gpt boot record. I'm about to write another question on where I can download an mbr version of the .iso; Google found nothing and/or what tool I can use to write a version that allows mbr boot.
oldfred avatar
cn flag
Does not matter if USB flash drive is gpt or MBR, it should boot in BIOS mode, unless you create a UEFI only version. https://help.ubuntu.com/community/Installation/iso2usb/diy
Zeiss Ikon avatar
cn flag
@oldfred "Should" is not "does." And those instructions are impenetrable; machine translated or written by someone whose English is a second language? And who makes up technical terms and expects us all to know what they mean? I didn't have to do any of this when I installed Kubuntu 22.04.1 on my desktop system (which is also all mbr). And now Stack Exchange is going to kill all this by moving it to chat where it's annoying and difficult to keep up the information exchange long enough to get to an actual answer.
Zeiss Ikon avatar
cn flag
@oldfred even though I couldn't tell whether Live USB was running in EFI or mbr mode, it did finally work. All I had to do was ignore instructions. **NO** ESP, Windows partition flagged as 'boot', ignore the warning above, and let it run -- and after it completed, it started right up, perfect GRUB menu (I need to run `update-grub` to be sure it has Windows as an option; I don't use it but it's nice to have as a backup).
Score:1
jp flag

First, I'd like to clarify some linguistic and conceptual points, in the interests of clear communication:

  • Boot modes are BIOS/CSM/legacy or EFI/UEFI. There is no such thing as "MBR boot mode."
  • A disk most likely uses either the Master Boot Record (MBR) partition table or the GUID Partition Table (GPT). Either type of disk may boot in either BIOS or EFI mode! It's true that Windows ties MBR disks to BIOS-mode booting and GPT disks to EFI-mode booting, but Linux does not restrict boot modes in this way.
  • Whether a computer was running in a BIOS-mode or an EFI-mode boot has nothing to do with how a USB flash drive created by that computer will boot. What's important is the data written to the USB flash drive, and in particular, whether the drive contains BIOS and/or EFI boot loaders. There's nothing magical about a computer that's booted in BIOS mode boot that prevents it from writing an EFI boot loader to a disk, or vice-versa. It's just a string of 1s and 0s being written to the disk.
  • The format of a USB flash drive used to install Ubuntu depends on how it's written. If you used dd to copy the .iso file "raw" to the USB drive, then it will use a sort of Frankenstein's Monster format that violates all the rules but somehow still manages to work and to support booting in both BIOS and EFI modes. Don't read too much into what you see from fdisk, gdisk, gparted, or other tools. If you used another tool, it's likely to use a simpler format, but most modern tools will also write both BIOS-mode and EFI-mode boot loaders. This usually says nothing about the boot mode the computer will use when it's fed the disk -- that is controlled by the computer, as explained shortly, assuming that both boot loaders are present. (If one mode's boot loader is omitted or deleted after the fact, then obviously the computer can't boot in that mode, though.)

I'm pretty sure that the error message you reported (error: file '/boot/grub/i386-pc/normal.mod' not found) is produced only by the BIOS-mode version of GRUB. Most likely the computer started up using some remnant of a BIOS-mode GRUB from a previous install, but the follow-on file is missing or is stored in some way that the old boot loader can't find (at a different location, say).

When you boot a USB flash drive, its boot mode (BIOS vs. EFI) is determined by a complex combination of your firmware's capabilities, how your particular firmware prioritizes different boot modes, your firmware's settings, what boot option you chose, and which boot loader(s) are on the disk. The outcome is difficult to predict when you enable CSM support in your firmware. You'd need to either force the boot medium to contain only one boot loader or know enough about your computer's implementation to force it to boot in a particular way. If left to do what it does by default, Computer A might boot a USB flash drive in BIOS mode whereas Computer B might boot the exact same drive in EFI mode. I cover this in much more detail in a Web page I wrote about the subject.

For this reason, and because EFI mode has some (very modest) advantages over BIOS mode, I generally recommend that EFI mode be used. You can disable the CSM in your firmware setup utility and (usually) be guaranteed an EFI-mode boot, which eliminates a lot of question marks. Given the partition table layout you specified, though, my suspicion is that your computer had been booting in BIOS mode. If I'm right, then changing it to boot in EFI mode is possible by using Microsoft's MBR2GPT utility; however, that carries some risks and is likely to be a trickier path than others you might take.

If you want to preserve your BIOS-mode boot mode, then you should figure out how to boot your Ubuntu medium in BIOS mode -- but that's going to be at least a little system-specific. (Often, but not always, you'll see two boot options for a USB flash drive, one of which begins with the string "UEFI". That's the EFI-mode boot option, and the one that's missing that string will boot the disk in BIOS mode.) If you want to preserve a BIOS-mode boot, then you should NOT try to create an EFI System Partition (ESP) -- either a new one or by converting an existing partition to an ESP. An ESP is used only in an EFI-mode boot, to hold EFI-mode boot loaders. It's useless in a BIOS-mode boot, and if you chance an existing partition's type code to turn it into an ESP, then whatever had been using that partition might start ignoring it, which could cause problems.

Prior to making any decisions, you may want to run Boot-Repair. I wouldn't recommend plunging straight into a repair; instead, use the option to generate a BootInfo Summary and post back with that information. This will make it clearer to the knowledgeable people here how your system is set up, eliminating some of the guesswork. The same tool may be able to install a working boot loader if your installation is otherwise complete. Note that a Boot-Repair disk, just like an Ubuntu installer, can itself be booted in either BIOS mode or EFI mode. I'm not positive, but I think it can install a BIOS-mode GRUB even if it was booted in EFI mode; but if not, and if you want to use BIOS-mode booting, you may need to figure out how to get a Boot-Repair disk to boot in BIOS mode.

If I'm wrong and Windows was previously booting in EFI mode, then your best course of action is likely to ensure that Ubuntu is installed in EFI mode, too. Maybe you accidentally booted the installer in BIOS mode, thus leading to your current problems.

Zeiss Ikon avatar
cn flag
In case you missed the comments, I've got the machine booting to GRUB and Kubuntu again (in 22.04.2), after (as you suggest) setting up with no EFI partition and letting the install run after the (very confusing) warning that the system likely wouldn't be able to boot without one. The one time I've run Boot Repair (when installing Kubuntu 22.04.1 on my desktop machine) it Made Things Worse (assisted by a bug in KDE Partition Manager that `gparted` doesn't share.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.