1

I have a 250GB SSD (sda) with Windows 10 on NTFS. A second 1TB SSD (sdb) has MacOS 10.15.7 using apfs, and Linux Mint 20 using btrfs and two spare partitions using ext4. I have installed rEFInd and had multiboot all working. Maybe I was lucky but I had done a lot of reading of Rod Smith's documentation, maybe not enough. Both SSDs are gpt and have EFI partitions. Something happened and I'm not sure what exactly, but now, I can only boot MacOS; directly (holding alt key), and from rEFInd. rEFInd still shows the correct 3 operating system icons. I can boot into live USBs for linux and grub. I cannot boot Windows or Mint from the SSDs at all, but they are still there. I have run grub-repair, but that does not seem to make things better. It moves rEFInd down the bootorder and I have to use efibootmgr to put it back.

Q1. With two SSDs, how do you decide which one gets the /EFI/rEFInd folder?

Q2. Why do I get /EFI/ubuntu folders on both SSDs?

Q3. Given my two SSDs and the folders below, what would be the correct grub menuentry for each of the OSs?

Q4. The listing shows sda and sdb, and I can see how they equate to hd0 and hd1. But live grub2 refers to hd8,gpt3 (for WindowsOS) and hd9,gpt3 (for btfrs (mint)). Where does the 8 and 9 come from?

Thanks

mint@mint:~$ sudo fdisk -l

Disk /dev/sda: 233.78 GiB, 251000193024 bytes, 490234752 sectors
Disk model: APPLE SSD SM256E
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: E38BCA08-61D9-45FC-8828-D08FD28E1A22

Device         Start       End   Sectors   Size Type                 FS      Flags       Comments
/dev/sda1       2048    206847    204800   100M EFI System           fat32   boot,esp  
/dev/sda2     206848    239615     32768    16M Microsoft reserved   unknown msftres
/dev/sda3     239616 489196172 488956557 233.2G Microsoft basic data ntfs    msftdata    Windows OS
/dev/sda4  489197568 490231807   1034240   505M Windows recovery env ntfs    hidden,diag


Disk /dev/sdb: 931.53 GiB, 1000204886016 bytes, 1953525168 sectors
Disk model: Samsung SSD 860 
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: EF574C35-C453-45DC-9D86-1DE841DD934E

Device          Start        End   Sectors   Size Type                FS     Flags       Comment
/dev/sdb1          40     409639    409600   200M EFI System          fat32  boot,esp 
/dev/sdb2      409640  585615815 585206176   279G unknown             apfs               MacOS Catalina  
/dev/sdb3   585617408 1171347455 585730048 279.3G Linux filesystem    btrfs              Linux Mint
/dev/sdb4  1171347456 1562437631 391090176 186.5G Linux filesystem    ext4               Spare1 not used  
/dev/sdb5  1562437632 1953523711 391086080 186.5G Linux filesystem    ext4               Spare2 not used


mint@mint:/mnt$ tree -L 5 -P *.efi --ignore-case      sda
.
└── EFI
    ├── Boot
    │   └── bootx64.efi
    ├── Microsoft
    │   ├── Boot
    │   │   ├── bootmgfw.efi
    │   │   ├── bootmgr.efi
    │   │   └── memtest.efi
    │   └── Recovery
    └── ubuntu
        ├── grubx64.efi
        └── shimx64.efi

6 directories, 3 files

mint@mint:/mnt$ tree -L 5 -P *.efi --ignore-case       sdb
.
└── EFI
    ├── APPLE
    │   └── CACHES
    │       └── CAFEBEEF
    ├── BOOT
    │   ├── BOOTX64.EFI
    │   ├── fbx64.efi
    │   └── mmx64.efi
    ├── Linux
    │   ├── grubx64.efi
    │   ├── mmx64.efi
    │   └── shimx64.efi
    ├── refind
    │   ├── icons
    │   │   └── licenses
    │   ├── icons-backup
    │   │   └── licenses
    │   ├── keys
    │   └── refind_x64.efi
    ├── tools
    │   └── gptsync_x64.efi
    └── ubuntu
        ├── grubx64.efi
        ├── mmx64.efi
        └── shimx64.efi

mint@mint:/boot$ tree                                sdb3 Linux Mint /boot
.
├── System.map-5.4.0-26-genericefibootmgr
├── config-5.4.0-26-generic
├── grub
│   ├── gfxblacklist.txt
│   ├── grubenv
│   └── unicode.pf2
├── initrd.img -> initrd.img-5.4.0-26-generic
├── initrd.img.old -> initrd.img-5.4.0-26-generic
├── vmlinuz -> vmlinuz-5.4.0-26-generic
└── vmlinuz.old -> vmlinuz-5.4.0-26-generic

1 directory, 9 files
Les Firth
  • 11
  • 1

1 Answers1

0

Q1. With two SSDs, how do you decide which one gets the /EFI/rEFInd folder?

If, for example, one of the SSDs is soldered on to the system board and the other is detachable, then it might make sense to make sure the detachable SSD also has its own ESP partition and the appropriate bootloader folder within it, so it can be more easily transplanted to another system if/when the need arises.

If the system firmware has problems detecting one SSD but can reliably detect the other, then your only choice might be to use the readily-detectable SSD to contain all your bootloaders and all the things your OSs need to start up their own kernel and storage drivers.

Other than that, it's mostly a matter of your preference.

Q2. Why do I get /EFI/ubuntu folders on both SSDs?

One of the following:

  • If the installer sees multiple ESP partitions, it might play it safe by adding Ubuntu's bootloader to every one of them. Perhaps the firmware cannot see them all, or some of the disks are removable and the installer does not know which ones those might be.

  • grub-repair/boot-repair may have created an extra copy for you, figuring that since the you're running a repair action, the initial installation on one of the disks perhaps did not work for some reason.

Q3. Given my two SSDs and the folders below, what would be the correct grub menuentry for each of the OSs?

MacOS might not be bootable via GRUB, as it seems to use APFS which is not yet supported by GRUB. Before the introduction of APFS, the required GRUB menuentry would have been something like this:

menuentry "OS X" {
    insmod hfsplus
    search --set=root --file /System/Library/CoreServices/boot.efi
    chainloader /System/Library/CoreServices/boot.efi
}

Unfortunately you did not include the output of sudo blkid or lsblk -o +UUID which would have included the correct filesystem UUIDs of the various filesystems. You also did not identify your Linux root filesystem: I guess it's either /dev/sdb4 or /dev/sdb5.

For Windows, the minimal GRUB boot entry could look like this:

menuentry 'Windows Boot Manager' {
        insmod part_gpt
        insmod fat
        search --no-floppy --fs-uuid --set=root <place the UUID reported for the sda1 partition here>
        chainloader /EFI/Microsoft/Boot/bootmgfw.efi
}

For Mint, the minimal GRUB boot entry could look like this:

menuentry "Linux Mint" {
        insmod gzio
        insmod part_gpt
        insmod btrfs
        search --no-floppy --fs-uuid --set=root <place the UUID reported for the sdb3 partition here>
        echo "Loading Linux Mint kernel..."
        linux /vmlinuz root=<place the Linux device pathname of the Linux root filesystem here> ro quiet splash
        echo "Loading Linux Mint initramfs..."
        initrd /initrd.img

}

Note: replace the parts within <angle brackets> with real values.

Q4. The listing shows sda and sdb, and I can see how they equate to hd0 and hd1. But live grub2 refers to hd8,gpt3 (for WindowsOS) and hd9,gpt3 (for btfrs (mint)). Where does the 8 and 9 come from?

The UEFI firmware of the system may be presenting not only the SSDs, but also a built-in Internet recovery volume and/or any other storage devices that happened to be plugged in at the time. You might have to go into GRUB command prompt and type ls (hd, then press TAB to see all the disks the firmware has informed GRUB about, and then try and figure out which is which.

telcoM
  • 87,318
  • 3
  • 112
  • 232