Building a Home NAS with ZFS over the Winter Break

Building a Home NAS with ZFS over the Winter Break

Building a Home NAS with ZFS over the Winter Break

The winter break is the perfect window to finally build that home NAS you have been putting off all year. The days are short, the weather is grim, and there is nothing more satisfying than spending a quiet evening with a screwdriver, a stack of drives and a fresh FreeBSD installer. We have built more than a few of these boxes over the years, and our go-to stack remains FreeBSD with OpenZFS. It is stable, it is well documented, and it will still be running long after the novelty mugs from the office Secret Santa have been relegated to the back of the cupboard.

Why FreeBSD and ZFS for a Home NAS?

Why FreeBSD and ZFS for a Home NAS?

FreeBSD has been the backbone of storage servers for decades. When you are trusting a decade of family photos, tax returns and media rips to a single box in the spare room, stability matters more than shiny new features. FreeBSD 14.x ships with OpenZFS baked into the base system, which means no third-party kernel modules to fuss over and no dependency hell when you upgrade.

For UK sysadmins, the appeal is straightforward: predictable release cycles, excellent documentation, and a community that knows its way around a serial console. We have run FreeBSD on everything from recycled Dell towers to purpose-built mini-ITX rigs, and it has never let us down.

ZFS Features That Matter for Home Storage

ZFS is not just a filesystem, it is a full storage management platform. The features we lean on most at home include:

  • Data integrity: Checksums on every block mean silent corruption gets caught and, with redundancy, repaired.
  • Snapshots: Instant, space-efficient point-in-time copies. Perfect before a risky upgrade or a Windows machine decides to encrypt everything.
  • RAID-Z: Software RAID with parity that survives a drive failure without a rebuild dance at 3am.
  • Compression: LZ4 is cheap on CPU and often saves 20-30% on mixed data.
  • Send and receive: The cleanest backup mechanism we have used, especially over SSH to a remote box.

FreeBSD vs Linux for NAS Builds

Linux has caught up considerably with OpenZFS, but FreeBSD still feels more coherent for a dedicated storage appliance. The base system is small, jails are lighter than most container runtimes, and the ZFS implementation is tightly integrated with the bootloader and installer. If you are already comfortable with Linux, you will not struggle, but if you want a box that quietly does its job for years, FreeBSD is our pick.

Choosing the Right Hardware for Your Build

You do not need exotic hardware. A modest build with ECC memory and a decent HBA will outperform most off-the-shelf NAS units and cost less per terabyte.

Motherboard and CPU: What We Recommend

For a home NAS, a low-power Intel or AMD chip is plenty. We have had good results with Intel Core i3 and Pentium Gold CPUs, and if you want ECC memory without server-grade pricing, look at AMD Ryzen with a motherboard that supports ECC (ASRock Rack boards are a common choice). ECC is not strictly mandatory, but for a box holding irreplaceable data, we would not skip it.

Aim for 16GB of RAM as a starting point. ZFS will happily use more for ARC caching, and if you plan to run jails with Plex transcoding, 32GB gives you breathing room.

Storage Drives and HBA Considerations

If your motherboard has enough SATA ports, use them. If you need more, the LSI 9211-8i HBA is the classic choice. It is cheap on the second-hand market, well supported under FreeBSD, and can be flashed to IT mode so ZFS sees the raw disks. Pair it with a breakout cable and you have eight drives on tap.

For drives, we favour CMR NAS-rated disks from Western Digital or Seagate. Avoid SMR drives for RAID-Z. Buy at least one cold spare; drive prices fluctuate and having a replacement on the shelf saves a panicked trip to the shops.

Case, PSU and Cooling for a Quiet NAS

The Fractal Design Node 304 is our default recommendation for a six-drive mini-ITX build. It is compact, quiet, and the drive cages are easy to work with. For larger builds, the Node 804 or a used rackmount chassis works well.

Pick a quality 80 Plus Gold or Platinum PSU in the 300-450W range. You will never stress it, and efficiency at low load matters when the box runs 24/7. Replace stock fans with something from Noctua or Be Quiet if noise is a concern.

For UK sourcing, we regularly use Scan and Ebuyer for components, and eBay for used HBAs. Both Scan and Ebuyer ship quickly and have reasonable returns policies if a drive arrives DOA.

Installing FreeBSD and Creating Your ZFS Pool

With the hardware assembled, installation is the easy part. Grab the latest FreeBSD 14.x memstick image and write it to a USB drive.

Step-by-Step FreeBSD Installation

  1. Boot from the USB installer and choose the standard install.
  2. Use GPT partitioning. Put a small freebsd-boot partition first, then a swap partition, then the rest as freebsd-zfs.
  3. Install to a small SSD for the boot pool rather than a USB stick. USB sticks die and take your bootloader with them.
  4. Set the root password, add a user, and enable SSH during the post-install configuration.
  5. Reboot into your new system and run freebsd-update fetch install to bring it current.

Building a Mirror or RAID-Z Pool

For two drives, a mirror is the right call. For three or more, RAID-Z1 gives you parity. A typical command for a four-drive RAID-Z1 pool looks like this:

zpool create tank raidz1 /dev/ada1 /dev/ada2 /dev/ada3 /dev/ada4

Always specify ashift=12 for 4K-sector drives. Most modern disks benefit from it and it cannot be changed later without recreating the pool.

Tuning ZFS for Home Use

Enable LZ4 compression on the pool with zfs set compression=lz4 tank. It is nearly free on CPU and saves real space. Set atime=off to reduce unnecessary writes. For datasets holding media, consider a larger recordsize (1M) for large sequential files.

Sharing Files and Running Services with Jails

A NAS that only stores files is half the story. The real value comes from the services running on top.

Samba and NFS Shares for Your Network

For mixed Windows, macOS and Linux clients, Samba is the pragmatic choice. Install it from ports or packages, configure a simple share in smb4.conf, and set vfs objects = zfsacl to keep permissions sane. For Linux-only networks, NFSv4 is leaner and faster.

Set your timezone with tzsetup and choose Europe/London. Set the locale in /etc/login.conf to en_GB.UTF-8 so your logs and filenames behave.

Using BSD Jails for Service Isolation

Jails let you run Plex, Nextcloud, Syncthing or a torrent client in isolated environments without the overhead of full virtual machines. If a jail gets compromised, the rest of the system stays intact. We use iocage or the newer bastille to manage jails, and mount datasets into each jail read-only or read-write as needed.

Backup Strategies with ZFS Snapshots

Snapshots are not backups on their own, but they are the first line of defence. Take hourly or daily snapshots with a periodic script, and use zfs send to push them to an external drive or a remote box. Follow the 3-2-1 rule: three copies, two media, one offsite.

Maintenance, Monitoring and UK Power Considerations

A NAS is only as good as the attention you pay it. A little monitoring goes a long way.

Scheduled Scrubs and SMART Tests

Run a monthly scrub with a cron job or a periodic script: zpool scrub tank. Schedule short SMART tests weekly and long tests monthly using smartctl. Set up email alerts so you hear about a failing drive before it dies, not after.

UPS and Power Efficiency

UK power is generally stable, but brownouts and brief cuts do happen, and an unexpected shutdown mid-write is not something you want to test. A small APC or CyberPower UPS with USB monitoring and NUT (Network UPS Tools) will shut the box down cleanly when the battery runs low.

With current UK electricity tariffs, a 40W idle NAS costs roughly £100-£130 a year to run. Spinning down idle drives and choosing efficient components keeps that figure down.

Updating FreeBSD and ZFS Pools

Apply security updates with freebsd-update on a monthly cadence. Before any major upgrade, take a snapshot of the boot environment and your data pool. Upgrade the ZFS pool features only when you are confident you will not need to roll back to an older FreeBSD release.

FAQ

Do I really need ECC memory for a home NAS?

Strictly speaking, no, but we strongly recommend it. ZFS is designed to catch and correct corruption, and ECC memory closes the loop on that promise. If your budget is tight, prioritise ECC over raw CPU speed.

Can I run FreeBSD on a Raspberry Pi as a NAS?

You can, but the USB and network bandwidth on most Pi models makes it a poor fit for anything beyond light file sharing. A used mini-ITX board with SATA ports will serve you far better.

How many drives should I start with?

Two drives in a mirror is the simplest starting point and gives you redundancy. If you know you will grow, start with four drives in RAID-Z1 so you can expand later by replacing disks one at a time.

Is OpenZFS on FreeBSD the same as ZFS on Linux?

Yes, since the OpenZFS project unified the codebases, the on-disk format and most features are identical. You can move pools between FreeBSD and Linux with confidence, provided both sides support the pool feature flags you have enabled.

Where should I download FreeBSD from?

Use a reputable FreeBSD mirror close to you. UK and European mirrors will give you the fastest download speeds, and choosing a mirror geographically near you reduces load on the primary infrastructure.

A winter break project does not need to be complicated. With a modest budget, a few evenings of effort and FreeBSD 14.x running OpenZFS, you end up with a fast, private, reliable NAS that will quietly serve your household for years. We would love to see what you build, so share your parts list and pool layout with our community when it is up and running.

Leave a Reply