Do I need an separate EFI partition for each OS sharing a common disk

bootefifreebsdinstallationpartitioning

I was installing FreeBSD on my MacBook Air. When partitioning the disk, the installer told me

This partition scheme requires a boot partition for the disk to be bootable. Would you like to make one now? <Yes/No>

The problem is, I already have an EFI partition on my internal SSD, which presumably serves macOS. Do I need to create a different one for FreeBSD?

I've done some painful experiments on this issue:

  • When I chose No, FreeBSD becomes unbootable, i.e. "FreeBSD" is simply not shown in rEFInd's menu.
  • When I chose Yes, "the FreeBSD installer appears to have created a very bad hybrid MBR on your disk, and this is confusing OS X", and thus my disk got corrupted. Fortunately, after I follow @Rod Smith's instruction (created a new protective MBR to replace the bad hybrid MBR), this problem is solved now, but now my disk have 2 EFI partitions.

    Now my internal SSD looks like this:

    sunqingyaos-MacBook-Air:~ sunqingyao$ diskutil list
    /dev/disk0 (internal, physical):
       #:                       TYPE NAME                    SIZE       IDENTIFIER
       0:      GUID_partition_scheme                        *121.3 GB   disk0
       1:                        EFI EFI                     209.7 MB   disk0s1
       2:                  Apple_HFS Macintosh HD            60.6 GB    disk0s2
       3:                 Apple_Boot Recovery HD             650.0 MB   disk0s3
       4:                        EFI EFI                     209.7 MB   disk0s4
       5:                FreeBSD UFS                         53.5 GB    disk0s5
       6:               FreeBSD Swap                         6.2 GB     disk0s6
       7: 83BD6B9D-7F41-11DC-BE0B-001560B84F0F               101.4 KB   disk0s7
    

    Also,

    sunqingyaos-MacBook-Air:~ sunqingyao$ sudo gpt -r show disk0
    Password:
          start       size  index  contents
              0          1         PMBR
              1          1         Pri GPT header
              2         32         Pri GPT table
             34          6
             40     409600      1  GPT part - C12A7328-F81F-11D2-BA4B-00A0C93EC93B
         409640  118284248      2  GPT part - 48465300-0000-11AA-AA11-00306543ECAC
      118693888    1269536      3  GPT part - 426F6F74-0000-11AA-AA11-00306543ECAC
      119963424     409600      4  GPT part - C12A7328-F81F-11D2-BA4B-00A0C93EC93B
      120373024  104447992      5  GPT part - 516E7CB6-6ECF-11D6-8FF8-00022D09712B
      224821016   12156928      6  GPT part - 516E7CB5-6ECF-11D6-8FF8-00022D09712B
      236977944        198      7  GPT part - 83BD6B9D-7F41-11DC-BE0B-001560B84F0F
      236978142          1
      236978143         32         Sec GPT table
      236978175          1         Sec GPT header
    

Best Answer

ESPs are usually shared across OSes, so no, you don't need a second one; but it also should not cause problems. That said, some tools or OSes may become confused by the presence of two ESPs. The Windows installer is the only example of which I'm aware. (This affects Windows 7, but I don't know about later versions.) If you run into such a problem, you can always change the type code on the ESP you don't want the Windows installer to use -- even just temporarily. (A temporary change can be useful if you want to install two Windows versions, each with its own ESP.)

The location of the ESPs relative to your other partitions makes deleting either one awkward -- to recover the space, you'd need to move the start point of at least one partition, which is time-consuming and dangerous. This may not be worthwhile to recover only about 200 MB of space -- but then again, your disk is only 120 GB. You'll have to judge just how precious your space is, vs. the time and risk involved.