# Packages - `nfs-utils` (Arch) - `nfs-kernel-server` (Ubuntu) # Server - Create root just for NFS: `/src/nfs` - Bind locations: `mount --bind /mnt/src /src/nfs/dest`\ fstab: `/mnt/src /srv/nfs/dest none bind 0 0` ## Arch ### `/etc/exports` | Option | Description | |:------------------|:-------------------------------------------------------------------------------------------------| | `ro` / `rw` | Clients read only / read-write access | | `sync` / | Server replies after changes by previous request are written to disk | | `async` | Server does not have to wait | | `wdelay` / | Server delays committing write requests when it suspects another write request is imminent. | | `no_wdelay` | Disable the delay. Can only be enabled if `sync` is enabled | | `no_all_squash` / | Does not change the mapping of remote users | | `all_squash` | Squash all remote users including root | | `root_squash` / | Prevent root users connected remotely from having root access (squashing remote root privileges) | | `no_root_squash` | Disable root squashing | | Command | Description | |:----------------|:--------------| | `exportfs -v` | View exports | | `exportfs -arv` | Re-export | ### `/etc/nfs.conf` - Restrict share to interface ``` [nfsd] host= ``` ## Ubuntu ### `/etc/default/nfs-kernel-server` - Disable NFSv3: `RPCMOUNTDOPTS="--manage-gids --no-nfs-version 3"` ### Restarting ```sh sudo systemctl restart nfs-config sudo systemctl restart nfs-kernel-server ``` ## Performance ### `rsize`/`wsize` - Check: `cat /proc/fs/nfsd/max_block_size` `/etc/tmpfiles.d/nfsd-block-size.conf`: ``` w /proc/fs/nfsd/max_block_size - - - - 32768 ``` # Client - `showmount -e ` ## Mount ```sh :/path /path nfs