In this post, I will explain step by step method of NFS server and client configuration on HP-UX operating system. Network File System is a distriubted file system which allows a client computer to access a file system that shared on another computer’s or server's.
NFS server is configured on the server locally on attached physically disk. On my HP-UX server i will configured the NFS server and for client you can use same HP-UX operating machine or other linux machine.
We can used the below NFS server IP and client IP on my own HP-UX machine and Linux machine.
NFS Server : 10.135.0.27 and share folder /backup
NFS Client : 10.135.0.2 and mount point /home/backup
Steps involved to configure the NFS Server:
1. First we will make sure both NFS server(10.135.0.27) and client(10.135.0.2) are accessible. After that we will make an entry in /etc/hosts or Configure it in DNS to resolve the IP if you use server name instead of IP address. But in our case we will use IP address instead of name.
hpx:/>vi /etc/hosts
10.135.0.27 hpxnfsserver
10.135.0.2 hpxnfsclient
The /etc/hosts entry would we same on both server and client machine so it can be accessible to each other.
2. In second step we will identify the folder to be export from server to the client. On my HP-UX server machine, I am going to export the folder /backup.
3. Now we will change the shared folder permission, normally we don't provide the read/write access to shared folder but in my case for testing purpose i will provide the (777) permission so that NFS client user can read/write the data on shared folder.
hpx:/>#chmod 777 /backup
4. In this step we change the NFS_SERVER=1 to enable your server to act as a NFS Server in the configuration file /etc/rc.config.d/nfsconf
hpx:/>vi /etc/rc.config.d/nfsconf
Change the NFS_SERVER parameter as follow.
NFS_SERVER=1
PCNFS_SERVER=0
START_NFSLOGD=0
START_MOUNTD=1
MOUNTD_OPTIONS=""
Save and exit the file.
5. In final step we will add an entry of our shared folder in the export file /etc/dfs/dfstab with proper permission.
#vi /etc/dfs/dfstab
/usr/sbin/share -F nfs -o rw -d “Test directory” /backup
Save and exit the file.
If you see the above line "/backup is shared folder and we will provide the "rw" read/write access to this folder.
6. Now please restart the nfs service on NFS server and make it permanent so after reboot of HP-UX server the shared folder is not umount.
hpx:/>/sbin/init.d/nfs.server stop
hpx:/>/sbin/init.d/nfs.server start
7. Using below command we can check the NFS folder is shared or not and also we can ensure which client can access this machine.
hpx:/>/usr/sbin/exportfs -av
shareall -F nfs
Steps involved to access the NFS shared folder to the NFS clients:
1. Now for NFS client configuration i will login on my Linux machine.In my case i will use my Centos machine as a client, You can select your NFS client machine as per your requirement.
2. On client machine, please select the mount point to where we have to mount the NFS shared folder /backup which we exported from NFS Server 10.135.0.27. On my Linux machine, I will mount it on /home/backup.
3. In this step we will verify the list of shares available on client machine. Please use the below "showmount" command to check which NFS shared folder is accessible.
hpx:/>showmount -e 10.135.0.27
export list for 10.135.0.27
/backup
If we get the output, server side export configuration doesnt have any problem between nfs server and client.
3. In next step we will mount the nfs share locally on our desintation mount point folder.
hpx:/>mount 10.135.0.27:/backup /home/backup
4. In final step, you can check the NFS mount folder using "bdf" command. It is show you the mount folder where all existing data is store. For testing purpose you can create any file on /home/backup.
Hope, you will like my this post, it is cover all the installation and configuration part step by step. Please let me know if you encouter any issue during NFS configuration on HP-UX machine.
No comments:
Post a Comment