Jason Zhu 89745398a7 | ||
---|---|---|
sources/NFS_Overview | ||
video | ||
.gitattributes | ||
README.md |
README.md
synology-nfs-mount-tools
This is a repo that contains tools/documentations to help nfs mounting configuration in Synology
Log
2020-07-08
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
2020-07-09
Used one day trying to solve the problem that I cannot write to /volume1/homes/Jason
, found the problem is from my side. When I created /mnt/synology_homes_Jason
, I didn't make it chmod 777
. BAGA!
Anyway, Applying Default UNIX Permissions and How to manage ACL settings on your Synology NAS are good references
2020-07-10
Reason of failure to write to /homes/Jason
:
- Didn't give NFS R/W access to
/homes/Jason
in Synology WebGUI, it can be easily solved. - (Just discovered) Permission of
homes/Jason
, as I frequently ssh to my account, my/homes/Jason
is set at 755 (drwxr-xr-x), which forbidden writing to this directory using non-Jason account. If I gave access for admin to write to my home directory, I cannot ssh in. So ssh and nfs to my homedirectory is not compatible.
Solution: Create a nfs
shared folder in Synology to be mounted on my ubuntu
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
2. Current solution for mapping Synology NFS to Proxmox
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
Reference
- NFS: Overview and Gotchas
- How to setup NFS server and client
- Applying Default UNIX Permissions
- How to manage ACL settings on your Synology NAS
file video/proxmox_add_nfs.webm
is downloaded from proxmox 添加 nfs 存储 完美解决 空间不足 虚拟机 备份 容灾 proxmox add nfs