Introduction: NAS-pi:Ultimate Box for Your PLEX, DLNA and NAS Pleasures
Today, we are going to build a true looker! A Raspberry Pi network attached storage with media streaming functionality! Raspberry Pi 3 & Raspberry Pi 2 compatible! The featured build comes with 160GB RAID1 and 1.4 TB PLEX server.
- NAS drive (in RAID1 configuration) mirror your files and access it from EVERYWHERE!
- Samba (SMB) server for easy local network storage solution
- PLEX server - a favourite media centre of the masses!
- DLNA server - just in case you don't like PLEX
- 3 easily accessible HHD 2.5" bays - swappable hard drives
- USB interface for data transfer and keyboard access
- A handsome looking box!
All this goodness is available for less than $50*!!!
Are you excited yet? Don't have the $50 to spare? Don't worry, if you skip few bells and whistles you could build it for as little as $21
What it can do:
- File transfer at steady 10Mb/s
- Streaming Video files in FHD
- Play music
- Store files
- Impress your family and friends - comes with all the bragging rights!
Ready? Let's start the awesome instructable! Additional information about this build is available via this page:
Also, hint hint Raspberry Pi competition time... votes are thanked for!
*cost of the drives is not included
Step 1: The Design and Ingredients
The NASpi has been created with 3 hard drives in mind. This puts certain requirements on the parts we have to secure.
Here is a handy shopping list for you:
- 4 port 3.0 USB powered hub (micro USB preferred) (it has to be a similar design to accommodate for the cables inside) x1
- USB angled cables x4
- 2.5A -3A micro USB charger x1
- Raspberry Pi 2/3 x1
- HDD bay x3
- 2.5" HDD (salvaged from old laptops)
- Perspex glass (your choice of the colour) 3 x A4 (featured frosted glass)
- Perspex glass for logo x2 10x10cm green and red
Instructable is not great for a nicely written table, so if you want to see each component with some prices from AmazonUK/US Aliexpress and Banggood please see this post . (at the very bottom)
Step 2: Modding Raspberry Pi
To hide all the cables, my favourite board has to be modified a little. There are two cables that will stick out like a sore thumb. I have to do something about it.
- custom USB connector
- custom power delivery
One of the angled cables has to be salvaged. Cut off the mini-USB part leaving enough slack to bend the cable inside the box.
USB consists of 4 cables inside - usually coloured with Red and Black for power delivery and Green and White for data rails. Ignore the data and strip the power cables.
I soldered mine to the Raspberry Pi directly, near the power socket to deliver the power this way.(see picture)
I have to desolder the USB header from the board. I'm going to replace it with a plastic connector, but you can solder the wires directly to the board. Pay attention to the picture and labels.
The second USB header can be used for data transfers.
Step 3: The NAS-pi Box
The box initially was made out of cardboard. This means you can make the box out of anything! Later on my CAD skills improved a little bit and I have used Sketchup to create a proper case design that was used later to cut out the shapes from perspex glass. See Zip file for the sketchup file.
I went to local hackspace to get the perspex cut with a laser cutter.
I drilled additional holes in the front plate to create a better ventilation. These are later covered up by the logo which is glued to the front face using little studs. This way the air can flow and the holes are not visible.
The Raspberry Pi is mounted using 4 screws - I pre-drilled small holes inside - and dropped self-tightening nuts.
I also made a small hole (not going through tho) in the top section to accommodate the 3.5mm jack, but If I was doing it again - I would remove the jack altogether. I kept the Raspberry Pi as close to the top as possible, so if you want you can create the holes for HDMI and audio.
Step 4: Time to Build the Box
It's time to build this magnificent IKEA style enclosure.
You will need:
- acrylic glue (about $3/£2) (don't use superglue!! it will damage the glass)
- 3M tape
- agile fingers as space is at a premium.
Start with the Rasberry Pi, and manage cables. Once done, assembly the inside skeleton and glue it all together. Then it's time to plug the cables into the powered hub and stick the hub with 3M tape.
Use acrylic glue to stick the (previously opened) HDD bays to the sides. Make sure bays are facing the correct way.
Once bays are in place use glue to secure the bottom. You can also add some glue on the bays at the edges - but be mindful of the moving parts. I left the top without glue so I could access the guts easily.
Before you take care of the front and back, connect all cables including the power cable to the hub. Leave the logo as the last element.
The case will be rock solid within 24h
Step 5: OpenMediaVault - Software
You will need a tweezers unless you have loaded the software already on your Raspberry Pi.
The Raspberry Pi NAS is running an Open Media Vault software. It’s a free NAS operating system. Download the latest repository and install it on your board. Find the Raspberry’s IP and log in:
- User: admin, root (for terminal)
- Password: openmediavaut
I formatted the drives on my desktop PC to speed things up. Set it all as Ext4. Once ready plug everything in and log in to the web interface.
I strongly suggest to quick-wipe the drives before you do anything else. This way you are 100% sure drives can be accessed by the Raspberry Pi NAS. Also scan for drives even if the drives are present. The fstab file will get populated this way and will save you some issues later.
Create a user account, set a username and password. You will need these credentials later to access the network storage. Once this is done, you have to create the file systems. If you want to create a RAID partition, don’t create any file systems on the drives used for that. We will do this once the RAID partition has been created.
SMB – file sharing
Enable SMB in services, click through to shares option and create shares. It’s important that you select permission inheritance for any folders that contain media files for Plex or DLNA, otherwise, Plex server won’t see new file structures.
Once you have the shares available, modify the user permissions using the ACL option in users/share. This way you can allow users, groups etc to write/read content from the shares.
RAID1 – Mirror files
The speed of the USB on the Raspberry Pi NAS is not great, there will be no gain from stripping data across drives, but I can take advantage of RAID1 configuration. Mirroring is set so one disk is automatically mirrored on the other drive, and creates a safe backup environment. Leave this step for the end. This will take a couple of hours depending on your drives.
When the RAID set up is complete, you can create the file system, and add the shares.
First, go to OMV- extras and enable Plex. Once this is done, download Plex plugin from the menu and installation will start. It will take few moments, after which you will get the Plex option in running services. This is where you can configure your Plex server and access the Plex interface.
Make sure you have some files on your drive (transfer it using SMB protocol) as it will be easier for you to verify that you have your Plex server running successfully on Raspberry Pi NAS.
Log in to your Plex account, and the libraries selecting the correct paths and after few moments you should see the Plex and your media available for streaming.
To make sure the drives load correctly on boot we have to delay the root. I spent countless amount of hours trying to figure out why my RAID1 partition disappears after the boot. Turned out that disks weren’t spinning quickly enough at the boot to register. To fix this, pop the SD card out and add this to the cmdline.txt file