0% found this document useful (0 votes)
8 views

nfs modified

Uploaded by

hokagisama2004
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views

nfs modified

Uploaded by

hokagisama2004
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Network File System:

NFS is developed only for sharing files and folders only between Linux systems. In NFS local
directories are shared over a network and remote clients interact with them as they are mounted locally.

rpcbind
rpcbind responds to requests for RPC services and sets up connections to the requested RPC
service.

nfs
service nfs start starts the NFS server and the appropriate RPC processes to service requests for
shared NFS file systems.

Fstab:
File System Table. It is basically a config file that will tell your computer which devices
(or virtual devices) to use on boot.
On Server (NFS Server)

1. Verify that nfs package is already installed [root@localhost ~]# rpm -qa | grep nfs

2. Verify the nfs service status [root@localhost ~]# systemctl status nfs-server

3. Start the nfs service [root@localhost ~]# systemctl start rpcbind


[root@localhost ~]# systemctl start nfs-server

4. Verify the nfs service status [root@localhost ~]# systemctl status nfs-server

5. Configure the nfs service to start [root@localhost ~]# systemctl enable rpcbind
automatically at the boot time [root@localhost ~]# systemctl enable nfs-server
[root@localhost ~]# systemctl status nfs-server

6. Configure the Firewall to trust [root@localhost ~]# firewall-cmd --add-service=nfs


--permanent
NFS services [root@localhost ~]# firewall-cmd –reload

7. Create a new folder /alpha [root@localhost ~]# mkdir /alpha

8. Create and edit two files in the [root@localhost ~]# vi /alpha/gamma


alpha folder (gamma and zeta) [root@localhost ~]# vi /alpha/zeta

9. To share the alpha folder using NFS [root@localhost ~]# vi /etc/exports


and allow the root user to read and write /alpha 192.168.7.0/24(rw,no_root_squash)
the alpha folder when accessing remotely
from any Linux machine connected to the
network 192.168.7.0, you need to edit the
file /etc/exports and add the following line:
/alpha 192.168.7.0/24(rw,no_root_squash)
The option 'no_root_squash' basically allows
the root user on the client to access/create
files on the NFS server as root.

10. Restart the nfs service [root@localhost ~]# systemctl restart rpcbind
[root@localhost ~]# systemctl restart nfs-server
On NFS Client

1. Create a new folder [root@localhost ~]# mkdir /mnt/beta

2. Mount the shared folder on localhost to the


new directory beta

[root@localhost ~]# mount -t nfs 192.168.7.11:/alpha /mnt/beta/


-t selects to display each RPC call to standard
output
Where 192.168.7.11 the NFS server IP address,
/alpha is the exported directory and /mnt/beta
is the local mount point.

3. Verify that the shared folder was mounted [root@localhost ~]# df


properly

4. Access the shared folder and verify the content [root@localhost ~]# cd /mnt/beta
[root@localhost beta]# ls

5. Make a change for the file gamma and save [root@localhost beta]# vi gamma
the change

6. Reboot the server [root@localhost ~]# reboot

7. Verify if the shared folder is still mounted [root@localhost ~]# df

8. To mount the NFS share automatically at boot


time, you need to edit the file /etc/fstab and
add the following line:

192.168.7.11:/alpha /mnt/beta nfs defaults 0 0

9. Save the change on the fstab file and reboot [root@localhost ~]# reboot
the server

If you make a new entry in fstab it will not [asharma@localhost ~]$ mount -a
auto-mount. Therefore you must reload / refresh
the entries.
10. Is the shared folder still mounted? [asharma@localhost ~]$ df

11. Access the shared folder and make a [root@localhost ~]# cd /mnt/beta/
change for the file zeta and save the [root@localhost beta]# ls
change gamma zeta
[root@localhost beta]# vi zeta

Extra notes:
If your turn on network card every time you restart the client then the mount calls executes before
networking is up. Solution is either you need to run mount -a every time or just make a minor change to
ethernet configuration
Edit the configuration file for the network interface ( normally /etc/sysconfig/network-scripts/ifcfg-eth0
) and changing: ONBOOT=no to ONBOOT=yes

You might also like