Search Engine



RedhatEnterpriseLinux Blog

Installing and configring nfs-server step by step part 4

Connecting Clients Via NFS
Setting up a client to use NFS is relatively simple when you have the NFS server in place. Let’s set up the Client01 system to use a share on the RHEL01 NFS server.

Step 1. To start, you need to install the required packages:
# yum install -y nfs-utils nfs4-acl-tools
These two packages include the necessary files for you to connect to the NFS server and use the exported resources. On the client side, you need only the rpcbind service running to mount NFS resources on the server.
Step 2. Ensure that the required service is set to start on boot:
# chkconfig rpcbind on
You can now create some directories to hold the NFS shares on the local system.
Step 3. Create two local directories:
# mkdir /mnt/{company_data,temp}
Step 4. Mount the company_data NFS share:
# mount –t nfs /mnt/company_data

Assuming your permissions and security restrictions are correctly in place, you should now be able to move into the /mnt/company_data directory and actually access the NFS share on the server. If you don’t want to always mount NFS shares after your system has booted, you can, of course, add an entry to the /etc/fstab file to have them mounted automatically at system boot.

Step 1. In the /etc/fstab, add the following line:
# nano /etc/fstab
rhel01:/opt/company_data                    /opt/company_data nfs
rw,sync 0 0

It mounts the remote /opt/company_data to the local /mnt/company_data directory.

Step 2. Save your file and exit.
Step 3. Using the mount command, you can verify that the resource was
mounted properly:
# mount | grep nfs
sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)
nfsd on /proc/fs/nfsd type nfsd (rw) on /mnt/temp type nfs
(rw,vers=4,addr=,clientaddr= on /mnt/company_data type nfs

The remote resource should now be available just as if it were a local resource.


Post a Comment

Powered by Blogger.


Copyright © Redhat Enterprise linux. Original Concept and Design by My Blogger Themes
My name is Abdul Razaq but people call me Raziq. Here is my home page: I live in Quetta, Pakistan and work as an IT-Engineer.