Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 5 Nov 2018 10:45:17 +0100
From:      Piotr Kubaj <pkubaj@anongoth.pl>
To:        freebsd-current@freebsd.org, freebsd-ppc@freebsd.org, freebsd-stable@freebsd.org, freebsd-fs@freebsd.org
Subject:   FreeBSD/powerpc64 (POWER9) with ZFS on /
Message-ID:  <20181105094517.GA42797@smtp.iq.pl>

next in thread | raw e-mail | index | archive | help

[-- Attachment #1 --]
ZFS is by default not available for partitioning in bsdinstall. We can, however, use manual partitioning in shell to make ZFS partitions.

But what if we want to do ZFS on /? This is currently not supported out-of-the-box. The reason is that Petitboot, used on POWER9 to boot kernel, doesn't support loading modules (at least when booting FreeBSD). ZFS is by default distributed only as a module, to overcome licensing issues.

There are two ways to boot ZFS on root with Petitboot:
1. We can use initramfs, which will load necessary modules. It's said to be supported on FreeBSD/powerpc64, but no one knows how to create one for FreeBSD :)
2. We can actually compile a custom kernel with ZFS in it (not as a module). This the approach that I use. Unfortunately, I can't redistribute this kernel, because of ZFS's license. I created a custom installation iso, which uses my kernel with ZFS included.

Here are the steps to do it (on an installed powerpc64 system, but should be possible on other architectures after redefining TARGET and TARGET_ARCH):
1. cd /usr/src/sys/powerpc/conf
2. cat << EOF > ZFS
include GENERIC64
options ZFS
EOF
3. cd ../../../
3. make buildworld buildkernel KERNCONF=ZFS
4. cd release
5. make release

When it's done, there will be iso files in /usr/obj/usr/src/powerpc.powerpc64/release.

You can use it to install ZFS on root.

Note that you need a FAT32 partition to mount on /boot.
This partition needs to have /boot/etc/kboot.conf file, with a line like:
FreeBSD='/kernel/kernel kernelname=/boot/kernel/kernel vfs.root.mountfrom=zfs:zroot/ROOT/default'

You also need the appriopriate /etc/fstab:
/dev/nda0p1     /boot           msdosfs rw      2       2

Other than that, howto at https://wiki.freebsd.org/RootOnZFS/GPTZFSBoot#Create_Partitions (from point 2., omit 1.) is totally ok to follow.

Thanks to mmacy for informing me about this little trick with including ZFS to kernel.

-- 
 _________________________________________ 
/ It has been said that man is a rational \
| animal. All my life I have been         |
| searching for evidence which could      |
| support this.                           |
|                                         |
\ -- Bertrand Russell                     /
 ----------------------------------------- 
        \   ^__^
         \  (oo)\_______
            (__)\       )\/\
                ||----w |
                ||     ||

[-- Attachment #2 --]
-----BEGIN PGP SIGNATURE-----

iQJkBAABCgBOFiEEycyIeNkkgohzsoorelmbhSCDnJ0FAlvgES0wFIAAAAAAFQAS
cGthLWFkZHJlc3NAZ251cGcub3JncGt1YmFqQGFub25nb3RoLnBsAAoJEHpZm4Ug
g5ydkKMP/0Xuk8dEY5/ZTu9Olokm4JRw2hXOzVvOhMQG4lJFUfDnAHStWkGEfiYT
4a/6OZJ27mp6g90Rt9vwaMCvD7cSIaVuUYQWDYZ2F0kXVdHzIJdTciFa+CBGEH82
cxirf+hO8sF87jionIhSo9U7U8UKQPYhYtUiH7OdTtFkCUlOIV7TbebdUrlSm90e
4Bf1Sy4g45V58Cn942kyvh8e+xs3lPs/v/lEvi/AoIv9jBkURp/8U8TIGn/Hp/t2
I84wvnRQvlj8oH5m8w6Uzxg9Xj9FFJXzJOcmc/sDpfcKOs+hZBIw1+FybI/Y+sdz
yNU+QttBymFJWSDJVG1i5XcKj5WQWJCV4vYKofjI8KiHYgMq+IUnRXO0tWhqrnYB
L0S+q8OBI7R7EjrOfETJqxmhouXmIyb5NOXXcA94QI40oMbeLIWCiPJps0tyW53V
UCdj4VfdbBfZq8moKaLU5WDsBu5ggxAE4UOStFavDLfomH9CpfYoHgiyEsUEoK7a
Nxx+i1+mImGwqGx/u5v8XO4eBWf6UEFR4DU+8rwTUH03QuEVXWApKg8gim7+bbc0
wolPNm1PODjqIjX/6oFKpYDBYWpYv5nJn66SFLGMAE8ecz0+fTPZhULgP7+QMoQp
51HtwiM0X1a8D+nu8W7XaGaGJ9UTzQEvQoytErTp4ZG56SqudOAR
=UvqB
-----END PGP SIGNATURE-----

Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20181105094517.GA42797>