Boot environments and manual installation


#1

I am interested if it is possible to install TrueOS alongside Freebsd in it’s own boot environment on ZFS.

Is there a manual installation recipe like for Freebsd?

Is there a procedure to convert a running Freebsd system to TrueOS?

What file structure does TrueOS specifically require on ZFS?

Further on the subject… I am interested in also installing any other operating systems I can in the same zpool such as various distributions of Linux. From my understanding it can’t be seamless and all automounting needs to be disabled. Anyone head of anyone working to enhance the beadm system and zfs automounter to extended boot environments across multiple operating systems…?

My understanding of it now is that I would need to create my own beadm like utiltiy and automounter for each operating system.


#2

trueos/trident support zfs and boot environments.

I know a few people have talked about it, so I’ll assume you can try and install into a new BE, yes

Dual booting using same hard drive, under UEFI is finicky, but doable.

my trident layout;

df -h
Filesystem Size Used Avail Capacity Mounted on
trident/ROOT/13.0-CURRENT-up-20190108_051749 99G 8.7G 91G 9% /
devfs 1.0K 1.0K 0B 100% /dev
tmpfs 19G 556K 19G 0% /libexec/rc/init.d
trident/tmp 91G 176K 91G 0% /tmp
trident/usr/home 150G 59G 91G 40% /usr/home
trident/usr/jails 91G 88K 91G 0% /usr/jails
trident/usr/obj 91G 88K 91G 0% /usr/obj
trident/usr/ports 95G 4.2G 91G 4% /usr/ports
trident/usr/src 91G 88K 91G 0% /usr/src
trident/var/audit 91G 88K 91G 0% /var/audit
trident/var/log 91G 1.8M 91G 0% /var/log
trident/var/mail 91G 112K 91G 0% /var/mail
trident/var/tmp 91G 100K 91G 0% /var/tmp


#3

In theory, if you already have FreeBSD in a root on ZFS environment and doing BEs, TrueOS/Trident should be a relatively simple install into a new BE.
The root on ZFS has some specific requirements relating to which datasets are available and what is mounted where.
root on ZFS plays some good magic with mountpoints; notice that the dataset for tank/usr has mountpoint of “none”. That means any dataset created under it gets it’s own mountpoint, but something like /usr/bin actually is part of the root data set. That’s the magic that lets beadm work.
Here’s an older TrueOS system, current ones should be the same and FreeBSD root on ZFS should also look the same.
zfs list
NAME USED AVAIL REFER MOUNTPOINT
tank 35.5G 185G 88K none
tank/ROOT 17.6G 185G 88K none
tank/ROOT/12.0-CURRENT-up-20180316_031802 304K 185G 5.63G /
tank/ROOT/12.0-CURRENT-up-20180325_093028 304K 185G 5.24G /
tank/ROOT/12.0-CURRENT-up-20180609_051435 17.6G 185G 5.36G /
tank/ROOT/initial 216K 185G 3.65G /mnt
tank/tmp 1.08M 185G 1.08M /tmp
tank/usr 17.8G 185G 88K none
tank/usr/home 17.8G 185G 88K /usr/home
tank/usr/home/myuser 17.8G 185G 17.8G /usr/home/myuser
tank/usr/obj 88K 185G 88K /usr/obj
tank/var 7.11M 185G 88K none
tank/var/audit 88K 185G 88K /var/audit
tank/var/log 6.73M 185G 6.73M /var/log
tank/var/mail 112K 185G 112K /var/mail
tank/var/tmp 96K 185G 96K /var/tmp

How do you intend to use the distribution of Linux? I don’t know of any Linux distributions that understand ZFS out of the box/installer that would install into a BE (I think a bad idea because a BSD /usr/lib is not the same as a Linux /usr/lib). Yes there is a ZFS on Linux.
Now what you can do is create ZFS volumes; basically a chunk of space used as a block device. Typically used as an iSCSI target.
But you can go and treat it like a blank disk. I have no idea if that helps or not.

If you are trying to install Linux into a new BE and then be able to boot into that, I don’t if there is any linux distribution that can do that.


#4

After a little reseach and a couple reply’s (Thank you)…all Freebsd based operating systems should be able to coexist in boot environments just fine.

beadm is just a script. It is indeed relying on the zfs automount features as well as the bootfs property of a pool.

Boot environment should also work with all Linux distributions.

But doing a cross system would require some magic. Loaders (mbr/gpt/uefi) locate and load the kernel first which then load their zfs driver. The loaders use bootfs to navigate the zfs filesystem the kernel and drivers are in. For one operating system type that is fine. For mixed operating systems we would need arbitrary pool properties like bootfs which I’m not sure ZFS handles yet. The kernels also use the bootfs property. But I can imagine all sorts of work arounds which I will not go into.

For now I think I’ll just create my own beadm like utility that can span multiple zfs pools. Smaller pools for /boot and one larger shared volume for various roots.


#5

Have fun and good luck.