Setting up a NAS with Raspberry Pi
Table of Contents
📝 From my notes: living personal cheatsheets.
1. Install Samba
2. Mount Storage Drive
3. Configure Automatic Mounting
Edit the fstab file:
Add this line:
WARNING
Replace the uid
and gid
with your user’s. You can find these values by running id -u
and id -g
.
/dev/sda2 /mnt/nas exfat defaults,auto,nofail,umask=000,dmask=000,fmask=000,uid=1000,gid=1000 0 0
Apply changes:
4. Configure Samba
Edit Samba configuration:
Add this section:
TIP
Replace your_username
with your actual Raspberry Pi username in the following configuration.
[NAS]
/mnt/nas
yes
= 0777
mask = 0777
mask = your_username
user = your_username
group no
DANGER
These permissions (0777) grant full access to all users. Consider reading about Linux file permissions.
5. Create Samba User
6. Restart Services and Configure Firewall
7. Connect from macOS
- In Finder, select Go > Connect to Server
- Enter:
smb://your_pi_ip/NAS
- Enter your Samba credentials
8. Optional: Add to Finder Sidebar
Drag the mounted NAS icon to your Finder sidebar for quick access