Live data from Hacker News

FreeBSD: Home NAS, part 1 – configuring ZFS mirror (RAID1)

rtfm.co.ua

51–54 of 54 posts

Re: FreeBSD: Home NAS, part 1 – configuring ZFS mirror (RAID1)

#52
post #22
post #15

Earlier quoted context omitted.

I found thst ZFS to be very simple to understand, everything is controlled by just two commands. Datasets are huge win over partitions which seem like such a weird relic of the past once you have tried datasets. Fairly confident you can grasp ZFS in a hour or 2, you can even make a zfs pool from files to mess around with.

I never found a good non-tutorial introduction into ZFS concepts. Do you know any? By non-tutorial, I mean something that doesn’t focus on teaching you the command-line tooling. Like you can explain to someone how Git works conceptually in detail, without having to mention any Git commands and having them exercise some Git workflow hands-on.

There really isn't many concepts to get. `zpool` is like the device manager, use it define how your disks are grouped i.e. turn two disks into a mirror or striped array. `zfs` creates, sets properties on and manages the datasets on the zpool.

For Linux specifically I also reccomend https://docs.zfsbootmenu.org/en/v3.1.x/.

ZFSBootmenu is a bootloader that is fully able to take advantage of all the ZFS features and it also has great documentation with installation guides for a range of distros. https://docs.zfsbootmenu.org/en/v3.1.x/guides/fedora/uefi.ht...

I reccomend you just play around with it a bit first (you can just use some 1Gb test files instead of actual disks), its really just a lack of familiarity that scares people away.

Re: FreeBSD: Home NAS, part 1 – configuring ZFS mirror (RAID1)

#53
post #9

When setting up root-on-ZFS on FreeBSD, it's worth knowing about boot environments (a concept originally from Solaris): * https://klarasystems.com/articles/managing-boot-environments... * https://wiki.freebsd.org/BootEnvironments * https://man.freebsd.org/cgi/man.cgi?query=bectl * https://dan.langille.org/category/open-source/freebsd/bectl/ * https://vermaden.wordpress.com/2022/03/14/zfs-boot-environme... It lets you…

Sounds a lot like the A/B update method used widely in Android and to a lesser extend for embedded GNU/Linux OTA updates. But it uses two distinct boot partitions. Since ZFS is involved here, I assume that boot environments take advantage of its copy-on-write mechanism to avoid duplicating the entire boot dataset. NixOS and Guix use a concept called 'system generations' to do the same without the support of the files…

Yes, using ZFS's snapshot and clone mechanisms.

A snapshot is a low-cost read-only view of a filesystem at a point in time; a clone is a writeable filesystem with initial contents shared from a snapshot.

It's an amazing safety net, though it requires understanding and sysadmin discipline to use well -- starting with keeping user/application data separated from the filesystems managed as part of the BE. ZFS makes this easy (a pool can contain many separate filesystems) but you have to do it.

One gotcha is that if you run an update that creates and activates a new BE but don't reboot right away, changes made to the BE-managed part of the running system after the snapshot creation will be "lost" (stranded in the old BE) when you reboot to the new BE.

Re: FreeBSD: Home NAS, part 1 – configuring ZFS mirror (RAID1)

#54
post #30
post #22

Earlier quoted context omitted.

I never found a good non-tutorial introduction into ZFS concepts. Do you know any? By non-tutorial, I mean something that doesn’t focus on teaching you the command-line tooling. Like you can explain to someone how Git works conceptually in detail, without having to mention any Git commands and having them exercise some Git workflow hands-on.

Did you read the fine manual? https://openzfs.github.io/openzfs-docs/man/master/7/zpoolcon... https://openzfs.github.io/openzfs-docs/man/master/8/zpool.8.... https://openzfs.github.io/openzfs-docs/man/master/8/zfs.8.ht...

It's a terrible manual. Doesn't explain how to export via NFS, SMB. For instance, when to use zfs set vs /etc/exports

Doesn't explain why zfs list sometimes shows datasets that have no mountpoint, but doesn't allow you to set a mountpoint (because it's not mountable).

ZFS is a great technology but it's documentation is terrible.

Post reply on HN