[solved] Mint UEFI partition suddenly not recognized by UEFI anymore - after booting Windows 7 once

Questions about Grub, UEFI,the liveCD and the installer
Forum rules
Before you post please read how to get help
Post Reply
smernst
Level 1
Level 1
Posts: 7
Joined: Tue Jan 30, 2018 9:50 am
Location: Earth, ZZ Plural Z Alpha
Contact:

[solved] Mint UEFI partition suddenly not recognized by UEFI anymore - after booting Windows 7 once

Post by smernst »

This one is weird for me ... it feels like a beginner's mistake.

I am dealing with a PC, some off-the-shelve HP office box, a few years old. I had been using it for a while with different flavors or Linux mostly for computing stuff headless. At some point, I had to install Windows 7 x86_64, so I removed all previous hard drives from the machine, found another SSD, plugged it in, wiped it blank and installed Windows 7 (all defaults) on it. From what I can tell, it was installed in UEFI boot mode (i.e. the SSD has a small FAT32 partition with set boot flag).

Time goes by, I need to run Linux on this machine again, I plug out the SSD and install Linux Mint (i.e. Ubuntu), most recent version as of 2 weeks ago, onto a USB flash drive. The Mint installer throws error messages at me, telling me that there is another OS on this PC which runs as in legacy BIOS mode and installing Mint in UEFI mode is a bad idea. Remember, the SSD was plugged out. Ok ... I can not convince the Mint installer not to crash over this error message, so I partition my USB flash drive manually with GParted. 512 MByte FAT32 with BOOT flag set plus an ext4 system partition, GPT partition table. I run the Mint installer again and point it to those partitions. It throws another warning at me but does not crash. Mint installs (in UEFI mode) and works. Kernel and Grub updates work.

Time goes by, again, and I need Windows again. I still have my SSD around, so I plug it in. The USB flash drive is also present, I thought it would not matter ... I boot the PC, Windows works just fine, I shut it down. Well, now I want to start Mint. UEFI does not find it. Period. I unplugged the SSD. I tried every available USB port. I switched Secure Boot on (just for fun) and off again. I switched to BIOS boot only mode and back to UEFI / legacy combined. I switched to UEFI only mode. It just wont recognize Mint. Going through the boot menu of UEFI does not list the USB flash drive as an UEFI boot option, only as a Legacy BIOS option (I remember it was listed as an UEFI option when I installed Mint onto it).

The Mint UEFI boot partition is untouched, as far as I can tell (change dates match with the date of the last Grub update). The BOOT flag is set. There really is not anything wrong with it, as far as I can tell. My only "mistake" was booting Windows once while the USB flash drive containing Mint was plugged into the PC.

What can I do to debug and/or resolve this issue? What am I possibly overlooking?

--

Question also posted here: https://unix.stackexchange.com/question ... oting-wind
Last edited by smernst on Tue Jan 30, 2018 10:59 am, edited 1 time in total.
Developing since the last millennium, Linux since 2003, SuSE since 2004, lot's of Debian & Ubuntu on the side since 2006, Mint on more and more systems since 2017. Mostly Scientific Software, HPC, Embedded.
smernst
Level 1
Level 1
Posts: 7
Joined: Tue Jan 30, 2018 9:50 am
Location: Earth, ZZ Plural Z Alpha
Contact:

Re: Mint UEFI partition suddenly not recognized by UEFI anymore - after booting Windows 7 once

Post by smernst »

This is what gdisk tells me:

Code: Select all

# gdisk -l /dev/sdc
GPT fdisk (gdisk) version 0.8.8

Partition table scan:
  MBR: protective
  BSD: not present
  APM: not present
  GPT: present

Found valid GPT with protective MBR; using GPT.
Disk /dev/sdc: 30464000 sectors, 14.5 GiB
Logical sector size: 512 bytes
Disk identifier (GUID): ***
Partition table holds up to 128 entries
First usable sector is 34, last usable sector is 30463966
Partitions will be aligned on 2048-sector boundaries
Total free space is 4029 sectors (2.0 MiB)

Number  Start (sector)    End (sector)  Size       Code  Name
   1            2048         1050623   512.0 MiB   EF00  
   2         1050624        30461951   14.0 GiB    0700  
Code EF00 for partition 1 is irritating. Should not it be EE00?
Developing since the last millennium, Linux since 2003, SuSE since 2004, lot's of Debian & Ubuntu on the side since 2006, Mint on more and more systems since 2017. Mostly Scientific Software, HPC, Embedded.
User avatar
austin.texas
Level 20
Level 20
Posts: 12004
Joined: Tue Nov 17, 2009 3:57 pm
Location: at /home

Re: Mint UEFI partition suddenly not recognized by UEFI anymore - after booting Windows 7 once

Post by austin.texas »

What happens is that the UEFI firmware records some basic boot info in NVRAM. When you unplug a drive and plug in a different one, the UEFI firmware can't find the correct device.

How to create a USB flash drive with UEFI and BIOS boot capability. - by pbear
by srs5694 » Fri Nov 13, 2015 8:30 pm
A normal installation of Mint will store GRUB as EFI/ubuntu/grubx64.efi on the EFI System Partition (ESP). This filename is not hard-coded on most PCs, though; it's stored in NVRAM as part of the installation process. If you move the disk to another computer, it will of course have different NVRAM than the original, so that entry won't work. To boot on any random computer, you must use the "fallback filename" -- EFI/BOOT/bootx64.efi. Thus, you need to rename EFI/ubuntu to EFI/BOOT and rename either grubx64.efi or shimx64.efi in that directory to bootx64.efi. (Renaming grubx64.efi will work with Secure Boot disabled, whereas renaming shimx64.efi will work on most computers with or without Secure Boot.)
Mint 18.2 Cinnamon, Quad core AMD A8-3870 with Radeon HD Graphics 6550D, 8GB DDR3, Ralink RT2561/RT61 802.11g PCI
Linux Linx 2018
smernst
Level 1
Level 1
Posts: 7
Joined: Tue Jan 30, 2018 9:50 am
Location: Earth, ZZ Plural Z Alpha
Contact:

Re: Mint UEFI partition suddenly not recognized by UEFI anymore - after booting Windows 7 once

Post by smernst »

Yep, this was it. Copy-pasting grubx64.efi to EFI/BOOT/bootx64.efi solved the issue. Thanks a lot .
Developing since the last millennium, Linux since 2003, SuSE since 2004, lot's of Debian & Ubuntu on the side since 2006, Mint on more and more systems since 2017. Mostly Scientific Software, HPC, Embedded.
Post Reply

Return to “Installation & Boot”