A Raspberry Pi NAS That Really Look Like a NAS

69,098

515

32

About: University student in Hong Kong, the only developer of IMUS Project. I love making something no one has thought of. If you like making things that seems not possible, send me a message to share your ideas wi...

Intro: A Raspberry Pi NAS That Really Look Like a NAS

Why a Raspberry Pi NAS

Well, I have been searching for a beautiful yet space saving Raspberry Pi NAS from the internet and I found nothing. I did find some NAS design with a Raspberry Pi get glued to a wooden based but that is not what I want. I want a real NAS. Those looks like professional and durable that can be used to store my massive amount of movie collections. So I decided to build myself a NAS from the ground up. Yes, you heard that. FROM THE GROUND UP.


In this project, I will not use any existing parts that is specially design for Raspberry Pi NAS. Instead, I will be using some common parts you can easily found on Amazon or ebay. So, lets get started!

By the way, that is my initial design sketch up there.

Step 1: 3D Modeling and Printing

After I have designed my NAS case in Autodesk Inventor, I test fit them to see if every joint is correctly designed.

Let me explains how the parts works. This case is divided into three parts. The left section is for the power management board and Raspberry Pi 3B+. You can use a Pi 3/ 2B+ as well as their footprint is the same. But you would want to use the Pi3B+ as it is faster. I will explain the detail later.

The right section of the case is design to hold two 5inch hard disk how swap mount (See picture 4). And the extra space at the back is for a 7 cm fan, a DC jack and the cabling.

Step 2: 3D Models Download (Case)

The 3D models can be downloaded here. License under:

Attribution-ShareAlike

CC BY-SA

Step 3: Printing and Assembling

After the prints has finished, we can start building the case.

The case is made up of three parts as mentioned before, you can attach them together with some M3x5 screws and M3x10 (for the top and bottom screw holes). Afterward, inserting the button caps into the holes and you will be ready for the electronic parts.

Step 4: Buttons and Signal LEDs

Actually the buttons and LEDs are some simple circuit that attach the signal from the Pi's GPIO to the front panel. There is nothing much special here except the button is a bit tricky. I would recommend you to do some test print before fitting the PCB inside the case with glues. That can make sure the quality of the buttons are good and clickable. In my design, as the RED LED require 5V, so I added a resistor on it and planned to directly connect the LED VCC pin to the power management board's 5V output. You can use the Raspberry Pi's 3.3V GPIO pin as well without the need for the extra resistor.

Step 5: Test Fitting

After receiving the hot plug bay from ebay, I placed two 2mm acrylic plate on the bottom and top of the right case. This is used to strengthen the support for the two HDD bay as HDD are kind of heavy after inserting into the bay.

Afterward, I used an old USB hard disk drive which, usually contain some kind of SATA to USB converter circuit board. For the one I bought, it come with a pre-soildered 12V input port that can support 12V power input for a 3.5 inch HDD. I attached them to the end of the two HDD hot plug bay and attached two cable to the end of it. One of the cable is a 2.1mm DC jack for the 12V input and the other one is a micro USB male cable for data and 5V. Both of them are special ordered so they bend in a direction towards the bottom and preserve space.

The finished product should look something like the picture 5.

Step 6: Tape and Glue

Now, we need to tape and glue the HDD hot plug bay into the case. First, I would recommend sticking a double sided tape on the metal bracket of the bay. After the bay is inserted and secured, put some superglue on the contact between the Acrylic plate and the metal bracket. But REMEMBER TO REMOVE THE PAPER ON THE ACRYLIC PLATE. I have forgotten to do so for the first time and I have a bad time moving everything out and do the same process again.

After finishing this process, you would not see two slot stick out of the right case and you can open then and close them via the handle build onto the hot plug bay.

Step 7: Test Fit

Now, stick your hard disk into the bay, and it should fit perfectly. (If not, you should ask for a refund from your seller of the hot plug bay xD)

You might notice that there are two rounded slot at the top back section of the right case. Those are for the USB cables. You can now stick the cables out and make it looks more tidy before start working on the electronics.

Step 8: Power Management Board

Here comes the power management board.

In the middle is a Tinduino. It is a self developed Arduino for low cost deploy and development from our Lab. Of course you can use an Arduino UNO for this and control the relay on off when there is a button press.

There are plenty of tutorials online which teach you how to make a board like this, for example:

https://www.instructables.com/id/Toggle-Switch-Wit...

It is basically a latch switch so you can do it in whatever style you want.

On the right is a buck converter. It steps down the voltage from 12V to 5V for the Pi and the Arduino.

And lastly, the bottom 3 port, from left to right is 12V power in, 12V power out for HDD1, 12V power out for HDD2

Step 9: Fixing Everything Together

Now, attach the power management board with the raspberry pi as shown in the picture above.

Plugin the 12V power input and everything should lights up (If not, maybe you can short the button and activate the Arduino Relay Toggle System)

Step 10: Close the Case and You Are Done!

Now, screw in all the screws, plug in the power cable and you are ready to go?

Not yet. We still need the software. But here is what the finishing hardware looks like.

As the software is still in development, I would recommend installing some open source OS / NAS system like the FreeNAS or open media vault. But I won't do that as I have planned to build my NAS from the ground up.

So what would I do next? Write my own NAS operating system!

Step 11: Install OS and Start Creating Your Own NAS Interface

Install the Raspbian Lite from the Raspberry pi website.

https://www.raspberrypi.org/downloads/raspbian/

and install it on your SD card. I think there are plenty of tutorial online so I don't duplicate those parts in this instructable.

Step 12: Move On? ArOZ Online System!

You might remember my post two years ago which is a Raspberry Pi media center system called

ArOZ Online (Alpha)

https://www.instructables.com/id/Simplest-Media-Ce...

Now, I have completely rewritten it into a brand new, DSM like Web UI called the ArOZ Online (Beta)

This system will works on both Window Host and Linux Host (of course Rasbian as well).

Step 13: Comming Soon!

Well, at least for now the system I wrote detects the 1TB drive I have inserted into the NAS.

So what next? The software still needs years of developments in order for it to run smoothly.

Currently, the max speed of transfer over 5G WiFi to HDD is around 100Mbps. Which is kind of OK for the fact that it is just a tiny little computer that is handing all your request. And it can reach around 93Mbps while transferring with Samba (Window SMB / Network Disk). This might be the advantage of using the Pi 3B+.

Please look forward to the update instructable to this project next year :))

Share

    Recommendations

    • Optics Contest

      Optics Contest
    • Audio Contest 2018

      Audio Contest 2018
    • Electronics Tips & Tricks Challenge

      Electronics Tips & Tricks Challenge

    32 Discussions

    0
    None
    n4mwd

    2 months ago

    What about RAID? I like the idea of a serviceable NAS, but data integrity is also important. Can the PI handle RAID?

    4 replies
    0
    None
    mechpanosn4mwd

    Reply 2 months ago

    Yes, it can but it will be a software RAID. Linux has that flexibility.
    You have to install mdadm package:

    # sudo apt-get update && sudo apt-get -qy install mdadm

    Then, supposing you have two usb drives mounted as sda1 and sdb1, the command to create a RAID array with those 2, is:

    # sudo mdadm --create --verbose /dev/md0 --level=mirror --raid-devices=2 /dev/sda1 /dev/sdb1

    This creates a device /md0 which is the RAID array, in RAID1 format.

    Then you format your device and mount it:

    # sudo mkdir -p /mnt/raid1
    # sudo mkfs.ext4 /dev/md0

    # sudo mount /dev/md0 /mnt/raid1/


    # ls -l /mnt/raid1/
    total 16
    drwx------ 2 root root 16384 Dec 3 16:40 lost+found

    Then you edit your fstab file to mount the drive on boot.
    #sudo nano /etc/fstab
    and add the line:
    /dev/md0 /mnt/raid1/ ext4 defaults,noatime 0 1

    Save and exit with ctrl+x

    Update the mdadm.conf configuration file:
    sudo mdadm --detail --scan | sudo tee -a /etc/mdadm/mdadm.conf

    and reboot, RAID should be set and ready to go!

    With info from

    https://blog.alexellis.io/hardened-raspberry-pi-nas/#30theraidarray

    0
    None
    n4mwdmechpanos

    Reply 2 months ago

    Thanks for the detailed instructions on how to set up a Pi Raid. One question, if you don't mind, is it possible to set up a Pi Raid such that there are two drives, one is a mechanical mirror drive, and the main drive is an SSD? The reason for that would be two fold. 1) The different technologies greatly reduce the odds that both will fail at the same time; and 2) the SSD could be used for increased speed.

    0
    None
    tobychuin4mwd

    Reply 2 months ago

    Nope, the Pi can't handle RAID. However, we are working on the software and try to make a copy across two NAS. Something like what Google Drive is doing with their files. In simple words, when a file is uploading to the NAS, the file get split into many 64MB chunks and duplicate across multiple drives with at least 3 copies of each chunk. So even if you lost a drive by accident, you can still recover the data from the same chunks stored on another NAS / drive. And we named that feacture as ArOZ Sync (Still work in progress).

    0
    None
    n4mwdtobychui

    Reply 2 months ago

    The odroid xu4q might be able to do raid. It supports usb 3.0 and 1G ethernet. Its 8 cores at 2GHz. An $8 sata adapter would be required for each drive. The xu4q is about 2x the price of the pi3 though.

    1
    None
    Man0f5tee1e

    2 months ago

    A Raspberry Pi NAS = A NASberry Pi

    0
    None
    Phoenixoss

    2 months ago

    Congratulations! Nice project I have only one concern speed of USB 2.0 on RPi3 :(

    1 reply
    0
    None
    n4mwdPhoenixoss

    Reply 2 months ago

    The USB 2.0 spec runs at 480 Mb/s, whereas the Wifi -G runs at about 450 Mb/s. Depending on the overhead, it should be able to keep up with Wifi speeds.

    0
    None
    michaela181

    2 months ago

    C'est excellent. Juste une question pourquoi pas avancer la carte raspberry pi et de ce fait connecter les USB en interne ? Sans avoir de connectique externe qui peuvent être arrachée est pliée.

    2 replies
    0
    None
    tobychuimichaela181

    Reply 2 months ago

    Thanks for you comment. I don't know French so I tried to translate it to English online. Hope I didn't misunderstand your question.
    The reason why I put the USB port outside is that I can connect it directly to my PC via USB if needed. For example, when I need to copy a large file, I can just unplug the USB cable from the NAS and plug it into my PC to utlize the full speed of USB 3.0 of the SATA to USB converter instead of the Pi's USB2.0 speed.

    0
    None
    michaela181tobychui

    Reply 2 months ago

    OK I understand better, you have perfectly understood my question. maybe there is another way for next time to do with a usb signal switch or while retractable. anyway it's a well done project. thank you for his writing and sharing

    0
    None
    NYT1

    2 months ago

    Nice! Storage is my current gig, so always interested in ideas about NAS. I will take a look at your sync idea, and I may look into a Mint or similar OS on an old PC to better handle the throughput bottleneck.

    That said back to Raspberry Pi build: What made you decide on the 1TB drive(s) vs. something larger? I guess what I am asking is was that a budget or on-hand limitation, or more to do with limitations on the build?

    2
    None
    menglor

    2 months ago

    I like the idea of this, but in all honesty, for the money and effort, it would be much simpler to just buy a working NAS, now the reason I even say all this, is because a NAS that supports 4 or 8 drives is so stupidly expensive, it make sense to do something like this.

    I understand that your using the Pi through Sata to USB, but how hard would it to run a 8 drive Nas? is it just a bunch of USB to SATA plugged into a HUB? or would it need more elaborate soltuions?

    5 replies
    1
    None
    tobychuimenglor

    Reply 2 months ago

    That is actually a good question. Let me explain this further.
    For hardware, this project is just an experimental one that tries to push the latest Raspberry Pi to its limit, and the result is kind of OK. Of course, if you want to build something like a 4 - 8 drives NAS, I would go with those cheap and low power Intel Atom boards (e.g. D525?) with a PCI-E to SATA adapter, pluging all the drive into the motherboard via SATA interface.
    For software, as the ArOZ Online (The NAS system that I am building) is design to run on both Windows and Linux (Debian), in theory you can just use your old Windows PC and install ArOZ Online on top of it. You can also enjoy some more benifits like SMB and Software RAIDs under Windows environment.
    You can visit my page and leave me a comment if you want to chat more in these topics :)

    0
    None
    menglortobychui

    Reply 2 months ago

    thanks, I will look into the "Intel Atom boards "d525" but I like your project because its small. and I would like to build something that is small and usable. currently I am using a Proliant d270 with a 24 drive array (6 drives installed), but its a electricity monster. I would like to switch to something that a 8 drive NAS, but there in the 2000-3000$ range.

    basically, I want something Small, Compact, has room for 8-12 drives. and be able to mount in windows. but doesnt have to be windows.

    I like the SMB solution, RAID is not really something I care about, I am hosting Downloaded torrrent content which is disposable. so I like the idea of one Giant Drive, but redundancy is not a requirement. Power conservation is more important so using an OLD PC, is annoying since it would be big and bulky (as what I have right now is)

    I like windows as an OS, but I find that I want something that starts up and runs as a file server and just works. sounds like I might need to just invest in a small ATX board with a few SATA boards that support 8 - 12 drives

    0
    None
    sephiroth180menglor

    Reply 2 months ago

    FreeNAS OS on a cheap older motherboard and processor runs with no issues. Plenty of youtube videos on how to set it up (I figured out how without ever having used the OS before and without help in about 30 mins) Easy to use and easily works cross platform. I have Ubuntu, Windows 8.1, 10, and 3 diffrent versions of MAC OS X connecting to it with no hiccups

    0
    None
    menglorsephiroth180

    Reply 2 months ago

    thanks for the tip on the FreeNAS, I will look it that. I am going to buy one of those 8 port SATA cards and see if that works for me.

    0
    None
    hasuesmenglor

    Reply 2 months ago

    "RAID is not really something I care about, I am hosting Downloaded
    torrrent content which is disposable. so I like the idea of one Giant
    Drive"

    Isn't that RAID 0?

    I think you would probably want a micro ITX board or smaller.

    0
    None
    rich.altmaier

    2 months ago

    A very nice design, good work! I have a suggestion to do a similar design but use the Intel NUC. I used the Pi for a year as a server, and the darn thing would hang every few weeks. I think the quality level of Raspberry Pi is not up to any server standard. Go with the NUC!

    0
    None
    StephenH130

    2 months ago on Step 1

    This seems to be something that I would like to have and build, although I am having some difficulties understanding your instructions, as punctuation, the use of plurals and singular in reverse. These may be simply cultural differences.

    One thing that I would do is to add nylon stand-offs instead of tape and glue.
    The other would be to add internal USB ports and then have the two plugs that you have sticking out of the back with the cables returning to the inside through holes, to stay inside.

    Thank you for sharing your project here, I'll definitely build my own real soon. I'm considering using SSD'S to make it lighter. I have a contact where I can buy 1TB SSD drives.

    I will need to first finish building my 3D printer. I'm gathering all of the parts right now.

    Thanks again, kudos!