Finished configure NFS on ubuntu and proxmox

master
Jason Zhu 2020-07-08 12:21:10 +10:00
parent 9ce994967d
commit 4529dce3c2
1 changed files with 39 additions and 8 deletions

View File

@ -2,13 +2,17 @@
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
## How to config Synology for NFS ## 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)](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)
### Summary of how to configure NFS server ### 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: Configuring an NFS server is just placing a line in `/etc/exports` file. The line's general syntax is:
@ -39,21 +43,48 @@ 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"
### Summary of how to configure client ### 0.2 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
``` ```
## Current solution ## 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), and kerberos authentication is too hard to setup. The only solution is NFS+`chown` 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.
1. Setup NFS permission of shared folder on Synology This [youtube video](https://www.youtube.com/watch?v=mroM6_koNdw) is the best explanation for me.
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. When writing files, remember to chown afterward 3. After writing files, remember to chown afterward
For plex server:
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
```
For plex server, I need to align LXC's uid and gid with Synology
## Reference ## Reference