> For the complete documentation index, see [llms.txt](https://strangebutohwell.gitbook.io/knowledge/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://strangebutohwell.gitbook.io/knowledge/linux/file-system/file-sharing/nfs.md).

# NFS

## Commands

| Command          | Option | Description                                                                                                                                                                                                                                              |
| ---------------- | ------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `nfsstat`        |        | list NFS statistics                                                                                                                                                                                                                                      |
|                  | `-m`   | Print information about each of the mounted NFS file systems.                                                                                                                                                                                            |
| `exportfs`       |        | maintain table of exported NFS file systems                                                                                                                                                                                                              |
|                  | `-s`   | Display the current export list suitable for /etc/exports                                                                                                                                                                                                |
|                  | `-a`   | Export or unexport all directories.                                                                                                                                                                                                                      |
|                  | `-r`   | Reexport all directories, synchronizing /var/lib/nfs/etab with /etc/exports. This option removes entries in /var/lib/nfs/etab which have been deleted from /etc/exports, and removes any entries from the kernel export table which are no longer valid. |
|                  | `-u`   | Unexport one or more directories.                                                                                                                                                                                                                        |
| `Showmount <ip>` |        | show mount information for an NFS server                                                                                                                                                                                                                 |
|                  | `-e`   | Show the NFS server's export list                                                                                                                                                                                                                        |

## Fix NFS Mount at Boot

### Use these options (Debian 10):

`noauto,x-systemd.automount,_netdev`

This forces systemd to take over auto-mounting responsibilites.

Just using \_netdev alone fails to mount at boot; i.e.: 'network unreachable' - or - 'dependency failed'

### Example fstab

{% code title="/etc/fstab" %}

```bash
10.0.0.1:/mountpoint  /mountpoint  nfs  noauto,x-systemd.automount,_netdev,rw,hard,intr,timeo=14,tcp,noatime  0 0
```

{% endcode %}
