mirror of
https://git.adityakumar.xyz/blog.git
synced 2024-11-09 10:59:45 +00:00
2.2 KiB
2.2 KiB
title | date | lastmod | draft | keywords | description | tags | categories | author | comment | toc | autoCollapseToc | postMetaInFooter | hiddenFromHomePage | contentCopyright | reward | mathjax | mathjaxEnableSingleDollar | mathjaxEnableAutoNumber | hideHeaderAndFooter | flowchartDiagrams | sequenceDiagrams | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Set up an NFS Server on Devuan | 2022-02-19T10:17:07Z | 2022-04-29T10:17:07Z | false |
|
|
|
false | false | false | true | false | false | false | false | false | false | false |
|
|
Pretty straightforward.
Install the necessary packages
apt-get --no-install-recommends install nfs-kernel-server
Create virtual root
mkdir /nfs # can be /srv, /export or whatever
Create a directory (or more) under virtual root directory
mkdir /nfs/home
Mount filesystems to be exported under virtual root directory
mount --bind /home /nfs/home
Make the mount points persistent. Append them to /etc/fstab
.
/home /nfs/home none bind 0 0
Put the following in /etc/exports
(assuming access is granted to the clients in the 192.0.2.0/24
IP network. Client access can also be specified as a single host using IP address or fully qualified domain name, or * character to grant access to all clients).
/nfs 192.0.2.0/24(insecure,rw,sync,no_subtree_check,crossmnt,fsid=0)
/nfs/home 192.0.2.0/24(insecure,rw,sync,no_subtree_check)
Configure the daemon. Edit /etc/conf.d/nfs
OPTS_RPC_NFSD="8 -N 2 -V 3 -V 4 -V 4.1"
Start NFS server (assuming OpenRC. See your init system’s documentation)
rc-service nfs-kernel-server start
Start NFS server at boot
rc-update add nfs-kernel-server default
See detailed (and more) instructions on Gentoo wiki.