DIY NAS (Ubuntu 20.04 + mergerfs + snapraid)

This is a rough overview about my self build 6-Bay NAS (with external 4-Bay hard drive USB enclosure for backup drives).

I build it from scratch with focus on low cost, low power consumption but still good performance

Total capacity currently: 65TB

Available for normal usage: 26TB
Available for snapraid: 8TB
Available for backups: 29TB

Hardware

NAS

Images

PXL_20210913_143151023.jpg  PXL_20210913_143409708.jpg

PXL_20210913_143346510.jpg  PXL_20210913_143427138.jpg

Components
Component Model
CPU Intel Core i3-10100 3.6 GHz Quad-Core
CPU Cooler Noctua NH-L9i
Mainboard ASRock H510M-ITX/ac Mini ITX LGA1200
Memory Crucial RAM CT8G4DFRA266 8GB DDR4 2666 MHz CL19
Case Fractal Design Node 304 Mini ITX Tower
Power Supply be quiet! Pure Power 11 CM 400W (80+ Gold Certified Semi-modular ATX)
Extension Card BEYIMEI PCI Express to 2 Port SATA III 6Gbps
Drives
  • Transcend 120GB SSD SATA III 6Gb/s MTS820S
  • WD Red 6TB 3.5" 5400 RPM (WD60EFRX)
  • WD Red 6TB 3.5" 5400 RPM (WD60EFRX)
  • WD Red 8TB 3.5" 5400 RPM (WD80EFAX)
  • WD Red 8TB 3.5" 5400 RPM (WD80EFAX)
  • Seagate IronWolf 8TB 3.5" 7200 RPM (ST8000VN004)
  • Seagate IronWolf 8TB 3.5" 7200 RPM (ST8000VN004)

 

Notes

Backup

Components
Component Model
Hard Drive Enclosure Xystec 4-Bay Hard Drive Enclosure, USB 3.0 or eSATA
Drives
  • Seagate Barracuda 5TB 3.5" (ST500DM003)
  • Toshiba 6TB 3.5" (MD04ACA600)
  • Seagate Barracuda 8TB 3.5" (ST800DM004)
  • WD 10TB 3.5" (WD1EMAZ)

Notes

Software

This is a quick overview about what software I am using and why.

Operating system:

Ubuntu 20.04

I used openmediavault (omv) in the past, but the process of upgrading from one version to another seemed tedious and the fact that the version of Debian omv was using is missing required drivers for the network interfaces of my mainboard made me look for an alternative OS. I decided to go with Ubuntu because I have another server running it and have had mostly good experiences with it.

I wanted to use Ubuntu Server for a lightweight installation without needless bloat, but that was missing drivers for my mainboard too and I couldn't even boot via live USB, so I had to go with the Ubuntu Desktop version. After successfully installing the OS and setting up a SSH server, I deleted the Ubunutu desktop package and changed the system runlevel target to multi-user so that I can negate the negatives of having to install the Desktop version.

Drive management:

mergerfs

I used mergerfs on my old NAS and loved it, so I wanted to go with it again. A few reasons why:

More about how mergerfs works here.

snapraid

Backup program for drive arrays, stores parity information of data and it recovers from drive failures.

I didn't want to go with a conventional RAID to be more flexible in my infrastructure, but still be able to recover from a drive failure. Snapraid seemed like the ideal solution for that. Like mergerfs it is easy to setup and very flexible, I could add a new drive or replace an old one whenever I want in whatever size (as long as the new drive is not bigger than the parity drive) without fearing data lose.

Unfortunately, there is no snapraid release for Ubuntu 20.04 available atm, but it is super easy to compile snapraid yourself. Download the latest release and follow the install instructions.

Monitoring

Networking

Replace data disk

What happend?

I have a nightly cronjob configured to execute a script which

This is how I got notified that the latest SnapRAID sync could not be executed: Some files on one of the data disks could not be read because of an "Unexpected input/output read error".
This did not really surprise me because SMART was reporting the affected disk to have a 100% estimated probability to fail soon for a while now. Additonally, this already happend on this disk before, but I could usually easily fix it by replacing the broken file. Not this time. Now much more files were affected (including files I newly added trying to fix the broken ones as before).

There was no way around it now: I had to replace the disk.

....