PiNAS - the Raspberry Pi NAS

by araymbox in Circuits > Raspberry Pi

380460 Views, 1645 Favorites, 0 Comments

PiNAS - the Raspberry Pi NAS

Cover_1.jpg
Cover_2__3+4.jpg
IMG_20191007_232916_1.jpg
IMG_20191007_232615.jpg
IMG_20191007_232433_1.jpg

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

Materials & Tools

IMG_20190919_203718_1.jpg

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:

3D Printing the Case

3D.JPG
IMG_20190924_185402.jpg

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 the 3D files on this page (I'll keep it there to avoid redundancy):

https://www.prusaprinters.org/prints/149789-pinas-the-raspberry-pi-nas

3D Print Post-processing (optional)

IMG_20190924_195004_1.jpg
IMG_20190924_193716_1.jpg
IMG_20190924_222442.jpg
IMG_20190925_081136_1.jpg
IMG_20190926_203115.jpg

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.

Preparing the SATA to USB Adapters

IMG_20190919_204641_1.jpg
IMG_20190919_211611.jpg
IMG_20190919_223632.jpg

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.

Preparing the Inner Case

IMG_20190924_185705.jpg
IMG_20190924_185921_1.jpg
IMG_20190924_190132_1.jpg
IMG_20190924_201150.jpg

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.

Wiring and Assembly: Raspberry Pi

pinas_complete_wiring.png
IMG_20190924_202310.jpg

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.

Wiring and Assembly: USB Breakout Board

IMG_20190924_202643.jpg

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.

Wiring and Assembly: Installation

IMG_20190924_202927_1.jpg
IMG_20190924_203310.jpg

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.

Wiring and Assembly: HDD Adapters

pinas_complete_wiring.png
IMG_20190924_204106.jpg
IMG_20190924_204300_1.jpg
IMG_20190924_205424_1.jpg
IMG_20190924_205522.jpg

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.

Case Assembly: Faceplate (optional)

IMG_20190923_221229.jpg
IMG_20190926_203423.jpg
IMG_20190926_204220_1.jpg

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.

Preparing the SD Card

1.png
2.PNG
3.PNG
4.PNG
9.PNG

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.

Case Assembly

IMG_20190926_204320_1.jpg
IMG_20190926_204431.jpg
IMG_20190926_204502_1.jpg
IMG_20190926_214737.jpg

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.

Configuring Open Media Vault

10.PNG
19.png

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.

Configuring OMV: System

12.PNG
13.png
14.png
15.png
16.png

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

Configuring OMV: Storage

17.png
18.png
20.png
21.png
22.png
23.png
25.png
26.png
27.png
28.png

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

Configuring OMV: Access Rights Management

29.png
30.png
31.png
32.png
33.png
34.png

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

Configuring OMV: Services

35.png
36.png
37.png

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

Using the NAS

38.png
39.png
40.png

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.

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.

Change History

04-FEB-2020:

  • Published.