Dual-booting with Linux on ZFS

Hi,

I have a laptop I've been running FreeBSD on for a few months. I set it up with geli+zfs. I am looking to set up a dual-boot with linux for things that aren't as well supported on FreeBSD yet (such as gaming). It would be neat if I could use a subvolume on the existing zfs pool for my linux root, so I wouldn't be stuck with a fixed partition size I might regret later.

I understand that geli is FreeBSD-specific, but if I were to reinstall FreeBSD without it (maybe with zfs native encryption instead), would this be possible?

Thanks in advance.
 
Assuming you were going to redo the install, theres's this guide from 2020 by user (forme user? Haven't seen them in a long time) patovm04. It is based on the premise that you have a Linux install and are going to add a ZFS FreeBSD install. I actually plan to do this when I get around to it, and then I can say if it still works or not.


I know it used to work because I have multiboot laptop with it (Linux plus a FreeBSD zfs install)
 
Thanks, though I'm not sure this is what I was looking for. I ended up trying my idea on a testbench machine and I was able to get it working, though without any encryption enabled. Does FreeBSD support prompting the user for a zfs passphrase on bootup or am I going to be stuck without encryption if I go down this route?
 
No problem doing that, you just need to make sure to not activate ZFS features that the other OS doesn't have when you create it from one OS.
 
Assuming you were going to redo the install, theres's this guide from 2020 by user (forme user? Haven't seen them in a long time) patovm04. It is based on the premise that you have a Linux install and are going to add a ZFS FreeBSD install. I actually plan to do this when I get around to it, and then I can say if it still works or not.

That guide is for dual-booting with another OS separately installed on the drive. The OP wanted both OSs to share storage from the same pool.
 
I was finally able to set up everything on the linux side properly, with encryption enabled. I'm having some trouble with the FreeBSD side though.

It does. Set zfskeys_enable="YES" in /etc/rc.conf. This will prompt for a passphrase mid-booting to unlock the native encrypted ZFS dataset.
Even if I do that, I only see the following output:
Code:
zio_read error: 5
zio_read error: 5
ZFS: i/o error - all block copies unavailable
(repeated like 5 times)
Failed to find bootable partition
zio_read error: 5
ZFS: i/o error - all block copies unavailable
(repeated like 5 times)
ERROR: cannot open /boot/lua/loader.lua: no such file or directory.

It makes sense when I think about it, since rc.conf resides on the filesystem it needs to import. Also I'm pretty sure this step is way before init gets executed anyway?

What is the correct approach here? Should I create a separate boot partition that is unencrypted?
 
It does. Set zfskeys_enable="YES" in /etc/rc.conf. This will prompt for a passphrase mid-booting to unlock the native encrypted ZFS dataset.
Even if I do that, I only see the following output:
Code:
...
Failed to find bootable partition
...
ERROR: cannot open /boot/lua/loader.lua: no such file or directory.
What I suggested was for a unencrypted Root-on-ZFS with non-system-boot critical native ZFS encrypted datasets (e.g.: pool/encrypted).

If you want the whole Root-on-ZFS pool in an encrypted container, with a passphrase to unlock it on boot, than this needs to be in a geli(8) provider, initialized with the -g option, or later configured of a existing provider.
Rich (BB code):
     init       Initialize providers which need to be encrypted.  If multiple
                 ...
                 -g               Enable booting from this encrypted root
                                  filesystem.  The boot loader prompts for the
                                  passphrase and loads loader(8) from the
                                  encrypted partition.

     configure  Change configuration of the given providers.
 
                -g
                   Enable booting from this encrypted root filesystem.  The
                   boot loader prompts for the passphrase and loads loader(8)
                   from the encrypted partition.

I can't tell how does this would work with a shared FreeBSD/Linux pool.
 
Back
Top