3.6 KiB
synology-nfs-mount-tools
This is a repo that contains tools/documentations to help nfs mounting configuration in Synology
Note
Due to issue from idmapping, NFS customization on Synology is given up. I will directly use Synology's official NAS setting in WebGUI. And set all visitor either as admin or guest
0. Knowledge Center: How to config NFS server and client
Synology's DSM WebGUI has capability to set NFS configuration to allow Linux to access files on Synology NAS, follow tutorial: How to access files on Synology NAS within the local network (NFS)
But the GUI's feature is limited. We need more fine tuning. Following NFS: Overview and Gotchas, we can set Synology properly. (If the URL is broken, we can refer to [NFS: Overview and Gotchas in repo](/source/NFS_Overview/NFS\ Overview\ and\ Gotchas.htm)
0.1 Summary of how to configure NFS server
Configuring an NFS server is just placing a line in /etc/exports
file. The line's general syntax is:
directory_being_shared subnet_allowed_to_access(options)
There are 2 kinds of options:
- General options (ignored here)
- User ID Mapping options (need to be mentioned here)
We want to make directories accessible as if the incoming request was from that user or that group, which is done by combining all_squash
option with anonuid
and anongid
options.
e.g.
/volume1/homes 192.168.1.85(rw,sync,no_wdelay,crossmnt,all_squash,insecure_locks,sec=sys,anonuid=1025,anongid=100)
where:
/volume1/homes
is the directory to be shared192.168.1.85
is the ip address of clientrw
is Read/Writeasync
is for fast access.sync
is for safer accessno_wdelay
is "Write disk as soon as possible"anonuid=1025
is uid of "guest"anongid=100
is gid of "guest/user"
0.2 Summary of how to configure client
mount -t nfs -o rw 192.168.100.85:/data/altamonte /mnt/test
1. Current solution for mapping Synology NFS to Ubuntu (desktop or laptop)
Due to limitation of NFS4.0, idmapping is too hard (mismatch between server and client's uid/gid) to configure at server side, and kerberos authentication is too hard to setup.
This youtube video is the best explanation for me.
The only solution for ubuntu (Desktop or Laptop) is NFS+chown
- Follow Synology official guide + youtube to set NFS permission
- mount volume to client
- After writing files, remember to chown afterward
For plex server:
- Follow Synology official guide + youtube to set NFS permission
- add ip address of Proxmox only, no need to add ip address of the LXC within it)
- Choose squash as "map all user to admin"
- Mount NFS to Proxmox by go to Datacenter->Storage->Add->NFS, choose different content types.
- Modify LXC config file after creation of LXC to add mounting point
- Following Bind Mount Points to setup bind mount point in config file (in
/etc/pve/lxc
)
- Following Bind Mount Points to setup bind mount point in config file (in
e.g. 102.conf
arch: amd64
cores: 2
hostname: plexserver
memory: 1024
mp0: /mnt/pve/NAS_media,mp=/mnt/nas_media
net0: name=eth0,bridge=vmbr0,firewall=1,hwaddr=F6:7A:13:86:C5:FD,ip=dhcp,ip6=dhcp,type=veth
ostype: ubuntu
rootfs: local-lvm:vm-102-disk-0,size=8G
swap: 512
unprivileged: 1