Bug 236187 - /boot/loader.efi doesn't import a mirrored pool on UEFI system
Summary: /boot/loader.efi doesn't import a mirrored pool on UEFI system
Status: Closed Not A Bug
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: 12.0-RELEASE
Hardware: amd64 Any
: --- Affects Only Me
Assignee: freebsd-bugs mailing list
URL:
Keywords: uefi
Depends on:
Blocks:
 
Reported: 2019-03-03 21:10 UTC by Grzegorz Junka
Modified: 2019-03-04 20:40 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Grzegorz Junka 2019-03-03 21:10:37 UTC
There are two nvd disks, nvd0 and nvd1. freebsd-swap and freebsd-zfs are created as partitions 2 & 3 on both disks respectively. The EFI partition contains standard files:

/efi/boot/BOOTx64.efi
/efi/boot/startup.nsh

BOOTx64.efi is copied from /boot/loader.efi from the memstick installation media. When booting from the memstick and importing the pool "zpool status" shows the following:

pool: tank7
state: ONLINE
scan: none requested
config:
  NAME STATE READ WRITE CKSUM
  tank7 ONLINE 0 0 0
    mirror-0 ONLINE 0 0 0
      nvd0p3 ONLINE 0 0 0
      nvd1p3 ONLINE 0 0 0
errors: No known data errors

zfs list shows (when mounted with altroot=/mnt:

NAME USED AVAIL REFER MOUNTPOINT
tank7 2.62G 220G 88K none
tank7/ROOT 1.87G 220G 88K none
tank7/ROOT/default 1.87G 220G 1.87G /mnt
(...)

efibootmgr -v gives the following

BootCurrent: 0005
Timeout : 5 seconds.
BootOrder: 0000, 0005, 0006, 0003
  Boot0* Windows Boot Manager HD(5,GPT,5804e565-b8f6-4f47-9314-9eb4cfb79697,0x1d55e000,0x32000)/File(\EFI\MICROSOFT\BOOT\BOOTMGFW.EFI) nvd1p5:/EFI/MICROSOFT/BOOT/BOOTMGFW.EFI (null)
* Boot5* UEFI OS HD(1,GPT,f4ec62c3-b000-4a60-aaa6-7079751a497d,0x800,0x64000)/File(\EFI\BOOT\BOOTX64.EFI) nvd1p1:/EFI/BOOT/BOOTX64.EFI (null)
  Boot6* Hard Drive BBS(HD,,0x0)
  Boot3 UEFI: Built-in EFI Shell VenMedia(5023b95c-db26-429b-a648-bd47664c8012)

When trying to boot the UEFI shell prints the following:

>> FreeBSD EFI boot block
  Loader path: /boot/loader.efi

  Initializing modules: ZFS UFS
  Load Path: \efi\boot\BOOTx64.efi
  Load Device: PciRoot(0x0)/Pci(0x1,0x3)/Pci(0x0,0x2)/Pci(0x4,0x0)/Pci(0x0,0x0)/NVMe(0x1,8D-7F-B1-71-55-38-25-00)/HD(1,GPT,F4EC62C3-B000-4A60-AAA6-7079751A497D,0x800,0x64000)
  BootCurrent: 0003
  BootOrder: 0000 0005 0006 0003[*]
  Probing 12 block devices......+...*.... done
    ZFS found the following pools: tank7
    UFS found no partitions
Failed to load '/boot/loader.efi'
panic: No bootable partions found!

Note that the zpool.cache is not created/present in the pool (which I understand is no longer needed?)
Comment 1 Grzegorz Junka 2019-03-04 20:40:43 UTC
This was due to bootfs not being set. zpool set bootfs=tank7/ROOT/default tank7 allowed the system to boot correctly. Please close.