Mon, March 26, 2018 ยท 1 min read

NFS server setup on fedora 26

NFS server setup on fedora 26

NFS (network file storage) can be used to share files on Linux, used for Linux diskless installation, good solution to share huge amount of data. NFS also supports kerberos for secured implementation.

nfs-utils is the package required to configure NFS server.

$ sudo dnf install nfs-utils
Last metadata expiration check: 0:01:05 ago on Tuesday 27 March 2018 08:48:03 PM IST.
Package nfs-utils-1:2.2.1-4.rc2.fc26.x86_64 is already installed, skipping.
Dependencies resolved.
Nothing to do.
Complete!

Start NFS services

$ systemctl start rpcbind nfs-server

$ systemctl enable rpcbind nfs-server
Created symlink /etc/systemd/system/multi-user.target.wants/rpcbind.service -> /usr/lib/systemd/system/rpcbind.service.
Created symlink /etc/systemd/system/multi-user.target.wants/nfs-server.service -> /usr/lib/systemd/system/nfs-server.service.

$ systemctl status nfs-server
โ— nfs-server.service - NFS server and services
   Loaded: loaded (/usr/lib/systemd/system/nfs-server.service; enabled; vendor preset: disabled)
   Active: active (exited) since Tue 2018-03-27 20:51:13 IST; 51s ago

Creating an NFS share

$ cat /etc/exports
/home *(rw,no_root_squash)

$ exportfs -r

Allow NFS in firewall

$ firewall-cmd --add-service=nfs --permanent
$ firewall-cmd --permanent --add-service=rpc-bind
$ firewall-cmd --permanent --add-service=nfs
$ firewall-cmd --permanent --add-service=mountd
$ firewall-cmd --reload

Checking NFS from server

$ showmount -e localhost
Export list for localhost:
/home *

Mounting the share on client

$ sudo mount -t nfs 192.168.15.15:/home /mnt
$ echo $?
0

Check /etc/mtab for NFS mount point:

192.168.15.15:/home /mnt nfs rw,vers=4,addr=192.168.15.15,clientaddr=192.168.0.48 0 0