PiNAS - the Raspberry Pi NAS

145,667

779

65

Introduction: PiNAS - the Raspberry Pi NAS

Intro:

This instructable describes the build of a very compact Raspberry Pi powered two bay network attached storage (NAS).


Features:

  • Super small
  • Easy to build
  • Simple setup
  • Cheap
  • Perfect for learning about network, file system, security mechanisms
  • Raspberry Pi 2 or 3 can be used (Pi 4 with some tweaks)
  • Powered by a single USB cable
  • Can use WiFi
  • Uses notebook hard drives
  • hard drives are hotswappable
  • Two USB ports for further hardware
  • Easy to open case


If you like the PiNAS check out my page AraymBox for other projects. You can also post ideas on how to improve the design.


Note:

Please note that English is not my first language. If you find any mistakes or something is not clear feel free to tell me and I'll try to fix it. Same goes for general mistakes. If you have any suggestions for improvements please let me know.


Content:

Step 01: Tools & Materials

Step 02: 3D Printing the Case

Step 03: 3D Print Post-processing (optional)

Step 04: Preparing the SATA to USB Adapters

Step 05: Preparing the Inner Case

Step 06: Wiring and Assembly: Raspberry Pi

Step 07: Wiring and Assembly: USB Breakout Board

Step 08: Wiring and Assembly: Installation

Step 09: Wiring and Assembly: HDD Adapters

Step 10: Case Assembly: Faceplate (optional)

Step 11: Preparing the SD Card

Step 12: Case Assembly

Step 13: Configuring Open Media Vault

Step 14: Configuring OMV: System

Step 15: Configuring OMV: Storage

Step 16: Configuring OMV: Access Rights Management

Step 17: Configuring OMV: Services

Step 18: Using the NAS

Step 19: Final Step

Step 20: Change History

Teacher Notes

Teachers! Did you use this instructable in your classroom?
Add a Teacher Note to share how you incorporated it into your lesson.

Step 1: Materials & Tools

Make sure you have everything you need for the build. There is nothing more annoying than stopping your project because you have to wait for some small part being delivered.

You do not have to buy the listed parts and material from given links. These are examples and show the required properties of the parts.


Parts:


Tools:

Step 2: 3D Printing the Case

I've designed the case to be as simple as possible:

  • Only 4 parts
  • Can be printed without supports
  • Held together by 4 bolts
  • Easy to open for maintenance

The inner part of my case was printed with PLA and the 3 outer shells with ABS. I've used ABS for the shell because I wanted to paint it and ABS is much easier for post-processing. You can also use PLA or try any other filament.

If you do not have a 3D printer you can use a 3D printing service.


Download
:

You'll find updated parts on this thingiverse design page.


These file are the first version:

Step 3: 3D Print Post-processing (optional)

Depending on your taste this step is optional.

3D printed parts are not perfect - they have small cracks, holes, bubbles, visible layers, etc. If you want a decent smooth glossy look you have to take an extra step and post process the parts.

Here is what I've done to the 3 outer case parts:


1. Sand the parts:

  • run 1: use 120 grit sanding paper
  • run 2: use 240 grit sanding paper
  • run 3: use the wet extra fine sanding sponge


2. Clean the parts:

Wash the parts with clear water and let them dry


3. Paint:

  1. Spray a thin layer of paint primer. Let it dry for 24 hours.
  2. Check the surface.
  3. Spray a thin layer of paint. Let it dry for 24 hours.

Step 4: Preparing the SATA to USB Adapters

In this step we're going to prepare the SATA to USB adapters for the assembly.

Follow these steps to disassemble the adapters:

    1. Lift the lid of the case.
    2. Remove the PCB and the cable from the case.
    3. Remove the hot glue.
    4. Unsolder the USB wires from the PCB.

    Step 5: Preparing the Inner Case

    In this step we're going to prepare the inner part of the case for the assembly.

    Follow these steps to add the nuts:

    1. Check if there is any debris in the slots for the nuts and remove it.
    2. Slide all four nuts in the slots.
    3. Secure the nuts with the M3x6mm bolts to keep them in place.
    4. Apply a small amount of hot glue to the slots to secure the nuts.
    5. Remove the M3x6mm bolts.

    Check if all parts fit in their dedicated place.

    Step 6: Wiring and Assembly: Raspberry Pi

    In this step we'are wiring up all the electronics and put it in place.

    Always double (and triple) check your soldering.


    Solder all wires to the RasPi first:

    1. Start by soldering all the required wires to the RasPi
    2. The pictures in this step show all required wiring points.

    Step 7: Wiring and Assembly: USB Breakout Board

    Add the Female micro USB breakout board:

    1. Add the Female micro USB breakout board to the wires of the RasPi
    2. Solder the wires to the breakout board which supply the adapters with power
    3. The pictures in this step show all required wiring points.

    Step 8: Wiring and Assembly: Installation

    Install the RasPi and the USB breakout board:

    1. Slide the RasPi into its place.
    2. Secure the RasPi using the M3x6mm nuts.
    3. Place the USB breakout board in the dedicated recess.
    4. Secure the USB breakout board using a small amount of hot glue.

    Step 9: Wiring and Assembly: HDD Adapters

    Install the top HDD adapter:

    1. Slide in the top HDD adapter (the one right under the RasPi)


    Solder the top HDD adapter:

    1. Solder the data and power wires to the top HDD adapter.
    2. Add the wires which will supply the lower HDD adapter.
    3. The pictures in this step show all required wiring points.


    Install the lower HDD adapter:

    1. Slide in the lower HDD adapter.


    Solder the lower HDD adapter:

    1. Solder the data and power wires (coming from the top HDD adapter) to the lower HDD adapter.
    2. The pictures in this step show all required wiring points.


    Align the HDD adapters:

    1. Slide in both hard drives.
    2. Make sure the HDD adapters plug into the hard drives with only little force.
    3. Secure both HDD adapters using a small amount of hot glue (see picture).
    4. Remove both hard drives.

    Step 10: Case Assembly: Faceplate (optional)

    Depending on your taste this step is optional.

    The files which need to be printed (thingiverse) also contain optional parts which you can use if you want to add a wooden (or else) faceplate.

    1. Print the optional parts.
    2. Create the faceplate (e.g. laser engraving).
    3. Place the faceplate into the optional front piece of the case.
    4. Secure the frontplate with some hot glue.
    5. Place the optional HDD stopper on the faceplate.
    6. Secure the HDD stopper with some hot glue.

    Step 11: Preparing the SD Card

    Now that we have finished most of the hardware part it's time to look at the software.

    In this step we're going to download all needed software, write the Open Media Vault image to the SD card and start RasPi for the first time.


    Required Software:


    Preparing the SD Card:

    1. Plug the SD card into your Windows PC.
    2. Make sure Windows detects the card.
    3. Open "My Computer" or "This PC" or the Windows Explorer and remember the drive letter of the SD card. In my case it was F:\ (differs from systems to system). Make sure it's really the letter of the card and not some of your harddrives.
    4. Start balena etcher.
    5. Select the Open Media Valut image.
    6. Select the drive letter of the SD card.
    7. Click Flash!
    8. Wait until the flashing has finished.
    9. Unplug the SD card.


    Starting the Raspberry Pi:

    1. Plug the SD card into the Raspberry Pi.
    2. Connect the Raspberry Pi to a screen using an HDMI cable.
    3. Connect the Raspberry Pi to your network using an ethernet cable.
    4. Power up the system by connecting the power cable to the Raspberry Pi.
    5. You'll see the automatic starting procedure on the sceen.
    6. Wait until you see the same message as shown in the last picture in this step. It takes some time - around 20 minutes for me.
    7. Remember the IP-address, the username and the password shown on the screen.
    8. Power off the RasPi.
    9. Remove all cables.

    Step 12: Case Assembly

    Now you can put together the PiNAS

    1. Carefully slide on the back piece of the case and make sure the micro USB port meets its cutout in the case.
    2. Secure the back piece of the case with two M3x8mm bolts.
    3. Slide on the middle piece of the case.
    4. Slide on the front piece of the case.
    5. Secure the back piece of the case with two M3x8mm bolts.

    Step 13: Configuring Open Media Vault

    Now we're going to configure Open Media Vault.

    After logging into Open Media Vault you'll see a tree view on the left side. All settings are separated into 5 main sections:

    • System
    • Storage
    • Access Rights Management
    • Services
    • Diagnostics

    The following steps show the most important settings in these sections.


    Starting the Raspberry Pi:

    1. Connect the Raspberry Pi to your network using an ethernet cable.
    2. Power up the system by connecting the power cable to the Raspberry Pi.
    3. Remember the IP-address, the username and the password shown on the screen.


    First Login:

    1. Start your favorite internet browser (firefox, chrome, ie, etc.).
    2. Type in the IP-address of the PiNAS into the address bar of the browser.
    3. You should now see the authentication mask of Open Media Vault.
    4. Select you language.
    5. Enter the username, password and click Login.

    Step 14: Configuring OMV: System

    General Settings

    1. Open tab Web Administrator Password
    2. Set and confirm a new password
    3. Click Save to save


    Date & Time

    1. Select you time zone
    2. Enable the NTP (Network Time Protocol) feature and set a time server
    3. Click Save to save


    Network

    1. Open tab General
    2. Give your PiNAS a hostname (name in your network)
    3. Click Save to save
    4. Open tab Interfaces
    5. Press Add
    6. Set a static IPv4 address so it does not change after reboot
    7. Click Save to save
    8. Open tab Service Discovery
    9. Activate the services you need

    Step 15: Configuring OMV: Storage

    Disks

    1. Make sure both drives were identified and listed (typically they are mounted as sda and sdb)
    2. Select a disk click Edit
    3. Enable write-cache
    4. Click Save to save
    5. Do the same for the second disk
    6. Select a disk click Wipe
    7. Click Quick to remove all data from the disk
    8. Do the same for the second disk


    RAID Management

    1. Click Create to create a new RAID (Redundant Array of Independent Disks)
    2. Give your RAID a Name - e.g. raid1
    3. Select your RAID Level - e.g. Mirror (RAID Level 1)
    4. Select the Devices you want to add to the RAID - select both your disks
    5. Click Create to create the RAID using the selected disks
    6. The new RAID 1 is now resyncing
    7. When syncing has finished the State of the RAID changes to clean


    File Systems

    1. Click Create to create a file system
    2. Select your Device (your previously created raid1)
    3. Give your file system a Label to identify it easily
    4. Select your desired file system type
    5. Click OK to create the file system
    6. Wait for your file system to finish initializing (Status has to be Online)
    7. Select your initialized file system and press Mount to make it available

    Step 16: Configuring OMV: Access Rights Management

    User

    User accounts are necessary to access the file system of the PiNAS

    1. Open the tab Users
    2. Click Add to create a new user
    3. Enter a Name for the user
    4. Set and confirm the password for this user
    5. Click Save to save


    Group

    It's easier to manage user groups instead of every user individually.

    1. Click Add to create a new user group
    2. Open tab General
    3. Enter a Name for the user group
    4. Open tab Members
    5. Select the users you want to add to the group (e.g. the one you created)
    6. Click Save to save


    Shared Folders

    In order to access the file system of the PiNAS from another machine like a PC shared folders are required.

    1. Click Add to create new shared folder
    2. Enter a Name for the new share folder (this name will be connected to other machines)
    3. Select the Device where the shared folder will be created on (your previously created file system)
    4. Select or enter the Path of your shared folder
    5. Set your desired Permissions for this shared folder (more permissions will be set in the next steps)
    6. Click Save to create the shared folder
    7. Click Privileges to set them for users or user groups
    8. Set your desired privileges to your users or/and groups
    9. Click Save to save your settings
    10. Click ACL to create a new Access Control List for your shared folder
    11. Set your desired User/Group permissions (e.g. Read/Write) for your users and groups
    12. Enable Replace all existing permissions
    13. Enable Apply permissions to files and subfolders
    14. Click Apply to create and apply the ACL

    Step 17: Configuring OMV: Services

    This part describes how a SMB share (mainly used in Windows environments) will be created and used. Open Media Vault gives you a lot more possibilities to present your PiNAS to other devices in your network.

    SMB/CIFS

    1. Open tab Settings
    2. Enable SMB/CIFS
    3. Open tab Shares click Add to create a new SMB share
    4. Enable the new share
    5. Select a shared folder (the one you created before)
    6. Select if the share will be Public (visibly listed by PiNAS)
    7. Enable Honor existing ACLs (inherit ACLs)
    8. Enable permission inheritance
    9. Click Save to create the new SMB share

    Step 18: Using the NAS

    Now PiNAS is ready for your data.


    Connect the PiNAS share to your PC:

    1. Press the Windows Button on your keyboard, type cmd and press Enter. A Windows command prompt should pop up.
    2. Type the following command to connect the PiNAS share:
      net use N: \\PiNAS\nas_share
    3. The command prompt should now ask you for a username to authenticate with. Enter the PiNAS username nas_user.
    4. Now the command prompt wants the password for nas_user - type it in and hit Enter.
    5. The command prompt should say something like The command completed successfully.


    Write Data:

    • When you open Windows Explorer you should now see the new group Network Location.
    • In this group all your mapped network folders are listed - just like the connected nas_share.
    • Now you can drag and drop data to this drive and back it up on the two mirrored disks of the PiNAS.

    Step 19: Final Step

    Congratulations:

    • Congratulations you've build your own Raspberry Pi powered Network Attached Storage.
    • Have fun backing up your data or messing around with this type of technology.
    • Show some love, comment, share and have a nice day.
    • You can also tip me on thingiverse if you feel to.

    Step 20: Change History

    04-FEB-2020:

    • Published.
    Raspberry Pi Contest 2020

    This is an entry in the
    Raspberry Pi Contest 2020

    Be the First to Share

      Recommendations

      • Trash to Treasure Contest

        Trash to Treasure Contest
      • Raspberry Pi Contest 2020

        Raspberry Pi Contest 2020
      • Wearables Contest

        Wearables Contest

      65 Discussions

      0
      deki
      deki

      8 hours ago

      There is a desent video and links for OMV verion 5 at:

      0
      deki
      deki

      8 hours ago

      I see Open Media Vault (OMV) has same ISO image for version 4 and version 5. Is there a difference?

      0
      Celian_31
      Celian_31

      1 day ago

      Thank you for your great instructables. I have a question however, I think the version of Openmediavault you use is not available anymore (at least the link didn't work for me). So at the moment I can't get an iso of omv to work on my pi.

      0
      boris.unuk
      boris.unuk

      Question 5 days ago on Introduction

      Hello

      I've been looking for this kind a solution for a long time. Wanted to buy NAS - enterprise solution housing but....
      So my brother found your solution and presented it to me. Can I use https://www.adafruit.com/product/3775 (Raspberry Pi-NAS 3 Model B+)
      with this casing?
      Regards
      Boris

      0
      manusamoa
      manusamoa

      Answer 2 days ago

      The PiNas is a good start and interesting, but I am using FreeNAS (fee download and uses Linux). All I needed was an older CPU with SATA connections. I added a SATA board have 7 drives (totaling 14 TB) and it works great. I am wondering if PiNAS will allow more than 2 drives.

      1
      Thorlav
      Thorlav

      7 days ago

      Excellent project! May I ask something? )
      Interesting about HDD temperature. They are in close box and can be overheated without cooling.
      And another thing. Can this soft send HDDs in sleep mode while no connections?
      Thank you )

      1
      araymbox
      araymbox

      Reply 6 days ago

      Temps should not be a problem. These are slow spinning laptop drives. When you look inside a laptop you'll see that they have even less space in there.
      Nevertheless I've also uploaded a case front with a mount for a 40mm fan:
      https://www.thingiverse.com/thing:3878669

      0
      Thorlav
      Thorlav

      Reply 6 days ago

      That's cool! Thank you ) And you right about laptop place wherу HDD lives )
      And what about sleep mode for HDDs in this device?

      0
      araymbox
      araymbox

      Reply 6 days ago

      Sorry about the second question. You can define power saving and a spindown time for when the drives have nothing to do.

      0
      Thorlav
      Thorlav

      Reply 2 days ago

      That's great! Thanks again )

      0
      MischaW
      MischaW

      Reply 6 days ago

      I literally just logged in to check out your pinas.

      Nice.

      0
      donburch888
      donburch888

      3 days ago

      Excellent instructions, well done.

      I also considered the speed/throughput and other restrictions which others have commented on here. The RasPi has sufficient CPU speed and low power - but RasPi has no SATA so conversion to/from USB is required; limited expandability from number of USB drives. In other words, no RasPi based NAS will ever be a commercial-grade option ... but it should be good enough for most home users with casual usage. You might like to add a comment to this effect to your introduction.

      Then I found a Kickstarter project which seemed to tick all the boxes ... ARM low-power processor, 4 x SATA3 on the board, open source software incl Openmediavault, and 3D printable case at https://kobol.io/helios4/ I was cautious about buying something I couldn't support myself, but they are now into their third production run with an even better model, which I believe looks commercial grade. I suggest that those people who are concerned about RasPi limitations look at the Helios64.

      0
      kmpres
      kmpres

      6 days ago

      Very interesting project! I have a ten year old D'link DNS-321 NAS set up for RAID 1 that works well as long as I use an out-of-date Windows driver with a known security flaw. Microsoft fixed the security flaw in one of their Windows updates but it is not compatible with this old NAS. To make matters worse, D'link no longer supports the DNS-321 so I'm now forced to use mine as little as possible and only when I'm off-line. If I build this Pi-NAS, will it be able to access my old D'link drives without my having to reformat them? Obviously I'd prefer to keep my old data in them, if possible. Thanks!

      0
      dblessing
      dblessing

      Reply 5 days ago

      Check out the Alt-F alternative firmware for the Dlink DNS-321. I've been using it on my 321 for years, and there are no compatibility issues with Windows 10. The web interface isn't the most intuitive, but it's actually more powerful than the original software. Just search for "Alt-F", and be sure to download the correct firmware for your device.

      0
      kmpres
      kmpres

      Reply 4 days ago

      Wow. Very impressive piece of work, this Alt-F. Thank you for the info. I now must decide whether my old 321 is worth learning another OS (Linux) just to get it online or stick with the old driver which, though flawed, is as turn-key as it gets. I learned six programming languages and three OSs in my day but Linux came too late for me to master its confusing syntax. Can you walk me through the process of loading Alt-F so I don't brick my NAS or lose my data? Thanks!

      0
      donburch888
      donburch888

      Reply 3 days ago

      BACKUP before doing ANY major change.

      Backup anyway, because hard disks DO FAIL, and the longer you use them, the closer they come to MTBF.
      DVD-R are a good cheap long-term backup media, though it can be time consuming, and get fiddly trying to decide what to put on each disk to minimise wasted empty space.
      External hard disks have become cheap enough to use for backup.

      Good luck :-)

      0
      michaelfeeney01
      michaelfeeney01

      4 days ago

      Working on building the PiNAS, great instructions clear and easy to follow. Though I've hit a problem, OpenMediaVault can see the drives but for whatever reason the program cant use them.

      What version of OMV did you use for the PiNAS

      0
      araymbox
      araymbox

      Reply 4 days ago

      Did you wipe the disks as described in Step 15?

      0
      cjlocey
      cjlocey

      4 days ago

      I bought the adapters from amazon that were linked and the PCB are not marked the same. Can anyone tell me which terminal is D+ and which is D-?

      IMG_0322.JPG