| name | zfs |
| description | ZFS administration on Bluefin — pools, datasets, snapshots, and delivery options for an immutable host that does not ship ZFS kernel modules. |
| domain | sysadmin |
ZFS on Bluefin
⚠️ Critical Bluefin Constraint — Read First
ZFS is NOT in the Fedora kernel. The CDDL/GPL license incompatibility means
OpenZFS is not and will never be in the mainline Linux kernel. Bluefin is based
on Fedora — it does not ship ZFS kernel modules out of the box.
Any ZFS usage on Bluefin requires one of three approaches documented below.
When to Use
- Managing ZFS pools on an attached storage device
- Running ZFS tools inside a Distrobox container
- Connecting to an external NAS (TrueNAS/OpenZFS) over NFS or SMB
- Automated snapshot management with sanoid/syncoid
When NOT to Use
- As a replacement for btrfs on the Bluefin root filesystem — Bluefin uses btrfs
for the OS and that is not configurable
- When ext4 or btrfs on a secondary disk is sufficient for your needs
⚠️ Bluefin Delivery Options
Option A — ZFS inside Distrobox (Recommended for safety)
Run ZFS tools inside a Fedora Distrobox with DKMS. Keeps the host clean and
doesn't risk breaking on bootc upgrade rebase.
Option B — ZFS via DKMS on the host (Advanced)
Install the ZFS kernel module on the host via COPR. Works, but carries risk:
the DKMS module may not survive a bootc upgrade rebase if the kernel version
changes.
Option C — External NAS (Recommended for homelab)
Run TrueNAS or an OpenZFS server externally. Mount shares on Bluefin via NFS or
SMB. The host stays completely clean.
Option A — Distrobox
distrobox create --name zfs-box --image registry.fedoraproject.org/fedora:latest
distrobox enter zfs-box
sudo dnf install -y https://zfsonlinux.org/fedora/zfs-release-2-5$(rpm --eval "%{dist}").noarch.rpm
sudo dnf install -y zfs
sudo modprobe zfs
zpool list
If you need to create or import pools that require direct disk access, recreate
the container with elevated privileges:
distrobox create --name zfs-box \
--image registry.fedoraproject.org/fedora:latest \
--additional-flags "--privileged --volume /dev:/dev"
Note: Privileged mode gives the container full access to host devices.
Only use this when you need to manage actual disks from inside the container.
Option B — Host DKMS (Advanced, use with caution)
sudo rpm-ostree install \
https://zfsonlinux.org/fedora/zfs-release-2-5$(rpm --eval "%{dist}").noarch.rpm
sudo rpm-ostree install zfs zfs-dkms
sudo systemctl reboot
sudo modprobe zfs
zpool list
⚠️ Risk: After bootc upgrade, the DKMS module may not rebuild
automatically if the kernel version changes. You may need to reinstall the
DKMS module after a rebase. See Troubleshooting below.
Option C — External NAS (Recommended for homelab)
Mount a TrueNAS or OpenZFS share without touching the host kernel:
sudo mkdir -p /mnt/nas
sudo mount -t nfs 192.168.1.100:/mnt/pool/share /mnt/nas
192.168.1.100:/mnt/pool/share /mnt/nas nfs defaults,_netdev 0 0
sudo mount -t cifs //192.168.1.100/share /mnt/nas \
-o username=user,password=pass,uid=$(id -u),gid=$(id -g)
This is the lowest-risk option: the host never loads a ZFS module, and
upgrades/rebases have no impact on your storage access.
Core ZFS Commands
Pool Management
sudo zpool create mypool /dev/sdX
sudo zpool create mypool mirror /dev/sdX /dev/sdY
sudo zpool create mypool raidz /dev/sdX /dev/sdY /dev/sdZ
sudo zpool status
sudo zpool list
sudo zpool import
sudo zpool import mypool
sudo zpool export mypool
sudo zpool scrub mypool
Dataset Management
sudo zfs create mypool/data
sudo zfs create mypool/backups
sudo zfs create mypool/vms
sudo zfs list
sudo zfs set compression=lz4 mypool/data
sudo zfs set atime=off mypool/data
sudo zfs set quota=100G mypool/data
sudo zfs set recordsize=1M mypool/vms
sudo zfs get compression mypool/data
sudo zfs set mountpoint=/mnt/data mypool/data
Snapshots
sudo zfs snapshot mypool/data@backup-2024-01-01
sudo zfs list -t snapshot
sudo zfs rollback mypool/data@backup-2024-01-01
sudo zfs destroy mypool/data@backup-2024-01-01
sudo zfs clone mypool/data@backup-2024-01-01 mypool/data-clone
Send / Receive (Backup and Replication)
sudo zfs send mypool/data@snap1 | sudo zfs receive backuppool/data
sudo zfs send -i mypool/data@snap1 mypool/data@snap2 | \
sudo zfs receive backuppool/data
sudo zfs send mypool/data@snap1 | \
ssh backup-host sudo zfs receive backuppool/data
Automated Snapshots with sanoid
sanoid manages automatic snapshots and retention policies via a config file.
syncoid handles replication.
Install sanoid
distrobox enter zfs-box
sudo dnf install -y sanoid
sudo rpm-ostree install sanoid
Configure sanoid
[mypool/data]
use_template = production
[mypool/backups]
use_template = backup
[template_production]
frequently = 0
hourly = 24
daily = 30
monthly = 3
yearly = 0
autosnap = yes
autoprune = yes
[template_backup]
frequently = 0
hourly = 0
daily = 90
monthly = 12
yearly = 1
autosnap = no
autoprune = yes
Run sanoid
sudo sanoid --take-snapshots --verbose
sudo sanoid --prune-snapshots --verbose
*/15 * * * * root /usr/sbin/sanoid --take-snapshots --quiet
Mounting ZFS Datasets on the Bluefin Host (Option B only)
sudo systemctl enable --now zfs-import-cache zfs-mount zfs-share
sudo zfs mount -a
Troubleshooting
Module not loaded after reboot
sudo modprobe zfs
sudo dkms install zfs/$(modinfo -F version zfs 2>/dev/null || echo "2.2") \
-k $(uname -r)
Pool not found after rebase (Option B)
sudo zpool import
sudo zpool import -f mypool
Cannot import pool — wrong hostid
sudo zgenhostid
sudo zpool import -f mypool
Container can't access /dev (Option A)
Recreate the Distrobox with device access:
distrobox create --name zfs-box \
--image registry.fedoraproject.org/fedora:latest \
--additional-flags "--privileged --volume /dev:/dev"
Pool health degraded
sudo zpool status -v mypool
sudo zpool scrub mypool
sudo zpool clear mypool
Replacing a failed disk in a mirror
sudo zpool replace mypool /dev/sdX /dev/sdY
sudo zpool status mypool
Decision Guide
| Scenario | Recommendation |
|---|
| Homelab NAS (TrueNAS/OpenZFS server) | Option C — external NAS + NFS/SMB |
| ZFS tools without host risk | Option A — Distrobox |
| Maximum performance on attached disks | Option B — host DKMS (with caveats) |
| Simple secondary disk, no ZFS features needed | Use btrfs or ext4 instead |
| OS/root filesystem | Not applicable — Bluefin uses btrfs |
References