How to configure Setup NFS Rhel5

NFS Network File sharing is used for sharing the file from One Linux system to another Linux system. Before configure NFS we need to stop the iptables and firewall – selinux.
NFS SERVER SIDE
[root@redhat ~]# service iptables stop
[root@redhat ~]# chkconfig iptables off
[root@redhat ~]# sestatus
SELinux status: disabled
/etc/exports file is NFS export file here we need insert  the directory which one we want to share and next parameter we need to mention which network share the directory
[root@redhat ~]# vi /etc/exports
/home *(rw)
*(rw) all the network share the file
192.168.0.0/24(rw) 192.168.0.0 Network only it will share file
*.linuxrhel5.com it will share file only in linuxrhel5.com domain
*.linuxrhel5.com  192.168.0.0/24(rw)
Default After Redhat Linux Installation NFS service is installed we need to restart that service.[root@redhat ~]# service nfs restart
Shutting down NFS mountd: [FAILED]
Shutting down NFS daemon: [FAILED]
Shutting down NFS quotas: [FAILED]
Shutting down NFS services: [FAILED]
Starting NFS services: [ OK ]
Starting NFS quotas: [ OK ]
Starting NFS daemon: [ OK ]
Starting NFS mountd: [ OK ]
[root@redhat ~]# service portmap restart
port map is RPC program number mapper


Then using show mount command we need to check whether that folder is shared or not
[root@redhat ~]# showmount -e 10.0.0.2
Export list for 10.0.0.2:
/home *
NFS CLIENT SIDE -Network File sharing
Then mount the NFS shared directory into the mnt using mount command

[root@redhat ~]# mount 10.0.0.2:/home /mnt
[root@redhat ~]# cd /mnt/
[root@redhat mnt]# ls
Then we can able to access the shared file we can read and write
aquota.user bashscript lost+found.
NFS Mount Option
mount -F nfs -o soft #Soft Mount
mount -F nfs -o hard #Hard Mount
nosuid - Disable set uid and set gid.
risze,wsize -read and write the large data block size.
tcp, udp - specify the nfs protocol as TCP and UDP.
noacl - disable acl processing.
nolock- Disable the file locking

Related post