Home How to setup NFS (Network File System) on RHEL/CentOS
Post
Cancel

How to setup NFS (Network File System) on RHEL/CentOS

We need to install NFS packages on the NFS Server as well as on NFS Client machine. We can install it via “yum” for RHEL/CentOS.

On the NFS server side, run the following commands to setup NFS server.

1
2
3
4
5
6
7
8
9
10
$ systemctl status nfs
$ mkfs.ext4 /dev/nvme9n1
$ mkdir /mnt/nfsshare

$ vim /etc/exports
/mnt/nfsshare 10.10.10.1(rw,no_root_squash)

$ systemctl restart nfs
$ exportfs -s
/mnt/nfsshare  10.10.10.1(sync,wdelay,hide,no_subtree_check,sec=sys,rw,secure,no_root_squash,no_all_squash)

On the NFS client side, run the following command to mount the exported NFS share.

1
2
3
4
$ mkdir /mnt/nfs1
$ mount -t nfs nfs-server-hostname:/mnt/nfsshare /mnt/
$ mount  | grep nfs1
fs-server-hostname:/mnt/nfsshare on /mnt/nfs1 type nfs4 (rw,relatime,vers=4.1,rsize=1048576,wsize=1048576,namlen=255,hard,proto=tcp,timeo=600,retrans=2,sec=sys,clientaddr=10.10.10.2,local_lock=none,addr=10.10.10.1)
This post is licensed under CC BY 4.0 by the author.

SysRq - Linux Magic System Request Key Hacks

Using nconnect to improve NFS performance

Comments powered by Disqus.