Compare commits

..

No commits in common. "4529dce3c29557c663a162da8c945fc3275801f0" and "cfde3c6592848621d5d6dca1aef124ddef9ae6bd" have entirely different histories.

1 changed files with 8 additions and 44 deletions

View File

@ -2,17 +2,13 @@
This is a repo that contains tools/documentations to help nfs mounting configuration in Synology This is a repo that contains tools/documentations to help nfs mounting configuration in Synology
## Note ## How to config Synology for NFS
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)](https://www.synology.com/en-us/knowledgebase/DSM/tutorial/File_Sharing/How_to_access_files_on_Synology_NAS_within_the_local_network_NFS) 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)](https://www.synology.com/en-us/knowledgebase/DSM/tutorial/File_Sharing/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](http://www.troubleshooters.com/linux/nfs.htm), 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) But the GUI's feature is limited. We need more fine tuning. Following [NFS: Overview and Gotchas](http://www.troubleshooters.com/linux/nfs.htm), 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 ### 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: Configuring an NFS server is just placing a line in `/etc/exports` file. The line's general syntax is:
@ -43,50 +39,18 @@ where:
* `anonuid=1025` is uid of "guest" * `anonuid=1025` is uid of "guest"
* `anongid=100` is gid of "guest/user" * `anongid=100` is gid of "guest/user"
### 0.2 Summary of how to configure client ### Summary of how to configure client
``` ```
mount -t nfs -o rw 192.168.100.85:/data/altamonte /mnt/test 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) ## Current solution
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. Due to limitation of NFS4.0, idmapping is too hard (mismatch between server and client's uid/gid), and kerberos authentication is too hard to setup. The only solution is NFS+`chown`
This [youtube video](https://www.youtube.com/watch?v=mroM6_koNdw) is the best explanation for me. 1. Setup NFS permission of shared folder on Synology
The only solution for ubuntu (Desktop or Laptop) is NFS+`chown`
1. Follow Synology official guide + youtube to set NFS permission
2. mount volume to client 2. mount volume to client
3. After writing files, remember to chown afterward 3. When writing files, remember to chown afterward
For plex server: For plex server, I need to align LXC's uid and gid with Synology
1. Follow Synology official guide + youtube to set NFS permission
1. add ip address of Proxmox only, no need to add ip address of the LXC within it)
2. Choose squash as "map all user to admin"
2. Mount NFS to Proxmox by go to Datacenter->Storage->Add->NFS, choose different content types.
3. Modify LXC config file after creation of LXC to add mounting point
1. Following [Bind Mount Points](https://pve.proxmox.com/wiki/Linux_Container#_bind_mount_points) to setup bind mount point in config file (in `/etc/pve/lxc`)
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](http://www.troubleshooters.com/linux/nfs.htm)
* [How to setup NFS server and client](https://codeyarns.com/2013/03/17/how-to-setup-nfs-server-and-client/)