0% found this document useful (0 votes)
14 views2 pages

NFS Configuration and /etc/exports Guide

NFS-Linux-Handson

Uploaded by

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

NFS Configuration and /etc/exports Guide

NFS-Linux-Handson

Uploaded by

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

NFS (Network Filesystem) and /etc/exports

NFS enables you to mount a file system on a remote computer as if it were local to
your own system. you can then directly access any of the files on the remote
filesystem. this has the advantage of allowing different systems on a network to
access the same files directly without each having to keep its own copy. only one
copy would be on a remote file system, which each computer could then access.

NFS Daemons-:
NFS operates over a TCP/IP network. the remote computer that holds the file system
makes it available to other computers on the network. it does so by exporting the
file system, which entails making entries in an NFS configuration file called
/etc/exports, as well as by running several daemons to supports access by other
systems. these include "[Link], [Link], and [Link]". access to your
NFS server can be controlled by the /etc/[Link] and /etc/[Link] files. the
NFS daemons are listed here.

1. [Link]-: receives NFS requests form remote systems and translates them into
requests for the local system.

2. [Link]-: performs requested moun and unmount operations.

3. [Link]-: maps remote requests to the appropriate NFS daemon.

4. [Link]-: provides user disk quota management.

5. [Link]-: provides locking services when a remote host reboot.

6. [Link]-: handles lock recovery for the systems that have gone down.

configuring NFS
first check the RPM
#rpm -q nfs-utils
install the RPM
#yum install [Link]

server setting
first make the folder which you want to share
#mkdir /share
#cd /share
#touch a1 a2 a3
#chmod o+w a1 a2 a3
now open the configuration file
#vi /etc/exports
making the following entry
/share [Link]/[Link](rw,sync)
save and exit

/share will be shared by the entire network.

now start the service


#service portmap restart
#service portmap on
#service nfs restart
#chkconfig nfs on

client setting
mount the /share directory on client machine.
#mount [Link]:/share /mnt
where /mnt is a mount point.

for sharing a particular ip address


server setting
#vi /etc/exports
/share [Link]/[Link](rw,sync)
/share [Link]/[Link](rw,sync)
save and exit

sharing for two different network


#vi /etc/exports
/share [Link]/[Link](rw,sync)
/share [Link]/[Link](rw,sync)

for all world


#vi /etc/exports
/share *(rw,sync)

if we give a space between the network range and (rw,sync), then it will mount for
everyone.
#vi /etc/exports
/share [Link]/[Link] (rw,sync)

Common questions

Powered by AI

Security considerations for controlling access to an NFS server include configuring the /etc/hosts.allow and /etc/hosts.deny files to specify which systems are allowed or denied access. These configurations help manage who can access the NFS server, preventing unauthorized access and ensuring that only trusted systems can connect and utilize the exported filesystems .

Mounting an NFS shared directory on a client machine involves using the mount command. The syntax is: #mount <NFS-server-IP>:/<shared-directory> <local-mount-point>. For example, if the NFS server IP is 172.24.254.254 and the shared directory is /share, you would use the mount command as follows: #mount 172.24.254.254:/share /mnt, where /mnt is the local directory where the shared folder will be mounted .

NFS utilizes several daemons to facilitate its operation over a TCP/IP network. The key daemons include rpc.nfsd, which receives and translates NFS requests for the local system; rpc.mountd, responsible for performing mount and unmount operations; rpc.portmapper, which maps remote requests to the right NFS daemon; rpc.rquotad, providing disk quota management; rpc.statd, offering locking services for reboots; and rpc.lockd, managing lock recovery for systems that have gone down .

Improperly configured rpc.statd services in an NFS setup can severely impact the reliability of file locking and recovery processes across the network. This daemon is responsible for providing locking services and monitoring lock states, especially after reboots. If incorrectly configured, it can lead to file access conflicts, data corruption, or failure to restore lock states following system interruptions, undermining data integrity and system stability .

To configure a directory for sharing via NFS, first, create the directory you want to share and set appropriate permissions. Then, open and modify the /etc/exports file to add an entry indicating the directory to be shared and the network or IP addresses from which access will be allowed, along with access options like (rw,sync). After saving the changes, restart the NFS and portmap services and configure them to start on boot .

Using NFS for file sharing in a networked environment presents several advantages. It centralizes file management by allowing multiple systems to access the same files directly, reducing the need for duplicative storage and ensuring data consistency. NFS also supports platform-independent access through standard networking protocols, enhancing interoperability. Additionally, by configuring appropriate access controls and security measures, it offers flexible and scalable file sharing tailored to diverse organizational needs .

In an NFS environment, disk quota management is handled by the rpc.rquotad daemon. This daemon provides the necessary functionality to manage and enforce disk quotas on the filesystem being exported by the NFS server. By integrating with the quota system, rpc.rquotad ensures that users adhere to pre-defined disk space limitations, helping prevent any individual user from consuming excessive storage resources .

Specifying "*" in the /etc/exports file for NFS implies that the shared directory will be accessible by any host on the network. This broad level of access can be advantageous for environments where widespread access is required, but it also raises potential security implications because it does not restrict access to any specific system or network, potentially exposing the system to unauthorized access or abuse .

NFS utilizes TCP/IP by operating over this ubiquitous network protocol to facilitate communication between the NFS server and client systems. The NFS server exports filesystems over the network, allowing clients to mount these filesystems through the TCP/IP protocol, ensuring reliable data exchange. Daemons such as rpc.nfsd, rpc.mountd, and rpc.portmapper play crucial roles in translating and managing these requests over the network .

NFS allows systems on a network to access the same files by enabling them to mount a remote filesystem as if it were local. This is achieved by exporting the remote filesystem on the server, which creates a single copy that can be accessed directly by any system on the network. This setup removes the need for each system to maintain its own copy of the files, thus facilitating seamless sharing and collaboration .

You might also like