avatarMerwansky

Summary

The article provides a comprehensive guide on building a home Network Attached Storage (NAS) system using a Raspberry Pi 4, an old hard drive, and the open-source software OpenMediaVault.

Abstract

The article titled "Build Your Home-NAS with OpenMediaVault and Raspberry Pi-4" offers a detailed walkthrough for creating a personal NAS solution. It begins by explaining the concept of NAS and its benefits for data management and accessibility. The author shares their experience using a Raspberry Pi 4, an old hard drive, and OpenMediaVault to build a cost-effective and powerful NAS system. The guide covers the necessary supplies, including a Raspberry Pi 4, a suitable power supply, a microSD card, an Ethernet cable, and external USB storage. It details the configuration process for the Raspberry Pi, including setting up the operating system using Raspberry Pi Imager, configuring network settings, and enabling SSH for remote access. The article introduces OpenMediaVault, a Debian-based NAS solution designed for Raspberry Pi, highlighting its ease of use and support for various services. The installation process for OpenMediaVault is provided, along with steps for configuring storage, adding users, and setting up network shares for different operating systems. The author also addresses common issues, such as permission problems and loss of SSH access, and concludes with a philosophical note on the importance of maintaining a mindset of continuous learning.

Opinions

  • The author suggests using the default username "pi" for simplicity when following the installation instructions.
  • It is recommended to format the storage device using the EXT4 format for compatibility and functionality with OpenMediaVault.
  • The article emphasizes the importance of updating the operating system and changing the default OpenMediaVault password to enhance security.
  • The author provides troubleshooting tips based on personal experience, such as dealing with permission issues and re-establishing SSH access.
  • The article endorses OpenMediaVault for its robust features and ease of setup, making it suitable for users looking to create a DIY NAS system.
  • A cost-effective approach is highlighted, utilizing an old hard drive and open-source software to build the NAS.
  • The author encourages readers to adopt a mindset of perpetual learning, quoting Vernon Linwood Howard to inspire continuous personal growth and development.

Build Your Home-NAS with OpenMediaVault and Raspberry Pi-4

Unlocking the Power of Raspberry Pi with OpenMediaVault: A Comprehensive Guide

Photo by Alex Cheung on Unsplash

The term “NAS”, short for Network Attached Storage, stands as a pivotal solution to solve/handle the issues/challenges of data management and accessibility. This will allow you to save files from your computer and mobile devices to the external hard drives via your home network.

In this article, I will share how I built my own NAS system using a Raspberry Pi, an old hard drive, and open-source software. And of course some of the issues I had and the mistakes I made so that you avoid them.

Supplies

  • Raspberry Pi (I am using Raspberry Pi 4 8GB) → The faster your Raspberry Pi, the faster your data will be saved to your external storage.
  • suitable Raspberry Pi power supply (see the power supply documentation for details)
  • microSD card (see the SD card documentation for details)
  • adapter to connect your microSD card to your main computer
  • Ethernet cable
  • External USB storage (1 or more up to you) I used an old hard disk drive (HDD). It is recommended to clear your drive of data, as you may need to format it (in EXT4).

Configure your Raspberry Pi

To begin, follow the Getting Started documentation to set up your Raspberry Pi. You can use the software tool “Raspberry Pi Imager

For your operating system, choose Raspberry Pi OS Lite (32-bit/64-bit) to run headless (without the need to have a screen attached to the PI, a mouse, or a keyboard).

During the OS customization stage, edit settings as follows:

  • Enter a hostname of your choice (we suggest pi-nas for example)
  • Enter a username and password; you’ll need these later to authenticate

Here I would suggest to keep/use the default user name “pi” and for the password up to you!!!

  • Check the box next to Configure wireless LAN so your Pi can automatically connect to Wi-Fi
  • Enter your network SSID (name) and password;
  • Check the box next to Enable SSH so you can connect to the Pi remotely

Set up your Raspberry Pi

To get the best performance possible, connect your Raspberry Pi directly to your network via an Ethernet cable. Before booting the Pi attach your storage i.e. hard drive(s) directly to one of the Pi USB ports or a powered USB hub, connected to the Pi of course.

source

Remotely connect to your Raspberry Pi

Now via SSH connect to your Raspberry Pi, you’ll use the user name and password set during the SD-card preparation. Also, the IP address of the Pi, to get this check the router if you have access to the page that lists the devices connected to your network.

source

If you don’t have access to this information use the “arp -a” command in Windows or “nmap -sn” if you are using Linux to find the IP address of the Pi.

Connect via SSH

Open a terminal session on your usual computer. To access your Raspberry Pi via SSH, run the following command, replacing <IP adress> with the one you have:

$ ssh pi@<IP adress>

Enter the password you created during the initial installation. When you’re logged in, it’s a good practice to update the newly installed operating system.

sudo apt update && sudo apt upgrade

Once this is done we can now install the software that will allow us to manage and create our homemade NAS system “OpenMediaVault”.

What is OpenMediaVault?

OpenMediaVault is a robust network-attached storage (NAS) solution, that will allow us to transform a Raspberry Pi into a powerful NAS. It is built on Debian, and designed specifically for Raspberry Pi users.

Among its advantages, we have the easy setup, and built-in support for various services like (S)FTP, SMB/CIFS, DAAP media server, RSync, and Docker containers …

source

To install and run “openmediavault” ssh to the pi and run the following command line:

wget -O - https://raw.githubusercontent.com/OpenMediaVault-Plugin-Developers/installScript/master/install | sudo bash

You will be asked to enter the password to continue. This will take up to ~10 minutes to complete. And once it is done the Pi will reboot. After the reboot, the IP address may have changed. So, try first to ping or ssh to the pi with the old IP address, if that doesn’t work. To find the new IP address use the same technique used above.

Once that is found write down the IP address of the Pi in the address bar of your web browser et voila:

Take note of the default username (admin) and the default password (openmediavault) shared in the log-in greeting. Once you are logged in the first thing to do is “Changing the Default Password” to secure your OpenMediaVault admin account by changing the default password in the “General Settings” menu (top right corner).

The provided dashboard offers monitoring insights into your CPU, memory, containers, file systems, services, network interfaces, and additional diagnostic tools. To access the settings page, click on the hyperlink within the Information message. Once there, you’ll find a list of options. Check the boxes next to your desired diagnostic metrics and save your selections.

To adjust the dashboard widget settings, click on the person icon located at the top right corner and choose “dashboard.”

Adding Users

If you would like to add new users to your NAS, Navigate to Users > Users in the left-hand menu. Click the blue plus icon at the top left and complete the mandatory fields. Ensure to save your entries. Your users, along with email and group information, will be displayed. To edit user details, click on the user’s row and select the pencil icon above the name heading. The user details displayed will resemble the information shown in the image.

Connecting Storage

To configure your attached storage, such as the 128GB SD card or a larger USB drive, follow these steps:

1- Navigate to Storage (left side) > File Systems. Click on the blue plus icon near the top and select “mount.” Choose the file system you wish OpenMediaVault to connect to and save your settings.

PS: Make sure that your device is formatted using the EXT4 format

2- Observe a warning message at the top. To ensure changes are saved, click the checkmark at the top right of this admin tool to validate the changes you just have made. Then, click Yes.

3- Navigate after this to (still left side) > Shared Folders. Click on the blue plus icon near the top and select “Create.”

Choose after that a “name, file system, …”

After this part and depending on the OS of the computers you are using within your network (Windows / Linux / …). Go to Services -> and select NSF (Linux) or SMB/CIFS (Windows)

Then activate by checking the “Enabled” -> checkbox

Et voila your NAS system is ready and yes indeed it is up and running!

source

If you are a Windows user open your file explorer go to “This PC” and then right-click with your mouse -> then choose the option “Add a network location”

Click -> Next -> Next -> then fill in the IP address of your PI followed by the name of the folder you have set in the previous steps e.g., nascard. Enter the username and password that you have set (you can select to save this information or not).

Some Issues

(A) Permissions not working (“You Need Permission to Perform this Action” on Windows), read-only on all devices including IOS/Android even though perms are set to read/write in OMV

  • Make sure to format the hard drive you will be using as a storage device in “EXT-4” It was the only format that was able to use (Read more about this Reddit Q&A)

(B) No longer able to ssh to the Raspberry Pi anymore!!!

  • Keep the user name “pi” don’t change it especially if you are going to follow the instruction line by line and not change any script,
  • If you choose another user name, you will have to change the script that installs “openvaultmedia” and add that user name to the list of authorized users in “ssh”

Et voila, we reached the end of the article, and as usual, we finish it with a quote from Vernon Linwood Howard, who was an American spiritual teacher, author, and philosopher.

“Always walk through life as if you have something new to learn and you will.”

Remember to adopt always a mindset of perpetual learning. Life’s path unfolds its wonders when approached with the curiosity of a perpetual student. There is always something new to learn and each day becomes an opportunity for enlightenment, a chance to glean insights from the world around us.

Cheers

Merwansky

Nas
Raspberry Pi
Storage
Open Source
Home
Recommended from ReadMedium