From ba0bcc5ea76779a402fc95187986cdc50c6a8859 Mon Sep 17 00:00:00 2001 From: Alexis Date: Mon, 13 Jul 2020 13:02:10 +1000 Subject: [PATCH] network-filesystems: Add section. --- src/SUMMARY.md | 1 + src/config/network-filesystems.md | 71 +++++++++++++++++++++++++++++++ 2 files changed, 72 insertions(+) create mode 100644 src/config/network-filesystems.md diff --git a/src/SUMMARY.md b/src/SUMMARY.md index dbf38b06b..1d653ee3f 100644 --- a/src/SUMMARY.md +++ b/src/SUMMARY.md @@ -36,6 +36,7 @@ - [iwd](./config/network/iwd.md) - [NetworkManager](./config/network/networkmanager.md) - [ConnMan](./config/network/connman.md) + - [Network Filesystems](./config/network-filesystems.md) - [Session and Seat Management](./config/session-management.md) - [Graphical Session](./config/graphical-session/index.md) - [Graphics Drivers](./config/graphical-session/graphics-drivers/index.md) diff --git a/src/config/network-filesystems.md b/src/config/network-filesystems.md new file mode 100644 index 000000000..47a190119 --- /dev/null +++ b/src/config/network-filesystems.md @@ -0,0 +1,71 @@ +# Network Filesystems + +## NFS + +### Mounting an NFS Share + +To mount an NFS share, start by installing the `nfs-utils` and `sv-netmount` +packages. + +Before mounting an NFS share, [enable](./services/index.md#enabling-services) +the `statd`, `procbind`, and `sv-netmount` services. If the server supports +`nfs4`, the `statd` service isn't necessary. + +To mount an NFS share: + +``` +# mount -t :/path/to/sourcedir /path/to/destdir +``` + +`` should be `nfs4` if the server supports it, or `nfs` otherwise. +`` can be either the hostname or IP address of the server. + +Mounting options can be found in +[mount.nfs(8)](https://man.voidlinux.org/mount.nfs.8), while unmounting options +can be found in [umount.nfs(8)](https://man.voidlinux.org/umount.nfs.8). + +For example, to connect `/volume` on a server at `192.168.1.99` to an existing +`/mnt/volume` directory on your local system: + +``` +# mount -t nfs 192.168.1.99:/volume /mnt/volume +``` + +To have the directory mounted when the system boots, add an entry to +[fstab(5)](https://man.voidlinux.org/fstab.5): + +``` +192.168.1.99:/volume /mnt/volume nfs rw,hard,intr 0 0 +``` + +Refer to [nfs(5)](https://man.voidlinux.org/nfs.5) for information about the +available mounting options. + +### Setting up a server (NFSv4, Kerberos disabled) + +To run an NFS server, start by installing the `nfs-utils` package. + +Edit `/etc/exports` to add a shared volume: + +``` +/storage/foo *.local(rw,no_subtree_check,no_root_squash) +``` + +This line exports the `/storage/foo` directory to any host in the local domain, +with read/write access. For information about the `no_subtree_check` and +`no_root_squash` options, and available options more generally, refer to +[exports(5)](https://man.voidlinux.org/exports.5). + +Finally, [enable](./services/index.md#enabling-services) the `rpcbind`, `statd`, +and `nfs-server` services. + +This will start your NFS server. To check if the shares are working, use the +[showmount(8)](https://man.voidlinux.org/showmount.8) utility to check the NFS +server status: + +``` +# showmount -e localhost +``` + +You can use [nfs.conf(5)](https://man.voidlinux.org/nfs.conf.5) to configure +your server.