NAS Using Raspberry Pi for Your Home Network
by sidG in Circuits > Raspberry Pi
15512 Views, 81 Favorites, 0 Comments
NAS Using Raspberry Pi for Your Home Network
You may be wondering. What is a NAS and why do I need one? A NAS or Network Attached Storage device is a file server that delivers files from a shared database to users connected over a network. This provides an easy way for multiple users to access a common resource and an easy way to access multiple drives without constantly plugging and unplugging them to your PC/Laptop.
This instructable will cover how to convert your RasberryPi into a Network Attached Storage(NAS) device so that you can easily transfer files or backup them over your home network. We will be using OpenMeidaVault linux ditribution to create our NAS Solution.
Supplies
We need the following items for this project:
- Raspi 4b(any other raspi with atleast 1GB ram can aslo work but the more ram the better)
- Power adaptor
- SD card(at least 4GB recommended)
- SD card reader
- External USB Storage devices of any size available(i.e SSD, pendrive or another microSD card)
- Raspi case with a fan(Optional)
You can follow along this Youtube video to get more clarity on each step: https://www.youtube.com/watch?v=oKnZVV3Hjqo&ab_channel=BufferOverflow
Preparing the Raspi
- First insert your SD card into the SD card reader and connect it to your laptop
- Install Raspberry Pi Imager on your laptop(click here)
- Open the Raspberry Pi Imager and click on Choose OS
- Select Raspberry Pi OS(other) and then select Raspberry Pi OS Lite(32 bit)
- Now click on choose storage and select your SD card
- Now click on the gear icon in the bottom right
- Select Enable SSH option and then select on Use password authentication
- Then enable set username and password and then type in an appropriate username and password
- Then enable Configure wireless LAN and enter your wifi deatails(you can also use ethernet instead of wifi)
- Then click save on the bottom of the page
- Now press on write and after it completes writing to the SD card remove the SD card and insert it into the raspi
Install the app called netX to view the IP addresses of the devices connected to your IP-address
Installing OpenMediaVault on Raspi
First connect your USB storage devices to your raspi(I am using a 16GB pendrive for demonstration purpose)
- Now open Powershell or any other ssh client you like
- Enter the following command to ssh into the Raspi with the IP address of the raspi you get from the netX app
ssh raspi@192.168.1.17
- Now enter your password that you set in the previous step
- Now enter the following command
sudo apt update && sudo apt upgrade
- After the updates are completed enter the following command to install OpenMediaVault
wget -O - https://github.com/OpenMediaVault-Plugin-Developers/installScript/raw/master/install | sudo bash
- This will take some time to complete
- After istallation completes open your browser and type in the IP address of your raspi
Setting Up OMV(openMediaVault)
Creating Shared Folder
- On the browser you will be prompted to a login page
- The default Login ID is admin the default password is openmediavault
- Now from the menu on the left side click on Storage then Disks
- Here you will be able to view the external thumb drive or whatever storage device you have attached to the raspi
- Now click on the Shared Folders page under Storage
- Now add a name to this folder and then choose your storage device in the file system
- After than click on Save to save this configuration
Turning SMB Service on
- Now go to the Services->SMB/CIFS->Setting page
- Now check the Enable checkbox to turn the serive on
- After that click on Save
- If you get Pending Configuratino Changes Popup click on the check mark to commit these changes
Allowing SMB Servive to access our shared folder
- Now go to the Services->SMB/CIFS->Share page
- Click on the plus icon to add our new folder to the SMB service which is used by windows
- Now check the Enable checkbox and select the shared folder you have just created from the drop down menu
- After that click on Save
- If you get Pending Configuratino Changes Popup click on the check mark to commit these changes
Allowing Admin user access to Shared folder
- Now go to the Users->Users tab
- Select the newely admin user and then on the top click on the Shared Folder Permissions button and give read write access to the user for the Shared folder we just created
Adding Network Drive on Windows
- Open File Explorer
- Then go to This PC
- Now in the upper taskbar click on Computer then click on Add a network location
- Here enter the following in the network address
\\<RASPI IP ADDRESS>\<SHARED FOLDER NAME>
In my case it would be:
\\192.168.1.17\Temp
- Now click next
- You will get a pop up to enter your ID and password
- You can use the same credentials you used to login into OMV or create another user in OMV seperately to access this folder
- After the login you can view this network folder in the networks tab in File Explorer and you can copy paste files into this folder
To create new User:
- Go to OMV homescreen and from the side menu go to Users->Users
- Here you will see the default user already present
- To create new user click on the plus icon then click on Create
- Now enter the user name and password you want
- After that in the Groups tab be sure to add all the accesses you want the user yo have
- Now go back to the Users tab
- Select the newely created user and then on the top click on the Shared Folder Permissions button and give read write access to the user for the Shared folder we just created