How to Clean up Multiple EFI Partitions?


#1

Hi y’all,

I’m getting ready to install Trident 18.12 as the 3rd OS on my MSI laptop (Windows 10 and Linux Mint 19.1 already on there).

In preparation, I’d like to clean up some of the extra EFI boot partitions, maybe even get rid of them if that’s advisable, so that I only have one left, one that will let me boot to any of the three OSs.

I’ve included the output of fdisk -l (from Mint) and the way I’m reading it, these are the partitions that I should be able to delete safely:
/dev/sdb1 (Microsoft reserved)
/dev/sdc2 (EFI System)
/dev/sdc3 (Microsoft reserved)
/dev/sdd1 (Windows recovery environment)
/dev/sdd2 (EFI System)
/dev/sdd3 (Microsoft reserved)

However, I’m not sure which EFI partition is used by GRUB (or whatever boot loader Mint installed). It’s been far too long since I dug into this stuff and all this UEFI/EFI stuff is confusing to me.

Here’s the output of fdisk -l:

Disk /dev/loop0: 127.4 MiB, 133599232 bytes, 260936 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk /dev/loop1: 91 MiB, 95416320 bytes, 186360 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk /dev/sda: 232.9 GiB, 250059350016 bytes, 488397168 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 8BA2E69A-E663-49CB-8191-57C60C57BA7B

Device Start End Sectors Size Type
/dev/sda1 2048 244140031 244137984 116.4G Linux filesystem

Disk /dev/sdb: 465.8 GiB, 500107862016 bytes, 976773168 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 200826CF-47D7-46DE-AF6E-94BBE40EF0F0

Device Start End Sectors Size Type
/dev/sdb1 34 32767 32734 16M Microsoft reserved
/dev/sdb2 32768 976771071 976738304 465.8G Microsoft basic data

Disk /dev/sdc: 931.5 GiB, 1000204886016 bytes, 1953525168 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: 91777562-C427-4D61-B439-084A12E5B5B5

Device Start End Sectors Size Type
/dev/sdc1 2048 1023999 1021952 499M Windows recovery environment
/dev/sdc2 1024000 1228799 204800 100M EFI System
/dev/sdc3 1228800 1261567 32768 16M Microsoft reserved
/dev/sdc4 1261568 1953523711 1952262144 930.9G Microsoft basic data

Disk /dev/sdd: 223.6 GiB, 240057409536 bytes, 468862128 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 41AFA081-709E-4EF9-B34B-F38815D32746

Device Start End Sectors Size Type
/dev/sdd1 16191 208844 192654 94.1M Windows recovery environment
/dev/sdd2 208971 369494 160524 78.4M EFI System
/dev/sdd3 369621 402388 32768 16M Microsoft reserved
/dev/sdd4 417816 468857024 468439209 223.4G Microsoft basic data

Disk /dev/mmcblk0: 59.5 GiB, 63864569856 bytes, 124735488 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0xc99186e7

Device Boot Start End Sectors Size Id Type
/dev/mmcblk0p1 2048 124735487 124733440 59.5G 83 Linux

Disk /dev/sde: 1.8 TiB, 2000396746752 bytes, 3907024896 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x006d81ce

Device Boot Start End Sectors Size Id Type
/dev/sde1 * 2048 3907024895 3907022848 1.8T 7 HPFS/NTFS/exFAT

(NB: I have no idea why MD decided to go bold/large font with that last line)

Any help will be very much appreciated.


Triple-boot Windows, Linux and Trident
#2

Check out the rEFInd boot manager. https://www.rodsbooks.com/refind/. That is what I used to reorganize my system (quad boot Windows, Arch, Slackware, and Trinity) to use one EFI partition and GPT.

Post your /boot/boot/grub.conf file and someone should be able to help you figure out how it is configured.

Be careful deleting partitions. Double and triple check things. When I deleted partitions I forgot how it affected the arrangement of the other partitions. And Windows confuses me with how it seems to juggle drive letters. Just make sure you know exactly which partitions are being used.

Taking a cursory look at your fdisk output, I would probably look into using the EFI on /dev/sdc2 or /dev/sdd2. I would then configure the bios to boot from that drive and use the rEFInd boot manager to find all the operating systems.

And before jumping in I would recommend writing all the steps down. It helped me to make sure I was not missing any adjustments that needed to be made in the various systems to get everything going.

Best of luck


#3

Thanks very much, aocab. That seems like sound advice.

I had a look in /boot/grub and found a file called grub.cfg wherein the menuentry lines are:
menuentry ‘Linux Mint 19.1 Xfce’ --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option ‘gnulinux-simple-260b4e10-086f-4f3a-9ac2-2b1f9477ca84’

menuentry ‘Windows Boot Manager (on /dev/sdc2)’ --class windows --class os $menuentry_id_option ‘osprober-efi-E42A-F805’

menuentry ‘Windows Boot Manager (on /dev/sdd2)’ --class windows --class os $menuentry_id_option ‘osprober-efi-E42A-F805’

very much as you said they’d be. I think with the help of rEFInd, I may just be able to sort this out. And maybe the best approach isn’t to toss all those extraneous partitions.


#4

If you get rEFInd working you should be able to just ignore the extra EFI partitions, re-purpose them as extra data partitions, or use them for common use between all three operating systems.

You mentioned Windows 10. Do you have 2 versions of Windows (one on /dev/sdc2 and one on /dev/sdd2)?

From the information you provided, it looks like the system is using Grub and booting into Mint by default (the system on /dev/sda1). Correct?

Before you go into Linux Mint are there two entries for Windows in the menu? Do they both work?

If you only have one Windows system what are the contents of the hidden file boot.ini? That should help determining which partition is being used by Windows.

The drive being used by Windows has the EFI partition I would use to put rEFInd on. Of course that means you would need to configure the BIOS to boot from that drive.


#5

I came to the same conclusion. Makes sense.

Just one. Windows was originally on sdc, then moved to sdb. I think the active Windows boot loader is on sdb.

No, Windows by default, but I’m thinking my UEFI boot order likely controls this. I’m going to do some experiments today to see if there’s a UEFI/BIOS boot order that will give control over to grub by default.

I’ll have to experiment to find out for sure, but my guess is that the second one (sdc) won’t do anything because the Windows boot partition it points to is no longer around.

I can’t find a file by that name. Mind you, I’m searching the root of the C: drive mounted on Linux, so perhaps I have to reboot into Windows to see it. I’ll do that today, too.

Right. Makes sense.

Thanks for the extra guidance. I’ll do some experiments (as well as the requisite floundering) and report back. Who knows? Maybe I’ve got enough to go on now.


#6

After running a series of System Settings (UEFI/BIOS) and boot experiments, this is the info I gathered:

In the UEFI/BIOS > UEFI Hard Disk Drives BBS Priorities, I have four options to boot from:

  1. Windows Boot Manager (P4: KINGSTON)
  2. ubuntu
  3. ubuntu (P2: HGST)
  4. ubuntu (P4: KINGSTON)

I set each of these, in turn, as the primary boot partition and got these results:

  • #1 boots straight into Windows 10
  • #2 to #4 all bring up the GRUB menu.

So, there’s an amount of redundancy in regards to booting into Linux. Also, I don’t know yet which partition holds the GRUB menu and/or boot loader for Mint.

Another thing… According to gparted (see below) there are only two EFI system partitions associated with Linux: sdc2 and sdd2, so I don’t know where the third ubuntu option comes from. And since they all boot Mint, they must all point to the same partition.

Also, gparted shows that:

  • P4: KINGSTON is sdd, and
  • P2: HGST is sdc.

But that must mean that when #1 is selected in UEFI/BIOS, Windows is using a boot loader built into the Windows kernel on sdd4 or control is somehow being passed to sdc3 or sdb1.

Moving on…

The GRUB menu has five options:

  1. mint 19.1 (boots Linux)
  2. mint advanced options (boots Linux)
  3. Windows on sdc2 (Windows-based repair mode)
  4. Windows on sdd2 (Windows-based repair mode)
  5. System Setup (UEFI/BIOS)

In effect, this means that if I want to switch OSs, I have no choice but to go into UEFI/BIOS and change the boot priorities.

The odd thing about this is that both sdc2 and sdd2 are fat32 partitions mounted to /boot/efi under Linux and because of this, I’d guess they have nothing to do with Windows repair/recovery. Yet, this is how GRUB sees them.

And because Windows 10 is installed on sdd4 (see below) I would have thought its boot loader would be somewhere on that drive as well, but now I’m thinking it must be on either:

  • sdb1, or
  • sdc3

I came to this conclusion because gparted sees these as Microsoft Reserved partitions, but has no other info about them and no other Microsoft-related partitions, except those for Recovery, are mentioned.

gparted Drive Info

sda (232gb)

  1. sda1 = linux mint (116gb)
  2. unallocated space I’m reserving for Trident

sdb (465gb)

  1. sdb1 = Microsoft reserved (15gb)
  2. sdb2 = ntfs (mounted as ~/Data) 465gb)

sdc (931gb)

  1. sdc1 = ntfs (Microsoft Recovery partition) (499mb)
  2. sdc2 = fat32 (/boot/efi) (100mb)
  3. sdc3 = Microsoft Reserved (16mb)
  4. sdc4 = ntfs (mounted as ~/DataBU) (931gb)

sdd (223gb)

  1. sdd1 = ntfs (Microsoft Recovery partition) 94mb)
  2. sdd2 = fat32 (/boot/efi) (78mb)
  3. sdd3 = msftres (16mb)
  4. sdd4 = ntfs (mounted as ~/WinSys) (223gb)

Does any of this bring up new thoughts?

I’m beginning to think the brave thing to do would be to go ahead with the Trident installation and see what new confusion its boot loader/menu brings to the table. I just don’t know if I’m that brave. :slight_smile:


#7

Could you post the contents of grub.conf in its entirety?
Someone here should be able to help decipher what it is doing.

Are you familiar with msconfig.exe in Windows?
In that app there is a way to edit the hidden boot.ini file in Windows.
Of course don’t change anything but could you jot down what is in there and note it here?


#8

locate grub.conf turns up no sign of a file by that name. I’ve run updatedb several times over the last few days, so I know the database up to date.

Perhaps this version of Mint (19.1) doesn’t use that file any longer.

There’s no file by that name on C:\ but msconfig’s Boot tab looks like this:
msconfig


#9

My bad regarding boot.ini and msconfig. That is for an older version of Windows.

The correct app is bcdedit.

Search for cmd, right-click it and select Run as Administrator, and then run bcdedit.
That should spit out the needed information. Could you post that?

In Mint the grub.conf file is in /boot/grub. You posted some of its contents earlier.


#10

I’ll have to reboot to get the Windows stuff, but for now…

Ah! Slightly different name. On my system it’s called: grub.cfg and it’s a long one:

#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by grub-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#

### BEGIN /etc/grub.d/00_header ###
if [ -s $prefix/grubenv ]; then
  set have_grubenv=true
  load_env
fi
if [ "${next_entry}" ] ; then
   set default="${next_entry}"
   set next_entry=
   save_env next_entry
   set boot_once=true
else
   set default="0"
fi

if [ x"${feature_menuentry_id}" = xy ]; then
  menuentry_id_option="--id"
else
  menuentry_id_option=""
fi

export menuentry_id_option

if [ "${prev_saved_entry}" ]; then
  set saved_entry="${prev_saved_entry}"
  save_env saved_entry
  set prev_saved_entry=
  save_env prev_saved_entry
  set boot_once=true
fi

function savedefault {
  if [ -z "${boot_once}" ]; then
    saved_entry="${chosen}"
    save_env saved_entry
  fi
}
function recordfail {
  set recordfail=1
  if [ -n "${have_grubenv}" ]; then if [ -z "${boot_once}" ]; then save_env recordfail; fi; fi
}
function load_video {
  if [ x$feature_all_video_module = xy ]; then
    insmod all_video
  else
    insmod efi_gop
    insmod efi_uga
    insmod ieee1275_fb
    insmod vbe
    insmod vga
    insmod video_bochs
    insmod video_cirrus
  fi
}

if [ x$feature_default_font_path = xy ] ; then
   font=unicode
else
insmod part_gpt
insmod ext2
set root='hd0,gpt1'
if [ x$feature_platform_search_hint = xy ]; then
  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt1 --hint-efi=hd0,gpt1 --hint-baremetal=ahci0,gpt1  260b4e10-086f-4f3a-9ac2-2b1f9477ca84
else
  search --no-floppy --fs-uuid --set=root 260b4e10-086f-4f3a-9ac2-2b1f9477ca84
fi
    font="/usr/share/grub/unicode.pf2"
fi

if loadfont $font ; then
  set gfxmode=auto
  load_video
  insmod gfxterm
fi
terminal_output gfxterm
if [ "${recordfail}" = 1 ] ; then
  set timeout=30
else
  if [ x$feature_timeout_style = xy ] ; then
    set timeout_style=hidden
    set timeout=10
  # Fallback hidden-timeout code in case the timeout_style feature is
  # unavailable.
  elif sleep --interruptible 10 ; then
    set timeout=0
  fi
fi
### END /etc/grub.d/00_header ###

### BEGIN /etc/grub.d/05_debian_theme ###
set menu_color_normal=white/black
set menu_color_highlight=black/light-gray
### END /etc/grub.d/05_debian_theme ###

### BEGIN /etc/grub.d/10_linux ###
function gfxmode {
	set gfxpayload="${1}"
	if [ "${1}" = "keep" ]; then
		set vt_handoff=vt.handoff=1
	else
		set vt_handoff=
	fi
}
if [ "${recordfail}" != 1 ]; then
  if [ -e ${prefix}/gfxblacklist.txt ]; then
    if hwmatch ${prefix}/gfxblacklist.txt 3; then
      if [ ${match} = 0 ]; then
        set linux_gfx_mode=keep
      else
        set linux_gfx_mode=text
      fi
    else
      set linux_gfx_mode=text
    fi
  else
    set linux_gfx_mode=keep
  fi
else
  set linux_gfx_mode=text
fi
export linux_gfx_mode
menuentry 'Linux Mint 19.1 Xfce' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-260b4e10-086f-4f3a-9ac2-2b1f9477ca84' {
	recordfail
	load_video
	gfxmode $linux_gfx_mode
	insmod gzio
	if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
	insmod part_gpt
	insmod ext2
	set root='hd0,gpt1'
	if [ x$feature_platform_search_hint = xy ]; then
	  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt1 --hint-efi=hd0,gpt1 --hint-baremetal=ahci0,gpt1  260b4e10-086f-4f3a-9ac2-2b1f9477ca84
	else
	  search --no-floppy --fs-uuid --set=root 260b4e10-086f-4f3a-9ac2-2b1f9477ca84
	fi
        linux	/boot/vmlinuz-4.15.0-45-generic root=UUID=260b4e10-086f-4f3a-9ac2-2b1f9477ca84 ro  quiet splash $vt_handoff
	initrd	/boot/initrd.img-4.15.0-45-generic
}
submenu 'Advanced options for Linux Mint 19.1 Xfce' $menuentry_id_option 'gnulinux-advanced-260b4e10-086f-4f3a-9ac2-2b1f9477ca84' {
	menuentry 'Linux Mint 19.1 Xfce, with Linux 4.15.0-45-generic' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.15.0-45-generic-advanced-260b4e10-086f-4f3a-9ac2-2b1f9477ca84' {
		recordfail
		load_video
		gfxmode $linux_gfx_mode
		insmod gzio
		if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
		insmod part_gpt
		insmod ext2
		set root='hd0,gpt1'
		if [ x$feature_platform_search_hint = xy ]; then
		  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt1 --hint-efi=hd0,gpt1 --hint-baremetal=ahci0,gpt1  260b4e10-086f-4f3a-9ac2-2b1f9477ca84
		else
		  search --no-floppy --fs-uuid --set=root 260b4e10-086f-4f3a-9ac2-2b1f9477ca84
		fi
		echo	'Loading Linux 4.15.0-45-generic ...'
	        linux	/boot/vmlinuz-4.15.0-45-generic root=UUID=260b4e10-086f-4f3a-9ac2-2b1f9477ca84 ro  quiet splash $vt_handoff
		echo	'Loading initial ramdisk ...'
		initrd	/boot/initrd.img-4.15.0-45-generic
	}
	menuentry 'Linux Mint 19.1 Xfce, with Linux 4.15.0-45-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.15.0-45-generic-recovery-260b4e10-086f-4f3a-9ac2-2b1f9477ca84' {
		recordfail
		load_video
		insmod gzio
		if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
		insmod part_gpt
		insmod ext2
		set root='hd0,gpt1'
		if [ x$feature_platform_search_hint = xy ]; then
		  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt1 --hint-efi=hd0,gpt1 --hint-baremetal=ahci0,gpt1  260b4e10-086f-4f3a-9ac2-2b1f9477ca84
		else
		  search --no-floppy --fs-uuid --set=root 260b4e10-086f-4f3a-9ac2-2b1f9477ca84
		fi
		echo	'Loading Linux 4.15.0-45-generic ...'
	        linux	/boot/vmlinuz-4.15.0-45-generic root=UUID=260b4e10-086f-4f3a-9ac2-2b1f9477ca84 ro recovery nomodeset 
		echo	'Loading initial ramdisk ...'
		initrd	/boot/initrd.img-4.15.0-45-generic
	}
	menuentry 'Linux Mint 19.1 Xfce, with Linux 4.15.0-20-generic' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.15.0-20-generic-advanced-260b4e10-086f-4f3a-9ac2-2b1f9477ca84' {
		recordfail
		load_video
		gfxmode $linux_gfx_mode
		insmod gzio
		if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
		insmod part_gpt
		insmod ext2
		set root='hd0,gpt1'
		if [ x$feature_platform_search_hint = xy ]; then
		  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt1 --hint-efi=hd0,gpt1 --hint-baremetal=ahci0,gpt1  260b4e10-086f-4f3a-9ac2-2b1f9477ca84
		else
		  search --no-floppy --fs-uuid --set=root 260b4e10-086f-4f3a-9ac2-2b1f9477ca84
		fi
		echo	'Loading Linux 4.15.0-20-generic ...'
	        linux	/boot/vmlinuz-4.15.0-20-generic root=UUID=260b4e10-086f-4f3a-9ac2-2b1f9477ca84 ro  quiet splash $vt_handoff
		echo	'Loading initial ramdisk ...'
		initrd	/boot/initrd.img-4.15.0-20-generic
	}
	menuentry 'Linux Mint 19.1 Xfce, with Linux 4.15.0-20-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.15.0-20-generic-recovery-260b4e10-086f-4f3a-9ac2-2b1f9477ca84' {
		recordfail
		load_video
		insmod gzio
		if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
		insmod part_gpt
		insmod ext2
		set root='hd0,gpt1'
		if [ x$feature_platform_search_hint = xy ]; then
		  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt1 --hint-efi=hd0,gpt1 --hint-baremetal=ahci0,gpt1  260b4e10-086f-4f3a-9ac2-2b1f9477ca84
		else
		  search --no-floppy --fs-uuid --set=root 260b4e10-086f-4f3a-9ac2-2b1f9477ca84
		fi
		echo	'Loading Linux 4.15.0-20-generic ...'
	        linux	/boot/vmlinuz-4.15.0-20-generic root=UUID=260b4e10-086f-4f3a-9ac2-2b1f9477ca84 ro recovery nomodeset 
		echo	'Loading initial ramdisk ...'
		initrd	/boot/initrd.img-4.15.0-20-generic
	}
}

### END /etc/grub.d/10_linux ###

### BEGIN /etc/grub.d/20_linux_xen ###

### END /etc/grub.d/20_linux_xen ###

### BEGIN /etc/grub.d/20_memtest86+ ###
### END /etc/grub.d/20_memtest86+ ###

### BEGIN /etc/grub.d/30_os-prober ###
menuentry 'Windows Boot Manager (on /dev/sdc2)' --class windows --class os $menuentry_id_option 'osprober-efi-E42A-F805' {
	insmod part_gpt
	insmod fat
	set root='hd2,gpt2'
	if [ x$feature_platform_search_hint = xy ]; then
	  search --no-floppy --fs-uuid --set=root --hint-bios=hd2,gpt2 --hint-efi=hd2,gpt2 --hint-baremetal=ahci2,gpt2  E42A-F805
	else
	  search --no-floppy --fs-uuid --set=root E42A-F805
	fi
	chainloader /efi/Microsoft/Boot/bootmgfw.efi
}
menuentry 'Windows Boot Manager (on /dev/sdd2)' --class windows --class os $menuentry_id_option 'osprober-efi-E42A-F805' {
	insmod part_gpt
	insmod fat
	set root='hd3,gpt2'
	if [ x$feature_platform_search_hint = xy ]; then
	  search --no-floppy --fs-uuid --set=root --hint-bios=hd3,gpt2 --hint-efi=hd3,gpt2 --hint-baremetal=ahci3,gpt2  E42A-F805
	else
	  search --no-floppy --fs-uuid --set=root E42A-F805
	fi
	chainloader /EFI/Microsoft/Boot/bootmgfw.efi
}
set timeout_style=menu
if [ "${timeout}" = 0 ]; then
  set timeout=10
fi
### END /etc/grub.d/30_os-prober ###

### BEGIN /etc/grub.d/30_uefi-firmware ###
menuentry 'System setup' $menuentry_id_option 'uefi-firmware' {
	fwsetup
}
### END /etc/grub.d/30_uefi-firmware ###

### BEGIN /etc/grub.d/40_custom ###
# This file provides an easy way to add custom menu entries.  Simply type the
# menu entries you want to add after this comment.  Be careful not to change
# the 'exec tail' line above.
### END /etc/grub.d/40_custom ###

### BEGIN /etc/grub.d/41_custom ###
if [ -f  ${config_directory}/custom.cfg ]; then
  source ${config_directory}/custom.cfg
elif [ -z "${config_directory}" -a -f  $prefix/custom.cfg ]; then
  source $prefix/custom.cfg;
fi
### END /etc/grub.d/41_custom ###

#11

Here it is:

Windows Boot Manager
--------------------
identifier              {bootmgr}
device                  partition=\Device\HarddiskVolume5
path                    \EFI\MICROSOFT\BOOT\BOOTMGFW.EFI
description             Windows Boot Manager
locale                  en-US
inherit                 {globalsettings}
default                 {current}
resumeobject            {6e37ef95-f35b-11e8-acda-afc13b4ddf72}
displayorder            {current}
toolsdisplayorder       {memdiag}
timeout                 30

Windows Boot Loader
-------------------
identifier              {current}
device                  partition=C:
path                    \Windows\system32\winload.efi
description             Windows 10
locale                  en-US
inherit                 {bootloadersettings}
recoverysequence        {6e37ef97-f35b-11e8-acda-afc13b4ddf72}
displaymessageoverride  Recovery
recoveryenabled         Yes
isolatedcontext         Yes
allowedinmemorysettings 0x15000075
osdevice                partition=C:
systemroot              \Windows
resumeobject            {6e37ef95-f35b-11e8-acda-afc13b4ddf72}
nx                      OptIn
bootmenupolicy          Standard

#12

You mentioned:

That you have to change boot priorities to boot between the two systems.
The #1 entry in the UEFI/BIOS boots straight into Windows 10.
And P4:KINGSTON is sdd,

That tells me Windows is installed on /dev/sdd.
And would mean that Windows is using the /dev/sdd2 EFI partition.
Could you post a screenshot from diskmgr in Windows?
I just want to make sure I know exactly which EFI partition is being used.

From the grub.cfg file:

set root='hd0,gpt1'

indicates that Mint is installed on the 1st drive (hd0, drive numbering starts at 0)
on the 1st partition (gpt1, partition numbering starts at 1) i.e. /dev/sda1

I’m just not sure if the system was booted using UEFI or BIOS.
In Mint does /sys/firmware/efi exist? That would indicate it was booted using UEFI.

For backward compatibility, most UEFI implementations also support booting from MBR-partitioned disks, through the Compatibility Support Module (CSM) that provides legacy BIOS compatibility. In that case, booting Linux on UEFI systems is the same as on legacy BIOS-based systems.

In the UEFI/BIOS is there a compatibility option and is it turned on?

It’s starting to look like:

You could put rEFInd on /dev/sdd2.
Configue the UEFI/BIOS to book from P4:KINGSTON.
And just have rEFInd find all your operating systems (Mint, Trinity, and WIndows).

I would just double and triple check stuff before taking the plunge.


#13

Yes.

Boot Mode Select in the BIOS/UEFI is set to UEFI with CSM.

Okay, I’ll go over everything once more in the morning. Thanks so much for helping me sort this out.

Oh. And here’s a shot of the Disk Management window:


#14

I read through the docs, but I don’t see any mention of how to install rEFInd on a specific partition. I’ll read through again more carefully, but if you could give me a hint?


#15

I found that the manual install method worked best for me. In was the simplest for me to understand.
It’s basically just a matter of copying some stuff to the EFI partition and setting it as the active boot loader. It should auto find the other operating systems.

https://www.rodsbooks.com/refind/installing.html#manual

Also, since you are dual booting make sure you turn off Windows “fast boot”.

I would also turn off the Compatibility Support Module (CSM) and make sure you can get into both systems. If you can’t get into them you can always turn it back on.

I just think that it would be easier using only UEFI mode instead of UEFI and UEFI CSM. That way you only have to set up drives bootable in UEFI mode instead of drives bootable in UEFI mode and drives bootable in UEFI CSM mode. i.e. no legacy BIOS compatibility.

Since /sys/firmware/efi exists in Mint that would imply the use use of UEFI. What are the contents of the /boot/efi folder in Mint? That is probably where Mint is storing its EFI (Extensible Firmware Interface) system partition stuff.

From the Disk Management window:

Drive C: (/dev/sdd4) is marked as boot so that is where Windows is. That would imply that /dev/sdd2 is the EFI partition that Windows is using.

There is the 2nd EFI partition (/dev/sdc2) but there is no corresponding partition marked as boot on that drive.

You should be able to verify which EFI is being used by viewing the contents of both EFI partitions.

Then there is the Elements F: drive which is marked as active. It is my understanding that the drive marked as active is the boot drive when in UEFI CSM (legacy BIOS compatibility) mode. When in UEFI mode the EFI partition is used.

I hope I did not forget anything.

The output from the mount command in Mint would show if one of the EFI partitions is getting mounted to /boot/efi.


#16

Would it be worth creating a bootable USB rEFInd, booting from it and then seeing what it picks up? Then try booting the results of rEFInds auto bootloader scans. This would confirm that the partitions are performing the expected purposes and confirm that rEFInd can boot them with or without modification. The EFI Shell could be used for troubleshooting, although hopefully that won’t be necessary.

Alternatively, a listing of EFI/boot/ or similar would be a good confirming step to view the contents of both EFI partitions. Then it’s easier to give specific help to do the manual install into an existing EFI partition if I understand your current thinking correctly?


#17

I tried that early on and the results weren’t pretty.

And I should tell the thread: I’ve put all this on the back burner for now. I ran out of time, so I’ll have to wait and try again in a couple of months.

What I’ll be trying then is a different install order:

  • Windows 10,
  • FreeBSD 12, and
  • finally Linux Mint.

#18

This should work just fine. Leaving you with grub2 (used by Mint) as the main boot loader.
Though you really shouldn’t have to go through the trouble of re-installing everything.

While confusing, installing rEFInd really is as simple as copying some files over to the EFI partition and designating it as the main boot loader (7 steps for the manual install).

Best of luck on your next attempt.


#19

True, but it’s less messing around. I bought an extra SSD for experimenting, so I don’t have to give up a working system to try this next time. I’ll just remove all drives from my laptop, stick in the new SSD and bang on it until it works. :slight_smile:

Thanks!