Saturday, April 1, 2023
HomeExclusiveNetwork Attached Storage Raspberry Pi

Network Attached Storage Raspberry Pi

Connecting Samba Server On Mac Os

how to build a Raspberry Pi NAS (its AWESOME!!)

Now we will connect your Samba server on the MAC OS.

Step 1: Open Connect to Server Dialog

  • First, press Command + K to open the Connect to Server dialog where you will be able to key in the server address.

Step 2: Enter IP Address and Connect

  • Next, enter the details for your Raspberry Pis SMB share and the IP address.
  • You can do this by keying in smb://your_pi_ip_address/seeedstudioshare
  • Remember to swap out the name of the share if you changed it.
  • Once done, click connect to begin the connection to your Raspberry Pis Samba share.

Step 3: Enter Username and Password

  • Lastly, before the connection is complete, you will prompted to enter the username and password that you have set up in step 7 earlier.
  • Once done, click connect to finalise the connection.

And you are done, you have just connected your MAC OS to your Samba share!

What You Will Need To Create A Raspberry Pi Nas Server

To create a Raspberry Pi NAS, you will first need to get the necessary equipment. Of course, the minicomputer itself is the focal point: you can choose between the Raspberry Pi 2 and the newer Raspberry Pi 3, both of which have enough power to run the server.

In order to protect your privacy, the video will not load until you click on it.

In addition to a minicomputer, you also need two media storage units. These can be ordinary USB sticks, which commonly have 100 gigabytes of storage space and can be powered directly by the Raspberry Pi. More common, however, are external USB hard drives 2.5 via USB hub or 3.5 with their own power supplies. Native WD PiDrives are also recommended, as long as they are 250 gigabytes, 375 gigabytes , and 1 terabyte in size. The manufacturer also recommends a custom-fit power supply kit as an option to cover the energy demand that connected PiDrives have.

How Do You Do Build A Raspberry Pi Nas

Today, we are going to explore 2 solutions on how to build a Raspberry Pi NAS Server:

  • Building a Raspberry Pi 4 NAS with Samba
  • Building a Raspberry Pi 4 NAS with OMV

If you still want to get your hands on more storage after checking out these two solutions, keep a lookout near the end as we have a solution at the end to expand its storage capabilities!

Without further ado, let us jump right in on the first solution!

You May Like: How Much Is 1tb Of Storage

Why Nas Server On Raspberry Pi

Raspberry Pi is a mini-computer with the full performance of a Linux-based operating system and contains almost all functions of a large server system.On the other hand, the RaspPI saves a lot of money because it consumes a very small amount of energy. Due to its small size, the RaspPI can be placed on nearly any place.

This all makes the Raspberry Pi an ideal candidate for your own small NAS storage system.

Configure Nfs Automounting On The Clients

Raspberry Pi 3 Nas Geschwindigkeit

Now let’s set up automounting on the clients!The following is all done on a client, not on the Raspberry Piitself but on a client that will use the Raspberry Pi as anetwork storage appliance.

You can do this in a variety of ways.I am going to set this up so that /backup willmagically appear and be connected to the network storagewhenever anyone references that part of the file system.If the NFS volume isn’t currently mounted, there willbe no /backup.But as soon as it is referenced, the client will automaticallymount it and keep it mounted as long as it is used at leastevery so often.

To accomplish my goal, I just add one line to/etc/autofs/auto.master and then I createa small file defining that automatically mounted NFSfile system.

# tail -1 /etc/autofs/auto.master /-    auto.backup# cat /etc/autofs/auto.backup /backup    -tcp    raspberrypi:/home

Now let’s start the automounter service and seewhat we get.If it wasn’t already running, it fails to stop thenon-existent service but that’s nothing to worry about.I have already copied a hierarchy of directories and filesover to the Raspberry Pi’s disk.

The mount command can show us further details.

We could tune the automounter by setting variables in/etc/sysconfig/autofs or by specifying optionsfor individual file systems in the automount map file,but the defaults are probably fine.I specified -tcp for this mount, but that wouldnot have to be explicitly set on some clients.

You May Like: Mid Century Modern Entryway Bench With Storage

How To Transfer Files To Your Hdd

As mentioned already, well be using the rsync command to transfer files to and from the HDD. All of these commands can be run locally from your machine.

The rsync function uses the following syntax:

rsync options source destination

Skipping the options for now, heres an outline of how you would transfer a folder on your computer to the HDD mounted to the Pi.

rsync /Your/File/Path :/media/pi/HDD

Besides updating the file paths, youll need to get your Pis IP address. You can do that by running the following command on your Pi:

hostname -I

Make sure to run that command from your Pi either directly or via remote SSH.

There are a few options you should add as well to make it run faster and provide you with more useful feedback.

Keep An Exact Replica Of Your Backup Directory

If you delete a file in your backup folder on your computer, it will still be kept on your HDD. If youd like the HDD to maintain itself as an exact replica of your local directory, you can use the delete flag to have rsync delete files on the HDD that no longer exist in the local directory.

rsync -avzh --delete /Your/File/Path :/media/pi/HDD

Just be careful with this option when transferring files from the HDD as it will delete files on your computer.

You May Like: Full Service Moving And Storage

How To Build A Raspberry Pi Network

Nice. But you might want to hit on two items:

  • Once the NAS is up and running, install log2ram. This will greatly increase the lifespan of the SD card because you are reducing the number of writes.

  • The option of using a 2.5″ laptop hard drive with a SATA-to-USB connector was mentioned, but not really spelled out. A Pi3 can power one of these drives without the need for a powered USB hub.

  • So OpenMediaVault can be a service that runs on Raspberry Pi OS? I thought it was its own OS.

    I think this is exactly what I’ve been looking for, but I have a few questions that aren’t in the article. I hope it’s okay to ask them here.

    • Would this setup be good for a home streaming media server?

    I’ve got a couple of extra hard drives laying around I was thinking of building a Media NAS with, but my research has seen it mentioned that “transcoding” is important for a streaming NAS, even over an ethernet connection over Cat8.

    • If the answer to the above is no, would a Rpi Cluster make it viable with two or three boards? Can cluster even be used in this setup?

    • Is it possible to use more than one drive, in non-raid configuration with this? I’d like to have one drive for media and one for everything else.

    Mount The Storage Device

    Raspberry Pi as a NAS (Network Attached Storage)

    At this point, you can already access all of the Raspberry Pis memory with any connected device in your network.

    Now we need to mount the USB flash drive or external storage drive on the Raspberry Pi. You can add multiple storage devices to a Raspberry Pi NAS, but it is best to configure things one by one to simplify the procedure.

    First, connect your storage device to the Raspberry Pi. Then, identify the name of the storage device by entering the following command in the terminal:


    If youre connecting the first storage device, the name should be sda1. You must format your device with a Linux file system, such as ext3 or ext4. If it isnt, you can format it using the command below:

    umount /dev/sda1sudo mkfs.ext4 /dev/sda1

    Next, create a directory, change the owner, and change the read, write, and execute permissions just how we did with the Raspberry Pis main microSD card:

    sudo mkdir /home/shares/public/disk1sudo chown -R root:users /home/shares/public/disk1sudo chmod -R ug=rwx,o=rx /home/shares/public/disk1

    Finally, mount the device on the folder:

    sudo mount /dev/sda1 /home/shares/public/disk1

    You May Like: Cheap Storage Units Around Me

    How To Build A Raspberry Pi

    When organizing digital files , you use the same method as filing paper documents. With well labeled folders, you can create valuable storage structures that are useful when it comes to searching for documents later. However, the more folders there are, the more shelves you need the archive could even spill over into different rooms in a company, for example. In the case of digital documents, the folders become file folders, shelves become directories, and the archive rooms become storage media like hard disks , USB sticks, SD cards, CDs, or cloud servers.


    Register great TLDs for less than $1 for the first year.

    Why wait? Grab your favorite domain name today!

    Matching email

    During the course of digitalization, the paperless office is becoming increasingly important . It therefore makes sense to come up with practical solutions for organizing your own digital documents in good time.

    In both cases, the search effort depends primarily on how many storage locations the various documents are saved in a problem that can hardly be solved with paper documents. The digital flood of data, on the other hand, can be controlled by dedicated storage systems like file servers, storage networks or NAS systems . The latter are also becoming more and more popular in the private sector, probably because NAS servers can easily be created using a Raspberry Pi and a bit of patience.

    Change Password And Display Ip Address

    After switching to the appropriate keyboard language, it is time to assign a new root password for shell access to your Raspberry Pi NAS to prevent unauthorized users from logging in using the familiar default password. The required command is as follows:


    Enter the new password twice and confirm the entry in both cases by pressing the enter key. If the change was successful, the command line displays the message .

    Use the command iconfig to start the command line program of the same name, which provides you with all important network information. The IP address listed under eth0 is particularly important to further configure your Raspberry Pi NAS server. This is the address assigned by your router to the NAS server.

    Recommended Reading: Share Google Storage With Family

    Remote Access: Cli And Gui Using Dataplicity And Porthole

    Dataplicity have a solid platform for remote access to a Raspberry Pi, outside your home network, giving you access via CLI or GUI, as if you were in front of a keyboard/monitor. Via a web browser you can port via their website to the CLI of the Raspberry Pi.

    If youre needing GUI access it can be done via VNC using the Dataplicity Porthole method and VNC Viewer.

    Security is important here and a key point to remember when it comes to the scope of your NAS/home security.

    Raspberry Pi As Network Attached Storage

    How to Create a Network

    Content on this page is intended to compliment the article series published The Shed magazine , as a way of delivering more in-depth detail and update changes to install and configuration of software used/described.

    The article also mentions the Ykush USB2.0 software switchable hub which I can supply for NZ$50 . The board can also be purchased via other online vendors including the more up-to-date USB3.0 version. Leave your details in the form below to place an order.

    One of the steps in the article mentions mounting the storage drive. If you are using an SSD device it will need to be formatted prior to mounting. Full instructions on that are contained in this article starting at: SSD as additional disk drive.

    The steps describe installing the Gparted software that allows the partitioning and setup of the storage drive. It is easiest done via the GUI interface.

    The next step is to map a folder/directory on the Raspberry Pi to the SSD drive .

    Easiest method is to create a folder on the root of the RPi and adding a script line that is run at boot to mount that folder name to the SSD drive.

    An example is to create a folder nas. While mentioned it could be created from the root , it can be anywhere. You just need to remember where it is so you can include the directory path in the script.

    Read Also: Extra Space Storage Lake Worth

    Omv Installation And Configuration

    The third stage is for installing and configuring the key software package of the NAS system – PMV. The goal is to bring up the basic network file access service. Before restarting the NAS, we plugged a Seagate 2TB external HDD into the remaining USB 3.0 port. After booting, connected SSH to NASPi from macOS and performed the following process.

    Install OMV Package

    Installing OMV is as simple as running the following command line directly from a terminal with an SSH connection.

    wget -O - | sudo bash

    Due to the large size of the entire OMV package, this installation process can take a long time. After the installation, the IP address of the system may change and you will need to reconnect to SSH at this time.


    OMV Management UI

    Configure File Services

    Next is the key process for configuring the NAS, which consists of the following 5 steps.

  • Scan for mounted disk drives

    Click Storage > Disks from the sidebar menu to enter the hard drive management page. If there is an external USB storage device just plugged in, you can click here to scan it out. The scan results for this system are as follows. The internal Samsung 500GB SSD and external Seagate 2TB HDD are detected, and the 32GB microSD that contains the entire software system is listed at the top:

    On the SSH terminal, we could see the information for the same set of mounted drivers

  • Set Up Client Device

  • MacBook client
  • Accessing Files From The Desktop

    The easiest way to see what files and folders are being shared on your network is to use the File Manager. Boot your Raspberry Pi into Desktop mode and open the File Manager from the Menu, under Accessories:

    This will open the File Manager:

    To find out whether there are any servers sharing folders over your network, use the Go -> Network menu option:

    This will show you what is being shared:

    I have a few NAS drives as well as PCs and Macs sharing over my network, as you can see above. .

    Open any of the server shares you see on the list to see whether they are sharing anything. Unless you have allowed ‘guest’ access on any of your shared folders, you are likely to be asked for a username and password:

    You may need to access your NAS via its control panel itself and add more accounts so that your Raspberry Pi can access its stored files. I find that for non-sensitive files, like music, videos and photographs, a read-only account can be useful to allow any number of computers on your home network to access those files. Your NAS may allow ‘guest’ accounts, which means that you do not need to specify a username and password to access the files. Of course, for sensitive files you should always password protect folders and files appropriately.

    If you have write permissions to network drives, you should now be able to copy and create drives over the network and store them away from your Raspberry Pi. This is an excellent way to backup your project files from your Raspberry Pi.

    Also Check: Storage Units In Bluffton Sc

    Raspberry Pi 25 Gbps 16 Tb Omv Nas

    Last week, I posted about the Pi NAS hardware build, and compared setting up an off-the-shelf ASUSTOR Lockerstor 4 to the same thing, but with a Raspberry Pi Compute Module 4 an IO Board.

    Some people wondered why not just use a Raspberry Pi 4 model B with USB hard drives, and there are a few reasons:

  • The model B’s USB 3.0 ports add about a 10% overhead to SATA operations, which is more apparent over small file operations.
  • You can’t RAID together USB 3.0 drives using OMV or other NAS-specific software, since RAID over USB is not very reliable.
  • The Compute Module 4 IO Board’s PCI Express slot lets me plug in multiple cards, like a 2.5 Gbps Rosewill NICand a 5-port IOCrest SATA controller.
  • Accessing Nas Server From Windows

    Raspberry Pi: File Server (NAS Network Attached Storage) setup

    Accessing NAS server from windows is easy. All you need is to:

    • go to network in file explorer
    • you will see that RASPBERRYPI device appeared
    • double click on folder
    • log in with pi user.

    This is it, you can create, download, upload and delete files on Raspberry Pi Network attached storage.

    Lets do some initial transfer speed tests. Raspberry Pi is connected via WiFi to network:

    As you can see download and upload speeds are about 2.7MB/s.

    Lets do same test with LAN connection

    As you can see with LAN connection, file upload and download speed is up to 10MB/s. I think this is not too bad for basic usage.

    Final advice. If you do not own spare Raspberry Pi, dont waste money on building NAS better get specialized hardware which is cheaper and is faster option. In other hand if you are looking for flexibility and low power option, Raspberry Pi based NAS could be great option especially if you have spare board laying around. If you need more storage than USB stick, get portable HDD. Just be sure to match power supply, as USB port can be too weak to supply enough current.

    Don’t Miss: Storage Units Ft Myers Fl


    Most Popular