Raspberry Pi Samba Local File Server

by Abhishek Bestha in Circuits > Raspberry Pi

417 Views, 4 Favorites, 0 Comments

Raspberry Pi Samba Local File Server

C3C2BE4C-28E1-4B3D-BF07-3E4E1004B006.jpeg
E8F47BCF-BE81-4D0E-AF93-9FB8DFBE1F8E.jpeg
Step by step procedure for installing local file server

Requirements

- Raspberry pi
- 8GB SD card
- hard disk
Optional
- monitor
- keyboard
- mouse

Installing Raspberry Pi OS

8AF1D326-DAE4-4A8E-8BDD-7B5205143D97.jpeg
581B0A7F-56E9-4734-A683-C3FD515A78EA.png
1. Download Raspberry pi OS from Raspberry official website

2. Download balena etcher from below link
- https://www.balena.io/etcher/

3. Next insert an 8GB memory card to your PC or laptop

4. Just your inserted SD card and choose OS
Click on FLASH

Connecting Raspberry Pi Through Ssh

5D08FC9A-5A6D-4F83-9011-CED3350F8535.jpeg
- Once flash is completed, open memory card and and create an empty notepad
- Name it as “ssh” remove extensions.

After this insert SD card to raspberry pi and wait for sometime to boot up.
- Open terminal from your PC or laptop
- Type “ ssh pi@IPADDRESS OF YOUR PI ”

Note:
If now you have monitor directly connect to monitor no need of ssh.

Follow Terminal Commands

Open terminal and follow below commands

sudo update && sudo upgrade

INSTALL SAMBA
sudo apt-get install samba samba-common-bin

NTFS
Sudo apt-get install ntfs-3g

TO SEE ALL CONNECTED DRIVES MOUNTED OR NOT
Sudo lsblk

FIND DRIVE UUID
Sudo blkid

DRIVE SETUP IF NOT MOUNTED
sudo nano -Bw /etc/fstab

Hard Drive mount
UUID=0000000000000000 /mnt/USB1 auto defaults,user,nofail 0 2
UUID=0000000000000000 /mnt/USB2 auto defaults,user,nofail 0 2

Note: copy and paste UUID number from blkid

SAMBA SETUP
sudo nano /etc/samba/smb.conf

[Movies] //This is the folderswhichwecan share
comment = Movies
public = yes
writeable = yes
browsable = yes
path = /mnt/USB1/Movies
create mask = 0777
directory mask = 0777
guest ok = yes
only guest = no

[TV]
comment = TV
public = yes
writeable = yes
browsable = yes
path = /mnt/USB2/TV
create mask = 0777
directory mask = 0777
guest ok = yes
only guest = no

RESTART SAMBA SERVICES
sudo service smbd restart

Accessing the Server Files

A3AD7ADB-19E7-442C-9051-6ADD71A227C3.jpeg
AA8D881E-70C4-422A-8603-08D9C4734EC4.jpeg
813A6EEF-D954-43CD-A677-D9F83E8C926D.jpeg
18A4EC15-D4CB-424F-B163-6F0BD556D3B2.jpeg
In Mac
- Go ➡️ Connect to server ➡️ Type IP address of your pi

In windows
- This PC ➡️ Networks