
Show HN: Zectl – ZFS Boot Environment Manager for Linux - johnramsden
https://ramsdenj.com/2020/03/18/zectl-zfs-boot-environment-manager-for-linux.html
======
cyberpunk
Finally. I got used to this on solaris 10 and missed it until FreeBSD got it..
ZFS and beadm are the included in the reasons i continue to run FreeBSD as a
workstation, but these days with k8s and such I do tend to run a lot of linux
VMs to do my daily work (devops stuff)...

The work lappy runs ubuntu with zfs on root, and it's pretty seamless, I'm
very much onboard with it having boot environments! (zsys)

~~~
blue1
Zfs on a laptop means you run zfs with a single disk?

~~~
0xcde4c3db
This is not unheard of among FreeBSD users. Most of ZFS's features do not
require (or even necessarily benefit from) multiple disks.

~~~
gigatexal
Yup checksumming and snapshots and compression and at rest encryption are
amazing to name a few

------
_jal
This looks nice. Going to have to give it a try.

I'd love to see automated ZFS-on-root setup, but suspect that'll have to come
from Canonical if we ever get it.

~~~
johnramsden
In 20.04 they will have ZFS on root with BEs as an install option, looking
forward to seeing the first major Linux distro making it available as a
default.

~~~
pmarreck
Currently running that exact setup, it’s sweet

------
kevans91
Oh, this is cool! We'll need to check out this plugin mechanism as a thought
for bectl -- it's fairly inflexible at the moment.

libze_util_temporary_mount would be a good candidate for using (or being
replaced by?) the recently-introduced zfs_mount_at in libzfs once that's
widely available enough. That was a fairly trivial addition to libzfs that was
initially made to support libbe's be_mount(), which previously used the
effectively non-portable amount() [post-mortem: should read zmount, but
autocorrect is alwayscorrect]

~~~
johnramsden
loader ZFS integration is really great on FreeBSD, do people occasionally want
to use something else? Is that why you would consider looking to support other
options? Really would be nice to see loader ported to Linux - I know it was
recently brought over to Solaris. Maybe a project for another day...

Thanks for the tip, the temporary mounting seems a bit like a hack so that's
good to know there's a better option.

~~~
kevans91
I've seen the occasional rumbling about folks wanting to use grub for one
reason or another- while not necessarily ideal (having the caveats of a non-
loader environment), I can see the value in it if you really don't need the
amenities loader offers (debugging support, kmods).

------
acd
Big thanks to the developers/John for creating ZFS Linux boot manager!

------
mskalski
Looks cool. Currently only one machine which I have with zfs is NixOS, which
has it own mechanism to handle such versioning, or do you see some advantages
of using zfs approach?

~~~
johnramsden
I used to use NixOS, and I do have some of the best ZFS support out of the box
I've seen on Linux. I'm not sure if the approach of using zfs boot
environments would play well with NixOS considering how they manage the
configuration and rollbacks separately. They also manage the bootloader, so I
don't know if the changes would survive. Something could probably be set up to
work, but it would probably feel as though you were working against the
intended way the system should work.

------
unixhero
With encryption support?

~~~
johnramsden
I haven't tried it myself with encryption, but I can't see it making a
difference. The bootloader, and initial ZFS setup will be what needs to be
changed to facilitate encryption.

~~~
kitotik
Hmm, how/when/where would the ‘zfs load-key’ happen?

I only know how to use the systemd-ask-password hack to decrypt non-root
datasets, but can’t get my head around how that would work with fully
encrypted root dataset.

~~~
kevans91
Presumably it would be like FreeBSD's GELI, where early boot stuff would need
to detect that it's looking at an encrypted root and know to prompt. In
theory, this is relatively straightforward- with boot environments, the zpool
bootfs property indicates the root dataset, so I wouldn't think you need to
look too far.

[edit: this is done in our loader, so presumably you'd use grub?]

