Additional datasets for Fedora on ZFS root

I’ve just finished setting up my new home server with Fedora 40 on ZFS root for the first time. I’m using sanoid/syncoid to backup the root pool to my own remote box. This remote box is slowly running out of space.

Should I create additional datasets for my root filesystem to avoid syncing unnecessary things?

The only hint I’ve found is in the OpenZFS guide for Debian, but it seems a bit excessive with the number of directories.

Wouldn’t it be enough to create datasets for /var and /tmp, then exclude them from snapshots and sync? Would the OS be restorable without the entire /var?

I wouldn’t recommend it. You really don’t want to have to do junkyard surgery as part of your restore process, and backing up an “entire system” without its/var would require some very ugly junkyard surgery to restore as a “full system.”

1 Like

That’s treating the server as a pet - you want it as cattle. Replaceable at will - if it dies or whatever, rebuild it. Keep any special configs in dedicated zfs datasets and back those up.

There are lots of ways to build a server fairly quickly, using different methods. Cloud-init is nice and will get you most of the way there. I think it even supports root-on-zfs now maybe ?

Myself, I have my own root-on-zfs builder (GitHub - Halfwalker/ZFS-root: Set up root-on-zfs using whole disk, with dracut and zfsbootmenu) as a starting point. Then ansible playbooks to drop whatever system type into place. Media server, laptop, workstation, backup box etc. I can get to any variant within an hour or so of powering up a new system.

You definitely want the “build a server” bit separate from the “configure the server” bits. It’s nice to run as much as possible as containers, where the container volumes are just zfs datasets bind-mounted in. Back up those datasets and the docker-compose (or whatever) file and you’re good.

At this point my servers are pets and will be for the forseeable future. It’s just my home server that I work on whenever I have some spare time. I will get to the point where it’s all config files in a git repository… eventually. All the apps I run are already containerized.

It started a decade ago as a bare Linux install running only an SMB share because I wanted to watch X-Files from both my PC and my new tablet without copying files all the time. Today I simply made it run from ZFS root.