Raspberry Pi Experiments — Setting Samba Network File Sharing

DailyPriyab
DYI Electronics & Tech Reviews
2 min readMay 15, 2017

Note: This is my blog from last year which I am copying from my Blogger page and mostly trying to follow the instructions to reset my Samba server again.

First of all Happy New Year to all. In this new post I will be focusing on how to convert Raspberry Pi to a network file server.

For this I used the instructions from http://raspberrywebserver.com/serveradmin/share-your-raspberry-pis-files-and-folders-across-a-network.html and I am happy it worked.

In my previous post http://priyabgeek.blogspot.in/2016/12/raspberry-pi-experiments-file-server.html I had talked about attaching my Hard disk to raspberry pi and accessing files via a web server. While discussing this over Facebook I got a comment to use samba as a file server. Though I knew about it but was not sure how easy it is to set up.

So here are the steps I followed to setup samba in my Raspberry Pi 3. 1. Download the samba binaries

sudo apt-get install samba samba-common-bin

In case you face issues please type sudo apt-get update and do the above step again for the installation to take place. 2. Take backup of /etc/samba/smb.conf

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

3. Edit /etc/samba/smb.conf to make the necessary changes for network sharing

sudo vi /etc/samba/smb.conf

4. Please find the below options and make the necessary changes:

# Change this to the workgroup/NT-domain name your Samba server will part of workgroup = WORKGROUP # Windows Internet Name Serving Support Section: # WINS Support — Tells the NMBD component of Samba to enable its WINS Server # wins support = no

wins support = yes

5. Also add the path that you want to share. In my case I wanted to share my mounted External hard drive. I added this part to the end of the file /etc/samba/smb.conf

[filedrive] comment= FileDrive path=/mnt/usbdrive browseable=Yes writeable=Yes only guest=no create mask=0777 directory mask=0777

public=no

6. Mounting the hard disk

sudo mount /dev/sda1 /mnt/usbdrive/

7. Set up a samba password for pi user

sudo smbpasswd -a pi

8. Finally access the samba server from windows.

Hope this short post is helpful to you as it was to me.

Originally published at priyabgeek.blogspot.com.

--

--

DYI Electronics & Tech Reviews
DYI Electronics & Tech Reviews

Published in DYI Electronics & Tech Reviews

Online Magazine for DIY Electornics Hacks & Tech Reviews

DailyPriyab
DailyPriyab

Written by DailyPriyab

Data Engineering | Data Governance | Azure | Spark | Python | Manager