Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 11 Jan 2019 16:25:01 -0700
From:      Warner Losh <imp@bsdimp.com>
To:        Walter Parker <walterp@gmail.com>
Cc:        FreeBSD-STABLE Mailing List <freebsd-stable@freebsd.org>
Subject:   Re: Boot from one drive and load FreeBSD from another
Message-ID:  <CANCZdfqtm7ni5Y4TdvhEqRb42JtNcMbDRJ4u%2BZYj-=0-=2Ne%2Bw@mail.gmail.com>
In-Reply-To: <CAMPTd_AqpY05xSFwj721SNspuRS5b_=CYvCSRXePNQT1TYzaYg@mail.gmail.com>
References:  <CAMPTd_AqpY05xSFwj721SNspuRS5b_=CYvCSRXePNQT1TYzaYg@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, Jan 11, 2019 at 3:09 PM Walter Parker <walterp@gmail.com> wrote:

> Hi,
>
> I'd like to boot FreeBSD 12 on a system where the OS is installed to a ZFS
> pool that can't be booted by the OS.
>
> This is a pre-UEFI machine. It has a pair of SAS drives and 3 PCIe slots.
> What I'd like to do is put the boot loader on the SAS drive and then have
> FreeBSD load from a ZFS mirror created using 2 nvme SSD drives on PCIe to
> M.2 adapter cards. The BIOS is old enough that it will not boot from a PCIe
> card.
>
> If I create a FreeBSD-boot partition on the SAS drive and a FreeBSD-zfs
> partition on the ZFS mirror, will the boot partition loader automatically
> find the ZFS pool? If not, is there anything special I can do to force a
> boot?
>

So on older BIOS machines, there's a two stage boot process. The first
stage loads gptboot off a dedicated partition (which is type FreeBSD-boot,
iirc). This stage then finds the 'root' filesystem, and loads /boot/loader
from that. Newer /boot/loader should have the right fallback logic to fall
back to a ZFS pool properly. However, there's a catch that will trip you
up: the devices with the zpool have to be presented as BIOS devices. It
sounds like in your case they are not. This means you'll have to do the
next best thing: You'll need a small FreeBSD UFS partition and need to
pivot to the ZFS root. I've not done this, so it may be a bit of a pita,
but it looks to be documented in reboot(8) and init(8).

Second, if I want to do this on a second machine that does have UEFI, can I
> do the same thing? This time, I think would I would do is put a UEFI boot
> partition on the SAS drive and have it find the FreeBSD-zfs partition on
> the ZFS mirror.
>

Yes. You could do that. If the RAID controller the drives are on has UEFI
support, then it will be automatic. Otherwise, you'll need to fall back to
the method described above.

Warner



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CANCZdfqtm7ni5Y4TdvhEqRb42JtNcMbDRJ4u%2BZYj-=0-=2Ne%2Bw>