Raspberry Pi – NAS Storage

In my previous blog here I wanted to extend my storage but it also has to be redundant, so I don’t loss any data. That’s why I  build a Raspberry Pi® 3 with RAID Storage using Some old 2.5″ HD drives (You can also use USB sticks). Now we going to extend this installation to a NAS Storage.

Install and Setup SAMBA

 

SAMBA is a Windows file sharing system that runs on Linux, works flawlessly, and is easy to setup too. Let’s install SAMBA and then configure it with the following code:

sudo apt-get install samba samba-common-bin -y

After SAMBA finishes installing, let’s add user:pi and share password by entering the following code (enter a password at the prompts):

sudo smbpasswd -a pi

Which should produce the following result if successful:

pi@Server:~ $ sudo smbpasswd -a pi
New SMB password:
Retype new SMB password:
Added user pi.
pi@Server:~ $

Before we start altering the SAMBA config file, let’s make a backup:

sudo cp /etc/samba/smb.conf /etc/samba/smb.conf.bak

Now let’s edit the smb.conf file:

sudo nano /etc/samba/smb.conf

Now scroll all the way down to the bottom of the file using your arrow key, then add the following code to create your NAS file share:

# NAS Share
[NAS]
path = /mnt
comment = RasPi NAS Share
valid users = pi
writable = yes
browsable = yes

The save Ctrl+O and exit Ctrl+X. Now we need to make sure our changes work, so enter the following:

testparm

Which should product the following (if you want a full output, press Enter at the prompt):

pi@Server:~ $ testparm
Load smb config files from /etc/samba/smb.conf
rlimit_max: increasing rlimit_max (1024) to minimum Windows limit (16384)
WARNING: The "syslog" option is deprecated
Processing section "[homes]"
Processing section "[printers]"
Processing section "[print$]"
Processing section "[NAS]"
Loaded services file OK.
Server role: ROLE_STANDALONE

Press enter to see a dump of your service definitions. If the line reads “Loaded services file OK.” then you’re good to go. Finally, we need to restart the SAMBA service by entering the following command:

sudo /etc/init.d/samba restart
Connect to your NAS

Now we need to connect to your NAS share and make it automatically show up in your Network drive. Open File Explorer (Win8/10 search “File Explorer” and open top result) (WinXP/Vista go to Start > Computer), then click on the Network item on left-side window pane. Click inside the address bar, then type

\\RASPINAS

(or whatever you chose for a hostname during Debian setup, if you’re unsure enter the following command hostname) and hit Enter
Enter your Raspberry Pi’s hostname

Login to your NAS

You should now see your nas folder so click it on, then enter your username pi and password you entered when we setup SAMBA:
Click on your NAS folder, then enter your credentials.

That It!

 

REFERENCE

Raspberry Pi® (2019), The Raspberry Pi is a tiny and affordable computer that you can use to learn programming through fun, practical projects, https://www.raspberrypi.org

Scroll to Top