🏠💾 How to Turn a Raspberry Pi 4 into a NAS with Raspberry Pi OS & Samba
Learn how to convert a Raspberry Pi 4 into a NAS for file sharing with this Samba setup guide

Driving SD-WAN Adoption in South Africa
Search for a command to run...
Learn how to convert a Raspberry Pi 4 into a NAS for file sharing with this Samba setup guide

Driving SD-WAN Adoption in South Africa
No comments yet. Be the first to comment.
Enhancing Security and Compliance with ManageEngine ADAudit Plus

Why Pings Aren't Enough & NMS is Essential

What is SD-WAN (Software Defined Wide Area Networking)? | The Mechanics of this Groundbreaking New Network Technology

Embracing First Principles & the Scientific Method

Ever Wondered | "Is My Internet Really 99.9% Reliable?" 🤔

If you’ve got a Raspberry Pi 4 lying around, you can easily turn it into a Network-Attached Storage (NAS) device to share files across your network. This guide will show you how to set up Samba on Raspberry Pi OS to create a simple and efficient NAS solution. 🚀🔧
Raspberry Pi 4 (or newer)
Raspberry Pi OS (Bookworm recommended)
An external USB storage device (HDD or SSD)
Ethernet cable or Wi-Fi connection
SSH access or a monitor and keyboard
Before starting, update your system to the latest version:
sudo apt update && sudo apt upgrade -y
If you're using an external USB drive, check if it's recognized:
lsblk
Check if your drive appears:
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
sda 8:0 0 7.3T 0 disk
├─sda1 8:1 0 200M 0 part
└─sda2 8:2 0 7.3T 0 part /media/amastelek/G
sdb 8:16 0 1.8T 0 disk
└─sdb1 8:17 0 1.8T 0 part /media/amastelek/amastelek
mmcblk0 179:0 0 29.7G 0 disk
├─mmcblk0p1 179:1 0 512M 0 part /boot/firmware
└─mmcblk0p2 179:2 0 29.2G 0 part /
🔹 A 2 & 8 TB drives are attached and mounted!
Samba is an open-source software that allows Windows, macOS, and Linux devices to share files.
sudo apt install samba -y
Open the Samba config file:
sudo nano /etc/samba/smb.conf
Add this to the bottom:
[Pi-SMALL]
path = /media/amastelek/amastelek
writeable = yes
create mask = 0777
directory mask = 0777
public = yes
valid users = amastelek, ronald, megs, ray
guest ok = yes
force user = amastelek
[Pi-LARGE]
path = /media/amastelek/G
writeable = yes
create mask = 0777
directory mask = 0777
public = yes
valid users = amastelek, ronald, megs, ray
guest ok = yes
force user = amastelek
📌 Save and exit (CTRL+X, then Y, then Enter).
sudo systemctl restart smbd
sudo systemctl enable smbd
Open File Explorer
In the address bar, type:
\\34DiasMedia\
(Use the Pi’s IP if the hostname doesn’t work: \\<Pi-IP>\)
Open Finder
Press Cmd + K and enter:
smb://34DiasMedia
Click Connect
For private shares, create a Samba user:
sudo smbpasswd -a ronald
Then, modify your smb.conf to require authentication:
public = no
valid users = ronald
Restart Samba:
sudo systemctl restart smbd
Now, you'll need to log in with the username ronald and the password you set. 🔐
You've now turned your Raspberry Pi 4 into a fully functional NAS using Samba! Whether you're storing backups, streaming media, or just sharing files, this setup will serve you well. 📂🚀