gGoncçalomb MB >: .compt

indexblog

From a plastic box to a 100TB+ NAS

2022-11-18T19:37:25+00:00 • goncalomb • rpi,nas

I've been running a Raspberry Pi as a DIY NAS for several years, but since 2020 things have escalated...

Original RPi-In-A-Box (circa 2014)

It started in 2014 when I put together a simple NAS with an original Raspberry Pi B+ inside a plastic box and a shucked 3TB Seagate HDD.

It ran for several years storing some backups and for general light computing. This is how it looked by August 2020, still using the original hardware:

Original RPi-In-A-Box
Original RPi-In-A-Box

At some point, I added an LCD screen and ATmega328P microcontroller to show some statistics, but this never really worked because I never wrote the software to control it.

The back side of the LCD screen with a microcontroller
The back side of the LCD screen with a microcontroller

Everything fit inside the box including a fan and power strip, the HDD is out of the original enclosure but I was still using the original SATA to USB interface.

Overview of the classic Raspberry Pi in a plastic box
Overview of the classic Raspberry Pi in a plastic box

RPi-In-A-Box V2 (October 2020)

The first upgrade was moving to a Raspberry Pi 4, adding an SSD as a boot drive and extra storage using 3 8TB external drives (2 Seagate and a WD).

RPi-In-A-Box with extra drives
RPi-In-A-Box with extra drives

The extra drives required a USB hub... And by April 2021 the pool had grown to 5 extra 8TB drives.

USB hub connected to 4 drives
USB hub connected to 4 drives
SSD as a boot drive
SSD as a boot drive
With 5 extra drives, the USB hub is already full
With 5 extra drives, the USB hub is already full

More Power, R.I.P. Plastic Box (July 2021)

Adding more drives would require a different power supply, just using more power bricks was impractical. So I had the brilliant idea of modifying an ATX power supply.

This involved replacing the PCIe and CPU power connectors with 2.1mm connectors, the 24-pin connector was also removed with the idea of replacing it with some kind of breakout box for other voltages (this never happened). The SATA and Molex connectors were spared.

ATX power supply with incomplete modifications, extra cables stored in the black cylinder
ATX power supply with incomplete modifications, extra cables stored in the black cylinder

The new power supply allowed me to add 2 more Seagate drives using a bigger hub, eventually, I also added a UPS and retired the WD drive. This setup remained unchanged for almost a full year...

Stable setup with a 6-drive pool
Stable setup with a 6-drive pool

Temporary Setup (June 2022)

Meanwhile, I was purchasing new higher-capacity WD Elements drives. The Seagate 8TB ones were retired for cold storage.

4 WD Elements drives in place of the previous Seagate ones
4 WD Elements drives in place of the previous Seagate ones
Still using the same modified power supply
Still using the same modified power supply

Node 804 (November 2022)

By now I had purchased 8 WD Elements drives. But made the critical mistake of buying 12/14TB drives early on and then 16TB ones, this was not the best for creating a drive pool (different drive sizes).

All drives shucked, 116TB in total (2x12TB, 2x14TB and 4x16TB)
All drives shucked, 116TB in total (2x12TB, 2x14TB and 4x16TB)

Time to finally use a proper computer case. I got the Fractal Node 804 which is ideal for my setup (8 drive bays and lots of space). Of course, I'm still using the same Raspberry Pi 4 and power supply, I'm not upgrading to microATX and x86.

Because of interference with the drive connections (the drives are still using the SATA to USB boards), I had to mount one of the cages on the other side, this is not the normal configuration for this case.

Side A
Side A
Side B
Side B
Back side with custom I/O panel (ethernet only)
Back side with custom I/O panel (ethernet only)

This case really is the perfect match for this setup. It even includes a built-in fan control board, with a SATA power connector.

Fan control board with 3 speeds
Fan control board with 3 speeds

And here it is, the final, current setup, with 116TB of raw storage.

It fits really well next to the UPS
It fits really well next to the UPS
A sea of cables, still rocking the unfinished power supply
A sea of cables, still rocking the unfinished power supply

The Hardware And Cost

Drives

Original RPi-In-A-Box:

  • 1x SEAGATE Expansion Desktop 3TB (older model, 2014)

Now in cold storage (not used on final setup):

  • 6x SEAGATE Expansion Desktop 8TB (SMR)
  • 1x Western Digital 8TB Elements

Final Node 804 setup (116TB):

  • 2x Western Digital 12TB Elements
  • 2x Western Digital 14TB Elements
  • 4x Western Digital 16TB Elements

All drives (excluding the original RPi-In-A-Box) were purchased at no more than 17€/TB.

Final Setup Cost

Not including some extras, like the materials to modify the power supply, RPi case and extra cables.

Item Price €
DRIVES (116TB at ~16.5€/TB) ~1917.00
COOLER MASTER MWE Bronze 450 40.99
UPS APC Back-UPS 750VA 89.70
Fractal Node 804 109.90
Kingston A400 SSD 960G 99.70
Sabrent USB 3.0 to SSD 10.16
BrovSS 10 Port Powered USB 3 43.71
Raspberry Pi 4 Model B (8GB) 72.77
TOTAL ~2383.93

As expected the drives account for most of the cost, but it's certainly much less expensive than a commercial NAS system with NAS drives.

The Raspberry Pi can probably be downgraded. I was using the 2GB version initially but ended up upgrading to 8GB because SnapRAID (see next) is quite memory intensive, but I think 4GB is enough.

The Software

I've used the same software since the first upgrade of the original RPi-In-A-Box in 2020...

Raspberry Pi OS Lite with PiVPN (WireGuard) for the OS.

SnapRAID for the drive pool, it's not true software RAID, but it is perfect for my application (archival data). I'm NOT using MergerFS to combine all the file systems (ext4), I just fill them separately.

With 2 parity drives (16TB each) the pool has 84TB of usable space.

I'm also running apcupsd to monitor the UPS and trigger a graceful shutdown in case of power failure.

For access, I just use ssh + rsync.

Power Consumption And Performance

The final setup (116TB) runs at ~65W idle and I measured a peak of ~166W on power-up (all drives spin up at the same time). With the drives on standby, I would get ~10W idle, but I'm leaving them spinning all the time for now.

I can get about 90MB/s over the 1Gbit/s network while writing to one of the drives, and about 155MB/s while syncing (calculating the parity in SnapRAID, snapraid sync).

The drives are kept at about 38C with the default case fan configuration and low fan speed (L, on the built-in controller).

Future

The Fractal Node 804 has 2 extra bays that I'm not using, I'll probably add 2 more 16TB drives in the future to better balance the pool, 8 data drives + 2 parity, for a total of 148TB (116TB usable).

The front panel I/O is not connected, but I'll add an adapter for the USB 3 ports. The power button it's more complicated, it would require some custom electronics to control de Raspberry Pi and the power supply. And I still would like to properly finish modifying the power supply.

I also need to add some software (scripts?) to control and monitoring for the drives.

Something to note is that the final build has nothing in common with the original RPi-In-A-Box, all the hardware was slowly replaced, which means that I can rebuild the original RPi-In-A-Box and probably will.

Conclusion

I don't recommend this setup (RPi + external HDDs) if you want full performance, but it is very usable for archival data. I also can't recommend my modified power supply approach if you don't know what you are doing. This is just one big DIY project.

Another issue with the current setup is the mismatched drive sizes, I lost 12TB of usable space by using some 12/14TB drives. That's what I get for being impatient and trying to hit a price point with the drives without a proper plan at the time.

Ultimately this is a very non-standard setup that evolved over time and where all the cost was put towards maximizing the storage capacity.

One thing I can recommend is the Fractal Node 804, it's an older model, but still in production and very good for NAS builds. Go build a proper NAS!

Or an RPi-In-A-Box!