NetBSD-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: State of ZFS in 9.0_BETA



maya%NetBSD.org@localhost writes:

> On Sat, Aug 10, 2019 at 09:12:23PM +0100, Chavdar Ivanov wrote:
>> I was thinking that if ZFS were in the kernel, it might be easier to
>> get ZFS root.
>
>
> You don't need to build ZFS into the kernel to boot it as a root mount
> (same for FFS). The code to load modules from the bootloader already
> exists. You do, however, need to write/port the functionality to
> do a root mount, and teach the bootloader to read ZFS to find the
> kernel (unless you use EFI boot, then maybe put the kernel on the FAT
> partition).


Yes, you will more or less have to do the equivalent of "zfs mount
pool/rootfs" (where pool/rootfs has either mountpoint set to / or uses
legacy somehow) or "zfs mount -a" (probably not best and it wouldn't
work with legacy) and perhaps a "zpool import" before that, if the pools
were not imported into this particular system.

I note that the FreeBSD folks seem to have a boot loader that does some
of this, but I did not look at how it worked too closely.  And, of
course, you may be able to get ideas from SmartOS.

An alternative to messing with the bootloader may be to leverage sysctl
init.root and pivot onto a zpool dataset after booting into a root boot
partition.  I did this with cgd a couple of years ago.




-- 
Brad Spencer - brad%anduin.eldar.org@localhost - KC8VKS - http://anduin.eldar.org


Home | Main Index | Thread Index | Old Index