How to build a mobile Pi NAS (Parts at the bottom)
In this project I will be showing you how to build a custom NAS server using a Raspberry Pi 4, an apache hard case from harbor freight, and two boards from geekworm. Lets dive in!
1. Take all the foam out of the case accept for the very top
2. Take the case and cut out holes for the fan intake (1 hole), fan exhaust (2 holes), and the power switch (one hole).
-
- Line up the fans on the outside of the case and trace the cut. Make sure you make the square a little smaller so the screws have something to bite.
- Remove the front cap. Measure the power button and drill a hole slightly bigger at the center or slightly higher of where the front cap was.
- Use a dremel for the fans and either a regular drill bit or hole saw bit to cut out for the previously stated parts. (double check the fan screw holes are not being cut out)
3. Assemble the Raspberry Pi, X825, X735, and HDD or SSD of your choice. (https://geekworm.com/products/for-raspberry-pi-4-x825-v2-0-2-5-inch-sata-hdd-ssd-expansion-board?variant=39353079332952) Please keep in mind that you will NOT be using the case in the how-to video if you need to watch it to assemble these items. Please watch the whole video if you need help assembling the four components.
-
-
- I did not include a HDD or SSD in the parts list. The X825 supports up to 4TB in capacity. Theoretically, it will work with a 6TB or 8TB as well but has not been tested. I use a 5TB Seagate 2.5″ HDD and have no issues whatsoever. I would recommend you stick with their specifications to be safe.
-
4. Once the boards are together with the female side of the stand-off sticking out of the bottom; connect the power cable, USB, HDMI, and Network cables/adapters to the board to mark the screws on the bottom. The pegs on the bottom of the board should be holding the HDD or SSD off of the bottom of the case. If you get a wider HDD or SSD then you may need to replace the M3 pegs with longer ones.
-
- The power cable needs to connect to the USB type C on the power management board (X735). DO NOT power the NAS from anywhere but the power management board (X735) unless you are building this without the X735. I like the X735 because of its “soft shutdown” function which makes sure the HDD or SSD does not corrupt on shutdown.
- Plug the micro HDMI into either of the ports.
5. Place the NAS into the case with the cables connected but pushed out of the way. The NAS should have the network and USB cable facing the front of the case. Make sure the screws to the screen for the air intake will not hit any of your components. Take a sharpie to trace around the four pegs on the bottom. (This part can be challenging. You may need to use a small marker or something small to scratch around the peg to mark it) Drill the holes the same size or a little bigger than the screw you will use to mount the NAS through the bottom of the case.
6. Once the four pegs are marked you will want to install the fans and screens.
-
- Hold the screen square to the side of the box and mark the four holes you need to drill.
- Get a drill bit the exact size or a little smaller than the included screws and drill the holes.
- For the side with two fans; hold the fans inside of the box, keeping mind of the wires, screw the screen to the box using the same screw to hold the fans by lining up the holes.
7. Place the NAS back into the box facing the correct way and with the four wires/adapters connected. Screw the NAS to the case with two screws diagonally to hold the NAS in place. Time to trace and drill the holes for the network, power, and USB/HDMI mounts.
-
-
- Start with the USB/HDMI mount and connect the cables/adapters to the board. I have been unable to find a smaller adapter suitable for the HDMI and USB so coil the cables up as seen in the photos and velcro it on top and bottom. Trace around the mount and drill the hole the same size or a tiny bit bigger than the mount. The best location for the HDMI/USB I have found to be the back lower left corner when looking from the front.
- Using the same method, hold and trace the power mount keeping in mind to leave some space from the nut to the HDMI/USB that holds it in place.
- Take the network adapter and wrap it under the board and to the back. Take the network mount and hold it where it will miss the hinge supports in the back, and not interfere with the IO pins on the power management board (X735). Mark the holes you need to drill for the screws.
-
8. Remove the NAS and cables. Using a drill bit or hole saw bit, drill the holes for the HDMI/USB and power mounts. Use a drill bit a little bit smaller than the provided screws for the network mount and drill those holes as well.
-
-
-
- To cut out the port for the network, use a drill bit to make a hole and use a tool such as a jigsaw to cut out the port being careful not to cut too big. Cut a little at a time if needed.
- Use a file to dull sharp edges if necessary and clear the debris from the case.
-
-
9. Keep the cables/adapters connected to the board to make it easier and mount the NAS to the case. Once you have the NAS mounted, install the power, network, and HDMI/USB mounts. Make sure the cables and adapters are not going to hit the fans. Next install the power button in the hole on the front of the case that you drilled on step two. Connect the power switch to the second port in on the power management board (X735).
10. The two fans need to have their polarities changed in order to match the + and – on the 5V outlet. Change the polarities by pushing in the pins on the connectors to the fan and pulling them out gently. Insert them in the opposite side each one came out and you now have changed the polarities. Run the cables from the two fans over to the two 5v ports on the X825 and connect them.
11. Time to install the operating system and software.
-
- Connect the SD card to your computer using the adapter.
- Download the Raspberry Pi Imager here: https://www.raspberrypi.com/software/
- Open the imager program and select “Choose OS”
- Click “Raspberry Pi OS (other)”
- Click “Raspberry Pi OS Lite (32-bit)”. If you have 4GB or more then select the “Raspberry Pi OS Lite (64-bit)
- NOTE: You can install a different operating system such as the arm version of ubuntu, but I would recommend sticking with the operating system previously stated for new users.
12. Next, click “Choose Storage” and select your SD card
13. Press CTRL, SHIFT, and X at the same time to get advanced options. We are going do a “headless install” which means we are going to connect to the NAS without connecting a monitor, keyboard, or mouse.
-
- Check “Enable SSH” and scroll down to change the username and password.
- Change the username and password to what ever suits you but DON’T LOOSE IT 🙂
- After you have typed your credentials, select “Save” at the bottom.
14. Click Write and you will be prompted letting you know all data on that SD card will be erased. ***MAKE SURE NOTHING IMPORTANT IS ON THE SD CARD***
15. Once the writing is complete, remove the SD card from your computer and insert it into the Raspberry Pi.
16. Time to turn the NAS on and connect to it from our computer to install the rest of the software.
-
- In order to connect to the NAS, we need to know its IP-address. We will use a tool called Nmap to find its IP-address. https://nmap.org/download
- You will need to know your subnet, or IP-address range to use this program. (For Windows Users) Go to your search at the bottom of the screen or in your start menu and find “CMD” or “Command Prompt” and open the program.
- In the command prompt, type “ipconfig”. You will want to find the IPV4 address and you will need the first three sets of numbers EX: 192.168.0.0
- Go back to Nmap and in the target range type the same first three numbers followed by 0-255 like so: 192.168.0.0-255
- Under profile, select “Quick Scan”
- At the top right, click scan and it will scan your network for all devices. You will want to find a device that says “Raspberry Pi Trading” or some description like this. Now go back to the command prompt.
- In the prompt, you will type “ssh <USERNAME>@<IPADDRESS> your username will be the username you set in the imager on step thirteen. EX: ssh [email protected]
- You will be asked if you trust this device by typing yes or no. type “yes” and press enter
- You will be prompted for a password. This is the password you set in the imager on step thirteen.
- NOTE: If for some reason the SSH does not work with that IP-address because the keys don’t match; you can use this command to reset the IP-address: ssh-keygen -R <IPADDRESS>
- If you need to reset the keys then you will need to try to SSH once again and you should be prompted to trust the device. Type “yes” and hit enter. You will be prompted for your password that you previously setup.
17. You have now connected to your NAS remotely. Time to install the software that makes it a NAS!
-
-
- First we need to update the operating system. Type: “sudo apt-get update && sudo apt-get upgrade -y” to update software
- This may take a minute. Once you have fully updated the software, reboot and run that command again to make sure you are fully up to date.
- Next we are going to download the install script that will install Open Media Vault on our server.
- Type “sudo apt install git -y”
- Once that program has installed, type the following in your prompt to get the installation script: “git clone https://github.com/RomanNum3ral/Raspberry-Pi-NAS.git”
- Type “cd Raspberry-Pi-NAS” to change into the folder we just downloaded
- Type “sudo chmod +x *.sh” to make the programs executable
- NOTE: If you are still having permission issues to run the program, you can run this instead “sudo chmod 777 *.sh” WARNING: Only do this if the “+x” command fails. This command changes the ownership permissions to the executables in this folder to the account you are currently using
- Type “sudo ./open_media_vault_only.sh” to execute the program and install the NAS software
- This could take a while so be patient and let the program run. Your system will restart once it has completed
-
18. We are now going to login to the Open Media Vault portal. Repeat step sixteen because the IP-address may have changed after the installation.
-
-
-
- If your IP address has stayed the same then you may need to run this command before you are able to access the server via SSH again: “ssh-keygen -R <IPADDRESS>”
- Once you have the IP-address from completing step sixteen, open a web browser and type the IP-address into the address bar at the top. EX: http://192.168.0.123/
- The default username and password are as follows: Username: admin Password: openmediavault
-
-
19. Next we need to change the default password as good security practice demands.
- In the upper right hand corner, click the person for user settings.
- Click “Change Password”
- Enter your new password twice and click save.
20. Now we are going to setup your storage device.
- To the left of the screen is a menu. Click “Storage” and then “Disks”
- Select your drive in the menu by clicking it and click the eraser symbol labeled “Wipe”. Confirm and click “Yes”. Select “Quick” unless you want to make sure no previous information from the storage device leaks metadata; then select secure. Secure wipe will take significantly longer.
- Next, go to the menu on the left and select “File Systems”
- Click the plus symbol labeled “Create and mount a file system” and select EXT4
- Under “Select a device” choose the storage device you just wiped and click “Save”. This Process could take a few minutes especially if you have a larger storage device. Wait for the prompt to state “END OF LINE” then you can click “Close”
- Under “File system” select your new EXT4 file system and click “Save”
- You will have a pop-up stating you have pending configuration changes. Click the check mark at the top left and select “Yes”
21. Time to setup your new share, this will be what you use to access the storage device
- On the right hand menu, click “Shared Folders”
- We are going to create a new shared folder. Click the plus symbol at the top.
- Under “Name” give this share a name that will be seen and used to identify your new storage.
- Under “File System” select the storage device we have been working with and click “Save”
- You will have another configuration pop-up. Click the check mark, then “Yes”
22. Now we need to setup the services to connect to the share.
- On the menu to the left, click “Services” then “NFS” then “Settings”
- Check “Enabled” and click “Save”
- Click “Shares” in the sub-menu to the left under “NFS”
- Click the plus symbol.
- Under “Shared folder” select the share created in the previous step. Under “Client” enter the username you made when setting up the Raspberry Pi in step 13 and click “Save”
- On the menu to the left, click “SMB/CIFS” then “Settings”
- Check the enabled box and click “Save” at the bottom.
- On the menu to the left, click “Shares” under “SMB/CIFS”
- Click the plus symbol
- Under “Shared folder” select the share you made in the previous step and click “Save” at the bottom
- Now, we will save the pending configuration changes by clicking the check mark and “Yes”
23. We need to give your user access to the share so you can access it
- On the menu to the left, click “Users” then “Users”
- Select your user and click the pencil labeled “Edit”
- You are going to set the password you use to access the share via other devices. Under “Password” enter a new password for your user and confirm as well. Click “Save” when complete.
- Save the pending configuration changes by the check mark and clicking “Yes”
- Next, select your user again and click the folder logo with a key labeled “Shared folder privileges”
- On the share we created, give “Read/Write” privileges and click “Save”
- Save the pending configuration changes by the check mark and clicking “Yes”
Congratulations! You now have a working NAS server. The following steps are going to show you how to add the share in windows.
- In windows, open file explorer and go to “This PC”
- In the open space below your drives, right click and select “Add a network location”
- In the wizard, select “Choose a custom network location”
- In the address field, type \\IP-ADDRESS\SHARE_NAME Example: \\192.168.0.123\my_share
- You will be prompted to login, enter the username and password discussed in step 23
- You can now give your share a name. I would suggest the name you gave the share originally (you can delete the description and ip-address).
- Click “Finish” and you now have a working NAS. Congradulations! Happy Hunting!
Parts List:
- Apache Hard Case – https://www.harborfreight.com/1800-weatherproof-protective-case-small-black-64550.html
- X825 v2.0 SATA Board / X735 v3.0 Power Management Board – https://geekworm.com/products/for-raspberry-pi-4-x825-v2-0-2-5-inch-sata-hdd-ssd-expansion-board?variant=39353079332952
- Raspberry Pi 4 (4 or 8GB recommended) – https://www.raspberrypi.com/products/raspberry-pi-4-model-b/
- Case Fans – https://www.amazon.com/HKWANTAT-Bearings-Brushless-Cooling-60x60x10mm/dp/B09KGNWWZ4?pd_rd_w=KGfgJ&content-id=amzn1.sym.80bfd2e5-c81d-48d5-ae85-c500e2214af9&pf_rd_p=80bfd2e5-c81d-48d5-ae85-c500e2214af9&pf_rd_r=PRYFCXYSVCP6Q5499R9W&pd_rd_wg=eWt3s&pd_rd_r=0ccab2bd-fff2-438d-a3ed-99f749ccd12c&psc=1&ref_=pd_bap_d_csi_pd_ys_c_rfy_rp_crs_0_t
- Fan Filter – https://www.amazon.com/Computer-Filter-Grills-Aluminum-Stainelss/dp/B08F9RT11M?pd_rd_w=vOBFK&content-id=amzn1.sym.deffa092-2e99-4e9f-b814-0d71c40b24af&pf_rd_p=deffa092-2e99-4e9f-b814-0d71c40b24af&pf_rd_r=39918101XQTCMY5W8ZYC&pd_rd_wg=UW9fs&pd_rd_r=3963fe84-1e80-4082-a5f6-d00b0c9414ee&pd_rd_i=B08F9RT11M&psc=1&ref_=pd_bap_d_rp_11_t
- Power Cable – https://www.amazon.com/CERRXIAN-Waterproof-Extension-Motorcycle-Dashboard/dp/B08H5F9R8N?pd_rd_w=vOBFK&content-id=amzn1.sym.deffa092-2e99-4e9f-b814-0d71c40b24af&pf_rd_p=deffa092-2e99-4e9f-b814-0d71c40b24af&pf_rd_r=39918101XQTCMY5W8ZYC&pd_rd_wg=UW9fs&pd_rd_r=3963fe84-1e80-4082-a5f6-d00b0c9414ee&pd_rd_i=B08H5F9R8N&psc=1&ref_=pd_bap_d_rp_14_t
- Micro HDMI to HDMI – https://www.amazon.com/UGREEN-Adapter-Compatible-Raspberry-ZenBook/dp/B00B2HORKE?pd_rd_w=vOBFK&content-id=amzn1.sym.deffa092-2e99-4e9f-b814-0d71c40b24af&pf_rd_p=deffa092-2e99-4e9f-b814-0d71c40b24af&pf_rd_r=39918101XQTCMY5W8ZYC&pd_rd_wg=UW9fs&pd_rd_r=3963fe84-1e80-4082-a5f6-d00b0c9414ee&pd_rd_i=B00B2HORKE&psc=1&ref_=pd_bap_d_rp_5_t
- HDMI and USB Flush Mount – https://www.amazon.com/gp/product/B09L4PZDH5/ref=ppx_yo_dt_b_search_asin_title?ie=UTF8&psc=1
- USB 90 Degree Adapter – https://www.amazon.com/Oxsubor-SuperSpeed-Female-Extension-Cable/dp/B0793P8XJK?pd_rd_w=3Yzwe&content-id=amzn1.sym.deffa092-2e99-4e9f-b814-0d71c40b24af&pf_rd_p=deffa092-2e99-4e9f-b814-0d71c40b24af&pf_rd_r=SWSKHWGGKDGRVFR9Q6FZ&pd_rd_wg=5Tx3V&pd_rd_r=b1dbbf57-3ac0-4b58-94aa-c85be6282405&pd_rd_i=B0793P8XJK&psc=1&ref_=pd_bap_d_rp_6_t
- Network Adapter – https://www.amazon.com/gp/product/B07TYH668P/ref=ppx_yo_dt_b_search_asin_title?ie=UTF8&psc=1
- SD card 16GB recommended
- SD card to USB adapter
- HDD or SSD of your choosing