DISCOVER
X

Raspberry Pi External Storage Part 2 – Step by Step Samba Sharing

November 3, 2013 6:56 pm Leave your thoughts
FacebooktwitterredditpinterestlinkedinmailFacebooktwitterredditpinterestlinkedinmail

photo-29-10-13-22-05-46-0Continuing from part 1 where we setup permanent mount for external hard drive, we will not setup the simplest mode of network file sharing, Samba. I decided to use Samba as I mostly do casual multimedia file sharing within my home network across multiple computers running different OS.

If I want to sync all the files of course I will use OwnCloud, but for network sharing we’ll use Samba, especially any Windows machine should be able to recognise the shared drive pretty easily. Like the previous article, I decided to write this because I wished that there were some kind of comprehensive article explaining this step-by-step for beginner. I also hoped that there are ways to configure Samba without touching the configuration files at all. A couple of Google search here and there would do it of course, however all in one tutorial is what I want to achieve here.

Note that even though I’m targeting Raspberry Pi machines running Raspbian, I’m quite sure these instructions are still valid for other Linux flavours.

Firstly, startx if you haven’t done so.

Install Samba

So firstly, we need to install Samba on our Raspberry Pi machine. Do this within the terminal.

photo-22-10-13-01-17-17-5photo-22-10-13-01-17-17-6

Then let it install all the packages. So far it’s quite simple.

Then lastly start your samba server.

Add Your User to Use Samba

Now that we have installed the samba server, we need to add our user so that we start sharing our files.

So enter the command below and set your password.

Install the Samba Administration Tools

As usual, I like simplicity and graphical tools. Sure we can always configure Samba via the configuration file, but if we can do it graphically why not. I also don’t want to have to open the configuration file every time I add another share folder.

photo-22-10-13-01-17-17-9

Enter the following command in your terminal:

Then let it install the required packages.

Configure Samba Shared Folders

When the installation process has been completed, start the graphical administration program using the below command.

Don’t forget the sudo as we need administration rights for this application.

When the application open you will be greeted with the almost overwhelming configuration panel. The first tab you’ll see is the server settings, for my part there is almost nothing to change as my network settings were detected properly.

The only settings that I had to change was the servers host name, I set the hostname to piserver so it’s easier to identify on my network later on.

photo-22-10-13-01-17-18-10Switch to the Shares tab, as we are interested on adding new folders to share. The first thing you’ll see is the Home directory sharing. For the purpose of this tutorial we will ignore this and create a new share. The settings explained for the new shares can be used to setup the home directory sharing should you wished to.

Then click on New Shares so we can begin to setup our first share rule.

New Share Directory

After clicking on new shares you will be presented with an empty form, fill the information in accordingly based on the folder that you want to setup. See the below example for my configuration.

photo-22-10-13-01-17-18-12

 

I call the folder name Misc Shares. this is the name that will appear on other computers when browsing for shared folders from the Raspberry Pi. As seen on the picture above I have also setup the directory in my external hard drive to be shared in the network. Don’t forget to check part 1 for the complete guide to setup the hard drive.

When you have done setting up the directory, click on + Add to save the configuration. You should now see the Misc Shares sharing configuration in the shares listing. Scroll down the list if you don’t see it.

Setup the Share Permissions

Now that we have added a new directory, we will setup the share permission.

Select the Misc Share configuration from the list to load the configuration.

Then scroll down and click on Add access permissions.

Choose the following options:

  • Add users or groups from: Local computer
  • Add users or groups: Users
  • Permissions: Access allowed, write access (if you want to be able to save files into the directory later on)

Click on forward.

Choose the pi user.

Click on import user.

The above steps should be sufficient to add your current user into the configuration edit for now.

Then scroll down the page further to see more options for the folder. For my sharing purpose here are the items that I set to yes:

  • Available
  • Browsable
  • Writeable

When done with all configurations, scroll up and press apply.

You have now setup your first shared folder.

Restart the Samba Server

Go back to one of your terminals and restart the samba server.

Discovery

On a Windows machine, you simply go to the Network browser and double-click on the PISERVER location. Use the samba password that you previously setup to login into the server.

photo-22-10-13-01-17-18-16

If you want to make things easier you can also mount the shared folder into a drive letter in Windows.

On an OSX, you can do reach the server from the finder’s go->connect to server functionality.

Then enter the Raspberry Pi’s IP in your network manually.

photo-22-10-13-01-17-18-22

photo-22-10-13-01-17-18-23

 

From there simply enter your login credentials and you’ll be able to load the shared data straight away.

Closing

So this concludes the 2 part series on step by step Raspberry Pi external storage and file sharing tutorial. Hopefully this helps a lot of people and saved their time in researching how to do this. It’s been working very well so far on my local network and very handy for sharing my media files. Have fun!

FacebooktwitterredditpinterestlinkedinmailFacebooktwitterredditpinterestlinkedinmail
Tags: ,

Categorised in: