Building a home NAS on OpenMediaVault and ZFS RAID-Z1
A Raspberry Pi 5 running OpenMediaVault on four 1 TB SSDs in ZFS RAID-Z1 is the storage behind my Kubernetes cluster: NFS for most apps, iSCSI zvols for databases, and what each one taught me.
Updated
On this page · 5 sections
Every home lab eventually needs somewhere safe to put data. Mine is a Raspberry Pi 5 running OpenMediaVault on a ZFS RAID-Z1 pool. It holds the family photo library, the databases and the configuration of almost everything on my Kubernetes cluster.
| Part | What I use |
|---|---|
| Board | Raspberry Pi 5, booting OpenMediaVault from a 128 GB SD card |
| Disks | 4 × WD Green 1 TB 2.5-inch SATA SSDs |
| Pool | One RAID-Z1 vdev called nas: 3.6 TB raw, about 2.6 TB usable, compression on |
| In use | About 1.56 TB, plus six zvols for ClickHouse |
| Serves | NFS 4.1 and iSCSI to the cluster |
Why OpenMediaVault and ZFS
OpenMediaVault is a Debian-based NAS distribution with a clean web interface for shares, users and services. It runs comfortably on a Pi, and when the UI does not offer something, it is still just Linux underneath. ZFS comes through the plugin.
I chose ZFS because it assumes the disk will lie to you. Every block is checksummed, so silent corruption is detected instead of served back. With redundancy, a bad block is repaired from a good copy automatically. Snapshots are close to instant and cost almost nothing until data changes, and compression is usually free.
How the cluster uses it
The NAS serves the cluster in two ways.
NFS for most applications. The cluster runs csi-driver-nfs with NFS 4.1 and hard mounts. A dynamic storage class creates a folder per volume for throwaway data like Argo Workflows artefacts. Anything I care about gets a static volume with its own export and a Retain reclaim policy, so deleting a claim in Kubernetes never deletes the data. Immich’s photo library is a 200 GiB volume on its own export, with smaller ones for its database and model cache, n8n’s data and files, Postgres and Mosquitto.
iSCSI for databases that want a block device. ClickHouse and its Keeper nodes get thin-provisioned ZFS zvols, exported over iSCSI through OpenMediaVault’s tgt plugin, one target and LUN per volume. I could not use a dynamic provisioner like democratic-csi, because targetcli does not work on the Pi 5, so the six volumes are created by hand.
apiVersion: v1
kind: PersistentVolume
metadata:
name: clickhouse-data-0-iscsi-pv
spec:
capacity:
storage: 20Gi
accessModes: ["ReadWriteOnce"]
persistentVolumeReclaimPolicy: Retain
storageClassName: iscsi-static
# The zvol is thin-provisioned. Without "discard", ext4 never sends UNMAP,
# so deleted blocks stay allocated on the NAS even though df looks fine.
mountOptions:
- discard
iscsi:
targetPortal: "<nas-ip>:3260"
iqn: "iqn.2026-08.<domain>.pinas:clickhouse-data-0"
lun: 1
fsType: ext4
What went wrong
LUN 0 is not your disk. The first iSCSI volumes logged in fine and never produced a usable device. tgt puts a zero-byte controller LUN 0 on every target, and the real volume is LUN 1. tgtadm --op show on the NAS made it obvious once I thought to look.
Thin provisioning needs discard. A few weeks later the NAS reported the ClickHouse zvols as nearly full, while df inside the pods showed 24 to 27% used. Without the discard mount option, ext4 never tells the zvol that blocks are free, so the space is never reclaimed. That is the comment in the YAML above.
NFS squashes users. MongoDB on NFS failed with permission denied, because the NFS server maps writes to a different user and group. A separate storage class with mountPermissions: "0777" and the right export path fixed it.
Network storage has latency. A three-node Elasticsearch cluster kept losing its master because writing cluster state to the NAS took 15 to 60 seconds, and it gives up at 30. I cut it to one node. A Pi serving storage over the network is fine for photos and app data and too slow for anything that needs fast consensus.
Upgrades want a way back. When I moved Postgres from 17 to 18, I did a dump and restore onto a new export and left the old volume untouched as the rollback path. Separate exports per app make that easy.
Scrubs earn their keep
A scrub reads every block in the pool and checks it against its checksum. Mine runs once a month and takes about two hours. The October scrub repaired 3K of data with no errors: a few blocks had gone bad on one SSD, and ZFS rebuilt them from parity before I would ever have noticed. Without the checksums, those blocks would have been served back as if they were fine.
RAID-Z1 is not a backup
RAID-Z1 keeps one disk’s worth of parity, so my pool survives any one of the four SSDs failing. While a replacement resilvers, a second failure loses data, which is why larger pools move to RAID-Z2. And redundancy does nothing against deleting the wrong folder, ransomware, a failed power supply or a fire.
What keeps data safe is routine: scrubs to catch bad blocks while parity can still fix them, scheduled snapshots, copies off the box for the data that matters, SMART alerts for failing disks, and a restore you have actually tested.
Durability comes from an ongoing process more than from the product you pick.
That is as true for a home NAS as it is for a company’s production database.