Synology NAS Mounts (NFS vs SMB)
What this is
Reference for mounting Synology NAS storage to Docker hosts and choosing between NFS and SMB.
Why I needed this
Docker containers require reliable access to media and data stored on the NAS.
Incorrect mount configuration can cause:
-
Permission issues
-
Slow performance
-
Containers failing to access files
My Setup
-
NAS: Synology (DS223)
-
Mount point:
/mnt/sjb2 -
Used for:
-
Jellyfin media
-
Backups
-
General storage
-
NFS vs SMB (Quick Comparison)
| Feature | NFS | SMB |
|---|---|---|
| Performance | Faster | Slower |
| Linux compatibility | Native | Good |
| Permissions handling | Better (UID/GID) | Can be tricky |
| Setup complexity | Slightly harder | Easier |
Recommendation
👉 Use NFS for Docker and Linux systems
Reasons:
-
Better performance
-
Cleaner permission handling
-
More reliable for containers
NFS Setup
1. Enable NFS on Synology
-
Control Panel → File Services → NFS → Enable
2. Set Shared Folder Permissions
3. Mount on Linux Host
Install NFS tools:
sudo apt install nfs-common
Create mount point:
sudo mkdir -p /mnt/sjb2
Mount manually:
sudo mount -t nfs 192.168.86.X:/volume1/sjb2 /mnt/sjb2
4. Persistent Mount (fstab)
Edit:
sudo nano /etc/fstab
Add:
192.168.86.X:/volume1/sjb2 /mnt/sjb2 nfs defaults,_netdev 0 0
SMB Setup (Alternative)
Install tools:
sudo apt install cifs-utils
Mount manually:
sudo mount -t cifs //192.168.86.X/sjb2 /mnt/sjb2 -o username=<user>,password=<pass>
Persistent SMB Mount
sudo nano /etc/fstab
//192.168.86.X/sjb2 /mnt/sjb2 cifs username=<user>,password=<pass>,iocharset=utf8,file_mode=0775,dir_mode=0775 0 0
Permissions Notes
NFS (Recommended)
-
Uses UID/GID directly
-
Works well with Docker:
PUID=1000 PGID=1000
SMB
-
May require:
-
file_mode -
dir_mode
-
-
Permissions can appear inconsistent
Verification
Check mount:
df -h
Test write:
touch /mnt/sjb2/testfile
Common Problems / Fixes
Permission denied
-
Cause:
-
Incorrect UID/GID mapping
-
-
Fix:
-
Align container PUID/PGID with NAS permissions
-
Mount not available at boot
-
Cause:
-
Network not ready
-
-
Fix:
-
Use
_netdevin fstab
-
Slow performance (SMB)
-
Cause:
-
SMB overhead
-
-
Fix:
-
Switch to NFS
-
Container cannot see files
-
Cause:
-
Mount not ready before container start
-
-
Fix:
-
Restart container after boot
-
Result
-
Reliable NAS storage mounted to Docker host
-
Containers can access media and data correctly
-
Stable performance with NFS
Notes
-
NFS is preferred for Linux/Docker environments
-
SMB is acceptable but less ideal
-
Critical for media servers and backups
No comments to display
No comments to display