Help repairing GRUB on LUKS-encrypted volume

Unusual, but, a bit more info would be useful.

Some vendors have both UEFI and Legacy boot options available
USB devices could appear twice and the user can decide to boot in UEFI mode or Legacy mode

This image will show the two options

1 Like

These are my boot options in “UEFI+Legacy” mode. I’ve changed the boot order AFTER taking this picture to be the SanDisk USB Key (my Kubuntu live USB) in the right-hand corner. As you can see in the second picture, the SanDisk is available for booting:

However, when I select “UEFI“ only, the SanDisk USB Key becomes unavailable in boot settings, and cannot be selected when booting either:

What’s worse is that when I reinstalled Kubuntu, at looked as if I was getting GPT:

However, when I go to check my new partition, it is STILL MBR, and I can only boot using the “UEFI+Legacy” boot option:

(I formatted Kubuntu to GPT using Gnome’s “Disks” application after backing up my home folder).

How the live/installer media boots is how it installs. So, assure you’re booting in UEFI mode.

Also important to keep in mind is that even if booted in the intended mode (i.e. UEFI mode in this case) the installer won’t change the partitioning type of the target drive.

If you have no data to backup just open GParted and in Device menu choose new partition table then make sure to select GPT. Proceed with the installation and it should work as intended.

Trouble is, I can’t boot my SanDisk live USB in UEFI mode, as it isn’t detected in my boot list, as shown in the pictures above.

My motherboard called the external USB drive as an external hard drive. Does that boot for you?

If you convert drive from MBR(msdos) to gpt, the entire drive, all partitions are deleted. Be sure to have good backups.

Some installers will let you create ESP - efi system partitions or automatically create one. Others require you to have an ESP. It seems to depend on which install choice you have and whether drive is gpt with ESP or not.

First time I’ve read a post where UEFI settings prevent a boot operation in UEFI mode.

The following may be worth consideration:-

Reset UEFI settings to default
Disable Secure Boot
Disable TPM (and/or similar Trust settings)

Can you boot your USB in UEFI mode?

I’ve reset settings to the defaults:

Secure Boot and TPM have never been enabled, I had to enable other settings to figure out they even existed in my settings:

Windows 8/8.1 Feature and Fast Boot are NOT enabled, only in this picture.

I also looked in security settings, but found nothing which looked like it needed changing:

I still can’t use my USB in UEFI mode. I did create it on my current MBR Linux install - would this make it incompatible with GPT? I would think it should be universal.

Attach your USB, open a terminal and enter:-

sudo parted -l

Please post the output - looking for an ESP flag?


Have you tried

  • A different USB port
  • Another USB disk

Your BIOS version is E7821 IMS V1.9 released in 2013.
I understand that MSI have a nice utility to update the BIOS - might be an option?
msi-update-bios


Your PC is clearly UEFI compatible because an earlier screenshot showed UEFI: Built-in EFI shell, therefore it must be possible to boot the USB in UEFI mode.

A USB can be booted in UEFI mode via the EFI shell, but it’s a bit fiddly.
Do you want to try?

Yes, it needs a firmware update. Avoid “beta” ones, though.

My experience with MSI motherboards of the same vintage (+/- a couple of years) is: 1. They’re crap (but usable); 2. More often than not you need to do an hardware reset (short pins in a jumper near the cell battery) because the “soft reset” like you did almost never clear it as it should and EFI entries are missed.

Note: My actual experience is with AMD CPUs and AMD chipsets, not the case here. That said, GUI and erratic behavior seems to be exactly the same. The AMD boards just used to have an additional problem: Broken IOMMU. This probably isn’t applicable to yours (Intel) but I had also to disable IOMMU in UEFI and, in earlier releases - 14.04 up to 17.10 (if I remember correctly) -, had to add an additional boot parameter iommu=soft

Also suggest UEFI firmware update. And if SSD update its firmware also.

Compare firmware versions to vendors support site
sudo dmidecode -s bios-version
udisksctl status

You show a fast boot setting. Turn that off. Fast boot in UEFI/BIOS assumes no system changes and immediately boots using previous configuration. Often boot is so fast that you do not have time to press keys to get one time boot or into UEFI settings. Cold boot or full power down & drain any power by holding power switch for several seconds will reset next boot (only) to normal boot mode.

Output of sudo parted -l :

sudo parted -l[sudo: authenticate] Password:Model: ATA Samsung SSD 870 (scsi)Disk /dev/sda: 1000GBSector size (logical/physical): 512B/512BPartition Table: msdos

Disk Flags:
Number  Start   End     Size    Type     File system  Flags1      1049kB  4296MB  4295MB  primary  ext4         boot2      4296MB  1000GB  996GB   primary

Warning: Not all of the space available to /dev/sdb appears to be used, you canfix the GPT to use all of the space (an extra 111908296 blocks) or continue withthe current setting?Fix/Ignore?

I can’t see and ESP flag, but I assume you mean for the USB device?

I tried both a different USB port and device, but this didn’t work.

The BIOS version E7821 looks to be the same as what’s already installed on my motherboard, but I’ll try updating following the guide.

Do you know how to use the EFI shell to boot from the USB?

EDIT:

I flashed my BIOS and it now shows my live USB (SanDisk) as a UEFI device, even in UEFI+Legacy mode:

Hopefully this will give me a GPT partition once I get around to formatting my SSD.

I’ll keep this updated.

That’s a major improvement

When you boot your USB into a live session, please double check that you are in UEFI mode with this terminal command

[ -d /sys/firmware/efi ] && echo "UEFI" || echo "Legacy"

Then, use the partition manager to create GPT on your target disk

Yes, I can show you how to boot into a “Try Ubuntu” live session using the EFI shell.

However, it’s much easier to boot the USB in UEFI mode via the PC boot menu, which should now be possible with your updated firmware.

1 Like