accumulated collection of notes about my server shenanigans
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

add nfs info

nnuuvv e6591ce3 e94cef2d

+54
+54
nfs.md
··· 1 + ### Setting up NFS 2 + 3 + #### Server 4 + 5 + install the server package: 6 + ```sh 7 + apt install nfs-kernel-server 8 + ``` 9 + 10 + add shares to /etc/exports; for example: 11 + ``` 12 + <local-path> <remote-ip-(range)/CIDR>(rw,sync,no_subtree_check) 13 + ``` 14 + 15 + if the remote user has a different userid you can use nfsidmap; 16 + or use the simple approach of mapping all users to a specific uid on the server. 17 + 18 + by adding `all_squash,anonuid=<uid-of-choice>` like this: 19 + 20 + ``` 21 + <local-path> <remote-ip-(range)/CIDR>(rw,sync,no_subtree_check,all_squash,anonuid=<uid-of-choice>) 22 + ``` 23 + 24 + you can then export your exports using 25 + ```sh 26 + exportfs -arv 27 + ``` 28 + -a -> all 29 + -r -> reexport 30 + -v -> list exported shares 31 + 32 + 33 + #### Client 34 + 35 + install the client package: 36 + ```sh 37 + apt install nfs-common 38 + ``` 39 + 40 + mount your nfs share using: 41 + ```sh 42 + mount -t nfs4 <nfs-server-ip/hostname>:<share-path> <local-path> 43 + ``` 44 + 45 + assuming that worked; add it to /etc/fstab so it gets mounted at boot 46 + ``` 47 + <nfs-server-ip/hostname>:<share-path> <local-path> nfs4 defaults,user,exec 0 0 48 + ``` 49 + 50 + if you arnt certain the share will always be available; add `noauto` 51 + ``` 52 + <nfs-server-ip/hostname>:<share-path> <local-path> nfs4 defaults,user,exec,noauto 0 0 53 + ``` 54 + and then use `mount -a` to mount it