User Tools

Site Tools


linux:fedora22nfs

Short guide to setup NFSv4 on Fedora 22

Setup shared folders

NFSv4 is using a common place to export all the folders, so on the server create it (e.g. nfsexports) and then bind the desired to-be-shared folder(s) (e.g. music):

mkdir -p /nfsexports/music
mount --bind /var/run/media/cristian/<mounted_device> /nfsexports/music

Of course, you can make this permanent with a record in /etc/fstab file. Feel feel to bind any other folders as well.

Update the exports file

Edit /etc/exports file to reflect the new added folder:

/nfsexports/music          192.168.1.0/24(ro,nohide,insecure,no_subtree_check,sync,all_squash)

Restart (and optionally startup enable) the services:

systemctl start rpcbind nfs-server 
systemctl enable rpcbind nfs-server 

You can use exportfs command to check the possible exports:

/usr/sbin/exportfs -s

Firewall configuration

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

Client Side Configuration

First check if everything looks ok server side (in our case 192.168.1.1):

showmount -e 192.168.1.1
Export list for 192.168.1.1:
/nfsexports/music 192.168.1.0/24

Mount as usual:

sudo mount -t nfs4 -o proto=tcp,port=2049 192.168.1.1:/music /<mounting_folder>/music

linux/fedora22nfs.txt · Last modified: 2015/09/30 16:41 (external edit)