Preamble
In this post i will show you how you can build up a Network Attached Storage (NAS) based on a single board computer such as a Raspberry Pi.
You can use this description as a general example to build your own NAS. I rather recommend you not trying to imitate this exact build but giving your creativity a chance to make it even better.
My best advice is
Part 1 All The Stuff
First we go trough all the stuff used to build up the NAS
All the parts i use here might be outdated when you read this article. Take the following list as a guidance when you collect your parts
Parts Overview
- Case (housing)
- Lian Li – Mini-Tower
- Single-Board-Computer (s)
- Raspberry Pi 4 8GB
- Odroid C2 (ARM Cortex-A7 x64)
- 2 x 4TB Hard-Drives
- Western Digital Red NAS HDD 5400RPM
- 12V/10A Desk Power Supply
- Any decent 12V Desk Power Supply with at least 8Amps and earth protection will do the job.
- Power Distribution Board (From a diy drone)
- Mateksys PDB for up to 60A burst rate
- 12V to 5V Buck-Converter
- You can find buck-converters in dozens on the internet
- Prototyping PCB
- PCB with many many soldering holes
- 3 x 60mm PC Fans
- Quality doesn’t matter that much because very low RPM is enough to cool everything
- USB-Hub
- RSHTECH 7 Port USB 3.0 HUB with additional power input
- 2 x USB to SATA Adapter
- CSL usb-to-sata adapter with USB 3.0 and additional 12V power input
- Potentionmeter (For regulating the PC Fans)
- Should be capable to handle 12V and up to 1 Amp Current
- Lots of wires
- Wires to connect everything (power and data)
Single Board Computer
You need a board that can handle USB 3.0 to have a decent data transfere rate. Especially when you want to extend to further hard drives.
The one you see on the image is a Raspberry Pi 4 with 8GB RAM and two USB 3.0 Ports.
The components on the board get quite hot, which is why i added a heat sink and a fan-case configuration to provide a better cooling
Two 4TB Hard Drives
Two HDDs to run the NAS in RAID Mode 1 (Mirroring).
We want at least a little bit of safety here which means
that if one of the drive fails, you won’t loose all your data.
When a hdd fails you should replace it as soon as possible.
That is why i bought a third one as a backup drive.
I recommend you considering a RAID 5 configuration with
3 hard drives running at least
SSD drives are also an option if the total price does not concern you. However you won’t notice any performance boost because …. hey it’s still a raspberry pi with USB 3.0. The only big advantage in my opinion is the noise reduction
12V / 10A Desk Power Supply
Don’t go too cheap here because this one converts the evil and highly excited pixies from the mains to pleasant 12 volts.
How much current your supply should deliver depends on how many additional components you add to your fancy NAS.
Let’s make a simple (not super accurate) calculation with my config:
Hardware | Maximum Power Consuption | |||
---|---|---|---|---|
Raspberry Pi 4 | 5V | 3A | 15W | |
Odroid C2 | 5V | 2A | 10W | |
2 x HDDs | 12V | 0.9A | 11.4W | |
3 x 60mm Fan | 12V | 0.75A | 9W | |
USB Hub, PDB, … | 12V | ~0.3A | 3.6W | |
SUM : | – | – | 49W |
Let’s say 50W peak power consuption which will unlikely be reached by this type of Server because its only purpose is data transfere.
Divide it by three and you get very close to the avarage idle consuption when you run a NAS like mine for 24/7
When i measured the current directly on the Power Supply (12V) i got an avarage of
1.35A (16.2W) on idle,
1.55A (18.6W) on medium load
and 1.85A (22.2W) on full load.
The conclusion here is that a 60W 12V Power Supply is enough for this purpose
Power Distribution Board and Buck Converter
A power distribution board (PDB) is a key component when you build your own drone.
I had an unused PDB left in my arsenal which came pretty handy here.
The main purpose of a PDB is to have a main power input and to
distribute it over multiple connections. The PDB can also have voltage
conversion in between to support a wider range of hardware.
The one i use takes 12V in and provides 12V, 5V and 3.3V output. I added a 5V buck converter as the PDB has only 5V 0.5A(max) output terminals.
You can try another way to provide the different voltages for your devices. For instance using buck or boost converters only.
Prototyping PCB
I used a prototyping PCB to extend to small molex power connectors instead of directly soldering all the hardware. This allows disconnecting and changing configuration when needed. Keep that in mind its a useful tool.
USB Hub
Choose a USB 3.0 capable hub otherwise your NAS will suffer low data transfere rate. Similarly the HUB has to have an additional power input to supply enough current over each USB interface.
USB 3.0 Hubs can heat up as well. Make sure it gets enough air gap for heat dissipation
60mm PC Cooling Fans
With more fans you can lower the fan speed and reduce noise.
On the other hand the heat flux of HDDs and the single board computers in this project are very low compared to a desktop CPU/GPU core. This is why only a slight breeze on each hardware is enough to keep them cool
The result is a super silent NAS
Wires and connectors and what not
this is the messy stuff that demands little soldering skills, commitment, devotion and patience. At least that is what i needed when i had to redo things because of bad soldering or soldered positive and negative connections wrong and destroyed one of my precious hard drives ;.)
Do it with the same mindset and failures won’t hurt you so much
At the end we always learn something
Part 2 Assembly
Time to put all together and hope for the best
The following picture is how my fully working NAS looks like. There is Raspberry Pi 4 attached which runs a raspbian linux configured to function as a NAS Server. However you probably noticed on the preview image that i added another single board computer on top of the Raspberry. That one is actually an Odroid C2 which allows me to run different services or experiment on it without affecting the main NAS server on the Raspy. Take it as an advice, why? Keep the following question in your mind. What if any hardware fails and you have to replace or maybe service it directly in your pc case (e.g. connecting an hdmi monitor and usb devices because network doesnt work)
Discover your case
As it is unlikely that you own the same type of case as i do, it is a good start to search your case for mounting holes and try to find conceptually a good placement configuration for your hardware inside the case. It will probably take a while but this part is essential for later maintenance.
if you have a 3D Printer by chance, then you may try to design and print a custom mounting support.
Designed and manufactured by you 😉
On the pictures you can see the printed board equipped with a Raspberry Pi 4 and a prototyping pcb from both sides
A 3D Printer is a huge relief because you can size your print to a standard mini ATX board, mount it into your case and provide additional unconventional mounting holes for your custom hardware
I used FreeCAD for the design, Ultimaker Cura for slicing the model and Ender 5 Pro for printing it out.
Powering the Raspberry
You got to find a way to connect the raspberry pi to the power supply. On the raspberry it is possible to solder power wires directly instead of using the USB interface.
The power input pins are usually accessible directly under the USB-power-input as seen on the picture.
So if you are using the same board solder the positive red wire to pin TP1 and the black negative wire to pin TP7
If you’re using something different then try to find the technical specification on the internet and locate the power input pins. You can also use a Multimeter in continuity mode to locate the negative pin for example. Normally the usb negative is grounded and make sure the pin is close to the positive. Even if many pins share the ground there are still voltage potential differences.
Power Source and Distribution
Here we have a buck converter on the left and a PDB with All-In Converters on the right.
The PDB might be very handy but still go for the tiny buck converter because you find them in dozens for super cheap. And i still needed one because the PDB 5V output couldn’t deliver 3 Amps.
After you chose your preferred power converter board start soldering the wires and make it ready for connecting to the actual power supply.
Here is a poor drawing of mine to illustrate how you can make your own power distribution board.
On the first Image you see my recent installation. On the second is a installation i would recommend now.
Wiring and more wiring and soldering which could look somehow like this. I know, ugly.. but this is how my setup evolved over time while resoldering failures, changing wiring configuration, trying out a different way. At the end i had a finished solution very similar to the right to images.
Ready for the hard DRIVE?
We are pretty close to our finished product, which is without the software of in this case.
Now fit your wired stuff, the single board computer, the USB Hub and your Hard Drives into your case and connect them, or vice versa. It depends on how your setup is.
At the end it should wired up like this.
Please excuse my sloppy drawing. I could rather use a dedicated diagram software to illustrate my intentions. But sometimes lazyness beats me and this is the result 🙂
The wiring in the images is the minimal solution to drive the NAS. You want probably add a cooling fan and other things to your configuration.
And thats it. Your NAS is ready to go and you still have USB interfaces left for further devices as well as more connections on your custom PDB like 3.3V and more 12V pins. You could even add more single board computers for different purposes.