Build a Minimal ZFS NAS Without the Bloat
Most NAS solutions—Synology, QNAP, TrueNAS—come with a heavy GUI and a ton of features you may never use. If you want a simple, reliable network share with ZFS, you can build it yourself on Debian 12 in under an hour. This guide walks through a RAIDZ1 pool with Samba sharing, using nothing but the command line.
Why Bother? ZFS Is Self-Contained
ZFS stores all its metadata on the disks themselves. If your OS dies, you can pull the drives, plug them into another machine, install ZFS, and run zfs import. Your pool and its configuration come back instantly. No backup of config files needed. This is a killer feature that most tutorials gloss over.
Hardware and Setup
The author uses:
- OS: Debian 12 Bookworm
- CPU: 4 cores (Xeon server CPU)
- RAM: 16 GB ECC RDIMM
- Storage: 4x 4TB NVMe SSDs (Samsung 990 Pro)
- ZFS: OpenZFS 2.1.1
Step 1: Identify and Alias Your Disks
First, list all disks:
lsblk -d -o TRAN,NAME,TYPE,MODEL,SERIAL,SIZE
Create aliases in /etc/zfs/vdev_id.conf to avoid relying on device names that can change:
alias nvme0 /dev/disk/by-id/nvme-Samsung_SSD_990_PRO_4TB_XXXXXXXXXXXXXXX
alias nvme1 /dev/disk/by-id/nvme-Samsung_SSD_990_PRO_4TB_XXXXXXXXXXXXXXX
alias nvme2 /dev/disk/by-id/nvme-Samsung_SSD_990_PRO_4TB_XXXXXXXXXXXXXXX
alias nvme3 /dev/disk/by-id/nvme-Samsung_SSD_990_PRO_4TB_XXXXXXXXXXXXXXX
Then trigger udev: udevadm trigger. Verify with ls -lh /dev/disk/by-vdev. The aliases are purely for convenience—they are not required for ZFS to work.
Step 2: Create the ZFS Pool
Install ZFS (on Debian: apt install zfsutils-linux). Then create a RAIDZ1 pool with ashift=12 (4KB sector alignment) for optimal performance on modern SSDs:
zpool create -o ashift=12 s16z1 raidz1 nvme0 nvme1 nvme2 nvme3
Check the pool:
zpool status s16z1
Verify ashift:
zdb | grep ashift
Should output ashift: 12.
Set mountpoint and compression:
zfs set mountpoint=/mnt/s16z1 s16z1
zfs set compression=lz4 s16z1
Create datasets for organization:
zfs create s16z1/docs
zfs create s16z1/backups
Datasets are more than folders—they inherit all ZFS features (snapshots, replication, encryption).
Step 3: Install and Configure Samba
Install Samba:
apt install samba
Create a UNIX user for Samba access:
useradd -m john
passwd john
smbpasswd -a john
Replace /etc/samba/smb.conf with:
[docs]
path = /mnt/s16z1/docs
browseable = yes
read only = no
guest ok = no
valid users = john
create mask = 0755
[backups]
path = /mnt/s16z1/backups
read only = no
guest ok = no
inherit acls = yes
spotlight = yes
fruit:aapl = yes
fruit:time machine = yes
vfs objects = catia fruit streams_xattr
valid users = john
The backups share is configured for macOS Time Machine with special fruit options.
Restart Samba: systemctl restart smbd.
Step 4: Mount and Test
On macOS, connect via Finder → Go → Connect to Server (Cmd+K) using smb://10.0.0.6/docs and smb://10.0.0.6/backups. On Linux, use smbclient:
smbclient -U john //10.0.0.6/docs -c 'ls'
What's Next?
The author plans to cover encryption and ZFS dataset replication in a follow-up. For now, you have a minimal, reliable NAS that you fully understand and control.





