Linux – How to install FreeBSD alongside Linux, with the ZFS file system for the root

dual-bootfreebsdlinuxzfs

The installer of FreeBSD 11.2 makes it fairly easy to install FreeBSD with a UFS root partition alongside Linux, using the Auto (UFS) option in the following dialogue:

enter image description here

Next it gives me the option to either use the entire disk or partition the disk to make a place for the install:

enter image description here

If I choose the Auto (ZFS) option I'm not given the option to partition the disk to prepare a place for the system to be installed. Therefore, I am wondering whether I can in fact install FreeBSD on a ZFS root alongside a Linux install, or whether it's a matter of if I want a ZFS root FreeBSD needs the entire disk.

The reason that I am looking at using a ZFS root is that I am presently having trouble with installing FreeBSD with a UFS root on a GPT partition table and I'm wondering whether using a ZFS root will be a decent workaround.

Can I install FreeBSD with ZFS for the root alongside other operating systems in existing partitions using the FreeBSD 11.2 installer? How?

Best Answer

You can install FreeBSD manually on ZFS too. It is possible that the FreeBSD installer only supports having ZFS as the only thing on a drive, but that limitation does not exist in ZFS itself. You can put ZFS anywhere; on a partition, on an encrypted partition, on a virtual block device; anywhere.

So if you want to have several partitions and have one partition carry the ZFS filesystem and use it for booting FreeBSD, that is possible.

You can try to follow this guide:

Do make sure to make backups of the disk you are working with, so you can make mistakes without disaster.

Bewarned that FreeBSD might support more ZFS features (zpool-features) than Linux does; meaning that it might be best to create a ZFS pool without all features enabled, but rather enable the features you are actually going to use. You can always enable features later, but you cannot disable them later. So too many features could mean the entire ZFS pool is unusable in Linux, because it might not support one or two features present in BSD.

See what features your FreeBSD support:

  • man zpool-features
  • zpool upgrade -v

List of ZFS features and their OS support:

Related Question