How to Create a Network-Attached Storage Server with Raspberry Pi 3

Introduction

 
This article demonstrates how to create your own network-attached storage with Raspberry Pi. We also discuss NAS for your home, to access the data across multiple computers wirelessly like Mac Book, Android Mobiles and also Windows.
 

About NAS

  • Network-attached storage removes the responsibility of file serving from other servers on the network
  • This NAS server offers quite a considerable amount of business agility, cost improvements and service efficiencies to commercial organizations.
  • Free from capital expenditure(i.e)There are no huge costs for hardware in our cloud technology.
  • The Internet of Things (IoT) enhances a new class of applications to this server architecture that can benefit from the normal server infrastructure. 
  • NAS uses the SMB Server
If you have a lot of devices that are connected to the same network, then you need to get ready to transfer the data from one device to another device wirelessly. If using an Android device and you need to copy the whole backup to the server, you must automatically ensure that all connected devices are directly accessed from the server data. 
 
How To Create Network Attached Storge Server With Raspberry Pi 3 
 
Step 1
 
First, the Raspberry Pi must be connected to your desktop. Then, connect your wi-fi on your Pi or connect your ethernet. After that, open the terminal of your Operating System using the following code.
  1. hostname -I  
Next, open PuTTY or VNC software and paste the Host Name (or IP Address) on this PuTTY.
 
How To Create Network Attached Storge Server With Raspberry Pi 3 
 
After that, open the terminal box and enter your default PI name and password.
 
Username (pi)
Password (raspberry)
 
Step 2
 
Next, we need to update the Raspberry Pi. So, install the latest packages. You can do that using the following commands.
  1. sudo apt-get update  
  2. sudo apt-get upgrade  
or
  1. sudo apt-get update && upgrade   
Step 3
 
Next, we will need to install the samba server. Just use the following commands.
  1. sudo apt-get install samba samba-common-bin  
 How To Create Network Attached Storge Server With Raspberry Pi 3
 
About Samba Server
  • Samba is a free software re-implementation of the SMB networking protocol.
  • Samba is the standard Windows interoperability suite of programs for Linux and Unix. 
  • Samba provides file and print services for various Microsoft Windows clients and can integrate with a Microsoft Windows Server domain. 
Install the New Technology File System (NTFS) Package.
  • The NT file system (NTFS) provides a combination of performance, reliability, and compatibility developed by Microsoft. 
  1. sudo apt-get install ntfs-3g   
How To Create Network Attached Storge Server With Raspberry Pi 3 
 
Step 4
 
Create a new directory in the root 
  1. sudo mkdir /Ecternal
HDD connected to the Raspberry Pi through the USB.
 
How To Create Network Attached Storge Server With Raspberry Pi 3 
 
Now type the command lsblk, then list out all of the connected devices through the USB.
  1. lsblk  
How To Create Network Attached Storge Server With Raspberry Pi 3
 
In this case, I have connected the external hard drive showing as the -sda1 but it is not mounted to any directory, so type the following command:
  1. sudo mount /dev/-sda1  /External/  
Finally, configure the samba file.
  1. sudo nano /etc/samba/smb.conf  
Add these lines at the bottom of the smb.conf file 
  1. [RaspberryPi NAS]  
  2. comment = Pi Server  
  3. public = yes  
  4. writeable = yes  
  5. browsable = yes  
  6. path = /External  
  7. create mask = 0777  
  8. directory mask = 0777  
How To Create Network Attached Storge Server With Raspberry Pi 3
 
Step 4
 
Next, restart the samba server following the given command line.
  1. sudo /etc/init.d/samba restart  
Mobile Output
 
Go to a local network directory and found the Raspberry Pi NAS hard drive.
 
How To Create Network Attached Storge Server With Raspberry Pi 3
 
Windows Output
 
On a Windows computer, open file explorer >> click on a network. It will take a few mins, then you can see Raspberry Pi.
 
How To Create Network Attached Storge Server With Raspberry Pi 3
 
Finally, you have built your own cloud server using Raspberry Pi.
 

Summary

 
In this article, you learned how to create own network-attached storage with Raspberry Pi.
 
If you have any questions/ feedback/ issues, please write in the comment box.