Build your own NAS that checks, snapshots and backs itself up
One box in the cupboard holding every photo, document and backup in the house, on ZFS: a filesystem that checksums every block, repairs silent corruption from the copy on the other drive, and keeps hourly snapshots you can step back through from Windows Explorer. Then it copies itself, encrypted, to Backblaze B2, and messages you when a drive starts to fail.
- An encrypted off-site copy in Backblaze B2 that ransomware on your PC can't reach, and replication to a second box
- A kit: pool layout calculator, build checklist, SMART test script, rclone config and parts list
- A spare PC or a NAS build: 2-core 64-bit CPU, 8GB RAM minimum (16GB recommended), a small SSD to boot from
- At least two identical CMR hard drives (WD Red Plus 8TB from about £285 on PriceSpy)
- A USB stick for the installer, wired Ethernet, and a monitor for the first boot
- For off-site copies: your own Backblaze B2 account (pay as you go, first 10GB free)
- Read Backups that survive ransomware for the 3-2-1 idea behind step 6
Plan the pool before you buy drives
Decide how many drives, what size and which ZFS layout, with the costs in front of you.
Why ZFSNormal filesystems trust the drive. ZFS stores a checksum for every block, checks it on every read and on a monthly scrub, and when a block comes back wrong it quietly rewrites it from the good copy on another drive. It also takes snapshots in an instant that cost nothing until files change. [TrueNAS Community Edition](https://www.truenas.com/download/) is the free, open-source NAS operating system built around it.
LayoutsDrives are grouped into vdevs, and the pool stripes across vdevs:
- Mirrors: pairs of drives holding identical copies. Half the space, fastest, quickest to rebuild, and the pool grows two drives at a time.
- RAIDZ1: one drive's worth of parity. Most space, but with today's big drives a rebuild takes a day or more, and a second failure during it loses everything.
- RAIDZ2: two drives of parity. The usual choice for 4 to 8 big drives, and since TrueNAS 24.10 a RAIDZ vdev can be widened one drive at a time.
The kitDownload the kit or open kit.md. zfs_layout.py compares layouts for your drives:
Terminalpython zfs_layout.py --drives 4 --size-tb 8 --price 285Output4 x 8TB = 32TB raw (29.1 TiB) layout usable TiB at 80% survives £ per usable TB 2 x 2-way mirror 14.1 11.3 1 per mirror, up to 2 £74 1 x 4-wide RAIDZ1 21.1 16.9 any 1 drive £49 1 x 4-wide RAIDZ2 14.1 11.3 any 2 drives £74 Mirrors: fastest, simplest to grow (add another pair), quickest rebuilds, half the space. RAIDZ1: most space, but a second failure during a long rebuild loses the pool. Avoid with drives over 4TB. RAIDZ2: the usual choice for 4 to 8 big drives. Can grow one drive at a time (RAIDZ expansion). None of these is a backup: snapshots, replication and an off-site copy are.Read itWith four 8TB drives, mirrors and RAIDZ2 give the same space; RAIDZ2 survives any two failures, mirrors are faster and grow in pairs. The
at 80%column is the comfortable fill level: ZFS slows down as a pool gets full.