Create Samba Share on Raspberry Pi
Install the samba software

sudo apt-get install samba samba-common-bin -y
Make sure your user is the owner of the path you are trying to share via Samba

sudo chown -R pi:pi /path/to/share
Take a copy of the original samba share file

sudo cp /etc/samba/smb.conf /etc/samba/smb.bak
Edit the samba configuration file

sudo nano /etc/samba/smb.conf
Leave workgroup as WORKGROUP

Uncomment WINS support, change this line, it should enable the NETBIOS name RASPBERRYPI on your network

#   wins support = no
to

wins support = yes
I am going to add my TV show folder in /mnt/usbstorage/TV

Now you need to go to the bottom of the file, use Ctrl+V to skip down to the bottom quickly

Paste this code, you may have to uncomment force user = root by deleting the # if you can’t access the share, it may also be necessary to enable write access to the share from remote machines

If you don’t want to be able to delete files you can delete the read only = no line

[TV] #This is the name of the share it will show up as when you browse
comment = TV Folder
path = /mnt/usbstorage/TV
create mask = 0775
directory mask = 0775
read only = no
browseable = yes
public = yes
force user = pi
#force user = root
only guest = no
Assuming the hostname of your pi is RaspberryPI, the path of this share is now \\RASPBERRYPI\TV or \\RASPBERRYPI.IP\TV

Ctrl+X, Y and Enter to save and exit nano

Set a samba password for pi

sudo smbpasswd -a pi
Restart the samba server¨

sudo service samba restart
If you are on Jessie you may see this error, it is because of systemd. With init.d on previous debian releases samba restarted both smbd and nmbd, now it doesn’t.

samba.service

   Loaded: masked (/dev/null)

   Active: inactive (dead)
You need to restart these services separately instead

sudo service smbd restart
sudo service nmbd restart
Now try to access the samba share, if all is well, repeat the process by editing smb.conf again and adding additional shares.