Introduction: NAS Raspberry Pi
If you have a hard drive that is collecting dust. You can use it and create a NAS with a Raspberry Pi. Check this project and enjoy it.
Last December I replaced my laptop hard drive. It had an HDD and I replaced for an SDD. Since then I have not used the HDD.
I got an idea to use the HDD and create a NAS with a Raspberry Pi.
I will use that NAS to storage some recordings from an IP camera. It has the possibility to store video in a NAS. I can also use it to store some files.
If you have any other ideas to use my NAS. Write me a comment.
Let's get started.
Step 1: Download Raspberry Pi OS
The NAS works with a software called Open Media Vault, but first, we need to download Raspberry Pi OS (previously Raspbian) in the micro-SD card. We should download the Lite version of the Raspbian OS. That version does not have a graphic environment.
Step 2: Flash OS in Micro-SD
After download Raspberry Pi OS, you should unzip and write it in the micro-SD card. For that purpose, you can use balena etcher program. First, insert the micro-SD in the PC, then pick the image from the Raspberry Pi OS folder, select the target (micro-SD card), and the flash.
Step 3: Enable SSH
Before inserting the micro-SD card in the Raspberry Pi, we need to create a file inside the card. That file will enable SSH connection to the Raspberry Pi. It will allow us to connect to the Raspberry without using a monitor and keyboard.
Insert the SD card to the PC. Open the file explorer and select the SD Card drive. Inside the memory create a file and call it ssh. This file should be empty and without any extension. Finally, remove the SD card from the PC.
Step 4: Install OS
We will go to install the Raspberry Pi OS. Insert the micro-SD card in the Raspberry Pi. Connect the Raspberry to a network using a network cable and finally, plug the Raspberry to the electricity.
After that, you should wait for 3 to 5 minutes.
Then you need to look for the Raspberry Pi IP address. You can use IP Advanced Scanner, make a scan and find the IP address.
Now, you need to use a way to connect via ssh to the Raspberry. You can use Putty if you use Windows or open a Linux terminal and use the command ssh pi@ipaddress.
The Raspberry default credentials are user: pi and password: raspberry.
You should change that password using the passwd command and write a new password. You do not forget that password.
Step 5: Upgrade the OS
Os are continually upgraded. That is to solve some bugs and vulnerabilities. After installing the Raspberry Pi OS you should upgrade it. For that purpose you should use the following commands:
sudo apt-get update
sudo apt-get upgrade -y
sudo rm - f /etc/systemd/network/99/default.link
After those commands you should reboot the Raspberry. Use the following command:
You should wait for 3 to 5 minutes before trying to connect again.
Step 6: Installing Open Media Vault
Now, you are ready to install Open Media Vault. To do that you need to run the following command:
wget -O - https://github.com/OpenMediaVault-Plugin-Developers/installScript/raw/master/install | sudo bash
After hit enter you should wait for up to 30 minutes. You must not close Putty or Linux terminal.
When the installation concludes, the Raspberry Pi will reboot automatically.
Step 7: Access Open Media Vault
We are ready for configuring our NAS. To access to the configuration page you need to open a browser and enter the Raspberry Pi ip address.
The default credentials are user: admin, pass: openmediavault.
Step 8: Change the Default Password
I recommend changing the default password. For that, you should go to general settings and then go to the web administrator password. Write the new password, save and apply the changes.
Another important step is to make the ip address static. For that, you should go to network, interfaces, click in the interface that appears, select the static method, and fill the address, netmask, and gateway. You can use the current ip address.
After those changes, you should save and apply the changes.
Step 9: Configure the Date and Time
If you want you can configure the date and time for the system. I recommend configuring these options because the system should have the right time and date. In the system blade click date and time, pick up your time zone, then save and apply the changes.
Step 10: Storage
In the storage section select disk. You can see all the disks or media that are connected to the Raspberry Pi.
You can see the micro-SD car and the hard drive.
Step 11: File System
If you go to the file system, you can see the partitions in the hard drive.
In that section, you should select the partition that you want to use and mount it. Then save and apply the changes.
Step 12: Shared Folder
In the Access Right Management, go to a shared folder, then click on add. In this part, you fill the name of the folder, select the device, fill the path for the folder, and select everyone: read/write as permissions. Finally, save and apply the changes.
We should not give permissions to everyone. But this is a pilot project. You should increase the security for your project if this NAS will be permanent.
Step 13: SMB/CIFS Protocol
You should go to Services and click on SMB/CIFS. In this section, you enable SMB/CIFS protocol to allow share the folder with Windows and Linux devices.
You should enable and change the workgroup name, by default all windows machines are in the workgroup WORKGROUP. Finally, save and apply the changes.
Then, click on the tab shares and click on add. In this box, you should select the shared folder that we configured previously, and in the public drop-down select Guest Allowed. Save and apply the changes.
We have configured our Raspberry Pi NAS. Now it is time to test it and enjoy it.
Step 14: Test
If you are using Windows, open a file explorer, go to Network and you will see the name of your NAS. Double click on it, it will ask for a user and password, write any user and password. You did not set that, remember you allow guests. I recommend a change that configuration if your NAS will be permanent. If everything is ok you should see your folder.
I hope you enjoy this project.