Floating Octothorpe

Building a NAS: part 1

For a long time my backup strategy has roughly followed the strategy suggested by Jamie Zawinski. For the most part this has been great, and there are certainly times when I've been glad I've had a backup! However managing files across multiple devices and keeping them in sync has always been slightly awkward. Previously I also used TrueCrypt to encrypt by backups, however this is no longer supported.

To fix this I'm planning to build a DIY NAS so I can sort and backup my files.

Photograph of HP MicroServer and hard drives

Goals

Ideally I would like to achieve the following:

Hardware

I'm planning to use the following hardware for the NAS:

Software

Operating system

When it comes to building a DIY NAS, FreeNAS is one of the first operating systems that comes to mind. While FreeNAS would be a fairly good fit, I'm more familiar with Linux, and will likely use the NAS to host other services (e.g. a Radicale calendar).

I'm also keen to avoid having to regularly re-install the OS, this narrowed my choice of distros down to distros with long support windows like Debian or CentOS.

Filesystem

One of my goals is to set up regular automatic snapshots. While this can be done in software, using a copy on write filesystem is in my opinion a more elegant solution. There are two well used copy on write filesystems available for Linux, ZFS and Btrfs.

In theory Btrfs would be fine for my use case, however I'm slightly concerned for its future given Red Hat recently dropped support for it in RHEL 8. ZFS has been around for nearly 15 years now, and while there are some legal complications, this hasn't stopped Ubuntu shipping ZFS since 16.04.

Encryption

To protect my data at rest I want to use full disk encryption on both the OS disk, and on the data disks. For the OS disk, I'm planning to use LUKS; however for the data disks, ZFS actually supports native encryption. Unfortunately this feature isn't available in the current long term support (LTS) release of Ubuntu (18.04). Thankfully the next LTS release of Ubuntu (20.04 Focal Fossa) is just a few days away.

Next steps

If everything goes well, the next part in this series will go through setting up Ubuntu 20.04 on the MicroServer.