diff --git a/nfs.md b/nfs.md new file mode 100644 index 0000000..f8df6cb --- /dev/null +++ b/nfs.md @@ -0,0 +1,54 @@ +### Setting up NFS + +#### Server + +install the server package: +```sh +apt install nfs-kernel-server +``` + +add shares to /etc/exports; for example: +``` + (rw,sync,no_subtree_check) +``` + +if the remote user has a different userid you can use nfsidmap; +or use the simple approach of mapping all users to a specific uid on the server. + +by adding `all_squash,anonuid=` like this: + +``` + (rw,sync,no_subtree_check,all_squash,anonuid=) +``` + +you can then export your exports using +```sh +exportfs -arv +``` +-a -> all +-r -> reexport +-v -> list exported shares + + +#### Client + +install the client package: +```sh +apt install nfs-common +``` + +mount your nfs share using: +```sh +mount -t nfs4 : +``` + +assuming that worked; add it to /etc/fstab so it gets mounted at boot +``` +: nfs4 defaults,user,exec 0 0 +``` + +if you arnt certain the share will always be available; add `noauto` +``` +: nfs4 defaults,user,exec,noauto 0 0 +``` +and then use `mount -a` to mount it