PiNAS - the Raspberry Pi NAS

318,588

1,491

105

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

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

    Second Prize in the
    Raspberry Pi Contest 2020

    Be the First to Share

      Recommendations

      • Pi Day Speed Challenge

        Pi Day Speed Challenge
      • Trash to Treasure Contest

        Trash to Treasure Contest
      • Microcontroller Contest

        Microcontroller Contest

      105 Comments

      0
      lluisd
      lluisd

      15 days ago

      To summary, It was a fun project but I don't like the final result,it's to NOISY to have it with a fun (that case makes it noisy, also with the anti-vibration screws). And doesn't have sense to have a RAID using USB

      IMG_20210217_213430.jpgIMG_20210217_213439.jpgIMG_20210217_213500.jpgIMG_20210217_213513.jpg
      0
      benoitcalbet
      benoitcalbet

      Question 6 weeks ago

      Hello all, thanks very much for the topic and the instructins. I have a small problem at stape 11 when i try to launch OMV nothing is on the screen (screen say "no signal") but all is plug hdmi cable, power cable, ethernet cable) do you have allready this ?
      thanks for your answers

      0
      benoitcalbet
      benoitcalbet

      Reply 16 days ago

      Hello Iluisd, thanks for the reply, i try this today or tomorrow.

      0
      steve.brooks7
      steve.brooks7

      Question 7 weeks ago on Introduction

      First I want to say your detailed instructions are great. I am brand new to using a Pi but want to learn more so here I am. My question is how secure is this setup? Are there ways to make it more secure? Are their good instructions out there to help me with this.

      0
      mws7497
      mws7497

      Question 2 months ago

      I have my pi 4 8gb set up with OMV and it is working great on my home network.

      How do I set it up so I can connect remotely e.g. when I'm babysitting 50 miles away,? I'm worried about the security implications!

      0
      COCOisCOOL
      COCOisCOOL

      Answer 7 weeks ago

      VPN my dude. WireGaurd VPN.

      0
      e0142494
      e0142494

      2 months ago

      Hey, this is so cool, i actually tried to build something like this, but i got greedy and went for 4 hard disk drives instead, then I ran into a power issue.

      So i ended up splicing the cables to power the hard drives separately, and it seems more stable that way.

      Especially when I tried to overclock my raspberry, the hard disks ran low on power.

      So i'm wanted to hear what are your thoughts on powering all on one USB, instead of using more USBs.

      0
      _soapy_
      _soapy_

      2 months ago

      Hi. Not to be a downer, but SMB (version 1 at least) has a huge security flaw in it, and shouldn't be used.

      4
      kulaksazov
      kulaksazov

      Question 2 months ago

      Hello!
      You mentioned Pi4 at the beginning with some "tweaks" ...
      Could you describe these "tweaks" and send the wiring diagram for Raspberry 4 for USB 3.0 data?
      I have a Raspberry 4 with 4 GB of memory and I want to use it to the fullest.Thanks in advance!
      Greetings, Kulaksazov!

      1
      MattR115
      MattR115

      1 year ago

      Except for the nice printed cabinet, this is the same pi-nas I built that has been running over 2 years (on the same memory card too!). I built mine with a sata to usb adapter that has two slots, thus the only connection is a usb cable from the adapter to the pi. This adapter can duplicate a drive in slot 0 to slot 1 off-line which saves processing for backups. My drives are 1tb ssd drives (now pretty cheap on sale). Thus between the pi 3B and the sata drives I have NO moving parts - which was one of my goals. ALL previous nas units eventually fail due to the failure of moving parts (power supply fan or disk drive failure). Performance is a bit slow primarily due to the usb2 interface on the pi 3b. I've tested the ethernet connection and found it to run pretty much at 100 mbs. Hopefully the pi 4 with usb3 would be faster.

      0
      MichalH32
      MichalH32

      Reply 5 months ago

      Hi there Matt, would you mind posting a link or make and model of your dual drive adapter you mention above? Thanks...

      0
      MichalH32
      MichalH32

      Reply 5 months ago

      Thanks Matt. That looks like a handy device, little disadvantage I see is that you have to manually turn the cloning on, is that right? Do occasionally go and press the cloning button to replicate your primary drive? I saw an instructional video about the unit and they mentioned something that the unit should be disconnected from USB port when you want to initiate the cloning process, which is suggesting that it would be relatively cumbersome / impossible to set it up without having to unplug the unit from R-Pi to clone the content of the primary drive.

      0
      alain.manches
      alain.manches

      6 months ago

      Une superbe et très intéressante application sur Rasperberry.
      Bravo.

      3
      AlexTrue111
      AlexTrue111

      7 months ago

      Hello, maybe someone can help me with this one:

      The SATA-USB Adapter i got have another layout (all available on AE or AMZN have the same as i can tell), so they are not the same used here. When i connect them in Step 15 the HDDs show up as Model: Tech, SN: 00000000045A9, Vendor: JMicron. The SN is the same for all HDDs i connect, it shows the SN of the adapter i guess, not of the HDD. Causing i can only see one HDD even if i connect two, only one will be active...

      Am i doing something wrong here?.. Thank you!

      0
      Aravind R
      Aravind R

      Question 8 months ago

      On step 11, I inserted in a blank sd card into my computer and flashed the open media vault files onto it. However, when I inserted the sd card into the raspberry pi and connected it up to a monitor, the monitor did not turn on. When I inserted the sd card with the raspbian jesse operating system into the raspberry pi and hooked it up to the monitor, the monitor turned on and worked fine. I do not know what I did wrong and any help would be greatly appreciated.

      0
      aadithya_s
      aadithya_s

      8 months ago

      Won't this be running at USB 2.0 speeds?