Translations of this page:
Show pagesource
AdminRecent ChangesSitemap

How to boot a FreeBSD system in any partitions with loader.efi

In about FreeBSD 12.0-RELEASE, loader.efi has been used as UEFI bootloader instead of prior boot.efi.

Both loaders can boot a FreeBSD system from ZFS or UFS file system. The loader.efi only looks for the file system from the storage which the loader is loaded from though the boot1.efi does from multiple ones. Briefly speaking, the former can't boot the system from other HDDs. Well, it can do it if I operate to set the boot devices manually in loader prompt each time, but it is not realistic.

I thought that it somehow got be able to automatically boot the system, then I read some documents and googled, but there was no idea. After I reluctantly saw the source codes of loader.efi, I found a way using a loader.env file and a rootdev variable.

Regardless of loader.efi or boot1.efi, it eventually uses the value of currdev variable as a boot target. In loader.efi, the 'currdev' is set from a 'rootdev' variable unquestionably if it exists.

And then, it seems the rootdev is set by /efi/freebsd/loader.env file in ESP. This function is developed relatively recently, then FreeBSD 12.2-RELEASE and over support it.

Add a following line to the file to specify the file system path corresponding to root directory in ZFS. The value becomes like disk0p1 in UFS. Suffix colon is not wrong, it's necessary!


They are undocumented as of 9th January 2021, so they may change in the future and also as-is.

Of course, I simply use prior boot1.efi with no need to such a chore way.


en/blog/2021/2021-01-09.txt · Last modified: 2021-01-10 02:30 by Decomo
CC Attribution-Noncommercial-Share Alike 4.0 International Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0