How to Pool Mismatched Drives with mergerfs and SnapRAID (The Media Server Storage Setup)

RAID and ZFS want matching drives and decide everything up front. A media server accumulates drives over years — a 4 TB, an 8 TB, a 2 TB from an old PC. mergerfs shows them as one folder; SnapRAID keeps parity on a separate drive so any one of them can die and be rebuilt. Each drive stays a plain ext4 disk you can pull out and read anywhere, drives spin down when idle, and you add another whenever you buy one. It's the setup Unraid sells, built from two packages.
Quick reference
| Piece | Job |
|---|---|
| Data drives | /mnt/disk1, /mnt/disk2, ... each a normal ext4 filesystem |
| mergerfs | presents them together at /mnt/storage |
| Parity drive | /mnt/parity1, at least as big as the largest data drive |
| SnapRAID | snapraid sync nightly computes parity; snapraid fix rebuilds a lost disk |
| Check | snapraid scrub reads and verifies a slice each week |
1. Mount each drive on its own
Format any new drives ext4 (tutorial 22) and mount them individually, by UUID, with nofail:
UUID=... /mnt/disk1 ext4 defaults,nofail 0 2
UUID=... /mnt/disk2 ext4 defaults,nofail 0 2
UUID=... /mnt/disk3 ext4 defaults,nofail 0 2
UUID=... /mnt/parity1 ext4 defaults,nofail 0 2
The parity drive must be at least as large as the biggest data drive.
2. mergerfs: one folder
sudo apt install mergerfs -y
sudo mkdir -p /mnt/storage
fstab line (one line):
/mnt/disk* /mnt/storage fuse.mergerfs cache.files=partial,dropcacheonclose=true,category.create=mfs,moveonenospc=true,minfreespace=50G,fsname=mergerfs 0 0
sudo mount -a, then df -h /mnt/storage shows the combined size. Write a file there and it lands on whichever disk has the most free space (mfs); folders can span disks. Point Samba, Jellyfin and everything else at /mnt/storage and never think about which disk again.
Files already on the disks appear immediately — nothing is moved or reformatted.
3. SnapRAID: parity
sudo apt install snapraid -y
sudo nano /etc/snapraid.conf
parity /mnt/parity1/snapraid.parity
content /var/snapraid/snapraid.content
content /mnt/disk1/snapraid.content
content /mnt/disk2/snapraid.content
data d1 /mnt/disk1
data d2 /mnt/disk2
data d3 /mnt/disk3
exclude *.tmp
exclude /lost+found/
exclude .Trash-*/
exclude *.!sync
sudo mkdir -p /var/snapraid
sudo snapraid sync
The first sync reads every file and writes parity — hours for a big array. After that it only processes what changed.
4. Run it every night
SnapRAID parity is a snapshot: it protects what was there at the last sync. Keep it current:
sudo nano /usr/local/bin/snapraid-nightly.sh
#!/bin/bash
set -e
snapraid touch
snapraid sync -q
snapraid scrub -p 5 -o 10 -q # verify 5% of data older than 10 days
snapraid status | tail -n 5
chmod +x, then root's cron (tutorial 20) or a timer (tutorial 69) at 3 am, with output to a log or ntfy. The popular snapraid-runner script adds safety checks (abort if too many files were deleted since last sync — a ransomware tripwire).
5. When a data drive dies
Replace it, format it ext4, mount it at the same path, then:
sudo snapraid -d d2 -l /var/log/snapraid-fix.log fix
sudo snapraid -d d2 check
sudo snapraid sync
Every file that existed at the last sync comes back. Files added since the last sync are gone — hence nightly. Two parity drives (2-parity) survive two simultaneous failures.
Why this and not RAID?
- Any drive sizes, add one at a time.
- Each disk is readable alone. Lose two drives with one parity and you lose only what was on those two, not the whole array.
- Idle drives spin down — only the disk holding the file wakes. Quieter, cooler, cheaper.
- Not real-time. Parity is up to a day old. Right for media and archives, wrong for a database or anything that changes constantly — keep those on the system SSD or ZFS.
Troubleshooting
mount -a fails for mergerfs. The glob /mnt/disk* needs the disks mounted first — fstab order handles it; if not, add x-systemd.requires=/mnt/disk1 style options.
"Disk full" writing to the pool though df shows space. minfreespace is reserving it, or a single file is bigger than any disk's free space. Lower the value or add a drive.
SnapRAID says "Too many errors". A drive is failing. smartctl it (tutorial 56), fix what it can, replace the disk.
Sync takes forever every night. Something rewrites files constantly on the pool (a database, Syncthing versions, Docker). Move it off the pool or exclude it.
Wrapping up
Mount each drive, one fstab line for mergerfs, a short SnapRAID config, a nightly sync. Mismatched drives become one folder with a parity safety net, each disk stays a plain disk, and the next drive you buy just gets added to the line.
