Unix/Linux Go Back    


UNIX for Advanced & Expert Users Expert-to-Expert. Learn advanced UNIX, UNIX commands, Linux, Operating Systems, System Administration, Programming, Shell, Shell Scripts, Solaris, Linux, HP-UX, AIX, OS X, BSD.

learn linux and unix commands - unix shell scripting

Mounting a directory using nfs version4

UNIX for Advanced & Expert Users


Tags
mount, nfsv4

Closed    
 
Thread Tools Search this Thread Display Modes
    #1  
Old Unix and Linux 09-06-2009   -   Original Discussion by arunsriniv
arunsriniv's Unix or Linux Image
arunsriniv arunsriniv is offline
Registered User
 
Join Date: Aug 2007
Last Activity: 4 March 2012, 1:34 PM EST
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Mounting a directory using nfs version4

Hi,

I would like to know how can we mount a directory using nfs v4 ?

When I use the below command, I am not sure what nfs version am using to mount the directory.

mount -t <server_name>:<shared_directory> <shared_directory>.

eg:
mount -t 10.50.0.8:/home/arun/mount/share_dir /home/arun/mount/share_dir

If the above command uses anyother nfs version, then can anyone tell me the command to mount a directory using nfs4. OS is RHEL5

Thanks in advance.
Sponsored Links
    #2  
Old Unix and Linux 09-06-2009   -   Original Discussion by arunsriniv
Scrutinizer's Unix or Linux Image
Scrutinizer Scrutinizer is offline Forum Staff  
Moderator
 
Join Date: Nov 2008
Last Activity: 10 January 2018, 11:12 AM EST
Location: Amsterdam
Posts: 11,695
Thanks: 529
Thanked 3,395 Times in 2,992 Posts
Hi,

Is this what you are looking for?


Code:
mount -t nfs4 <server_name>:<shared_directory> <shared_directory>

Sponsored Links
    #3  
Old Unix and Linux 09-10-2009   -   Original Discussion by arunsriniv
arunsriniv's Unix or Linux Image
arunsriniv arunsriniv is offline
Registered User
 
Join Date: Aug 2007
Last Activity: 4 March 2012, 1:34 PM EST
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Hi,

I tried ur command. Unfortunately, it failed with the below error message:

mount.nfs4: Operation not permitted

Do you have any other suggestions ?

Thanks.
    #4  
Old Unix and Linux 09-10-2009   -   Original Discussion by arunsriniv
fpmurphy's Unix or Linux Image
fpmurphy fpmurphy is offline
Registered User
 
Join Date: Dec 2003
Last Activity: 12 June 2016, 11:03 PM EDT
Location: /dev/ph
Posts: 4,996
Thanks: 73
Thanked 475 Times in 437 Posts
It is not as simple as specifying the type in an option to the mount command. NFSv4 only uses TCP and also uses a pseudo-filesystem. Configuration is radically different than previous versions of NFS.

First check to see if you are NFSv4 enabled. Using rpcinfo, you should see a line like the following. If you do not, you are not running NFSv4. You also need to ensure that port is open in your firewall for TCP.


Code:
rpcinfo -p
....
XXXXXXX    4   tcp   2049  nfs
....

You need to ensure the ID to name mapping daemon (idmapd) is running on the server and is configured correctly (idmapd..conf) You also need to do this for you client system.

You also need to ensure that the exports done through one main export point (the pseudofile-system), with all other exports grouped underneath the main export.

Once this is all done, you show check the setup using showmount -e <servername>
If your master mount is /NFS4, you should see something like


Code:
/NFS4                    XXX.XXX.XXX.XXX
/NFS4/shared_directory   XXX.XXX.XXX.XXX

You then mount the main export, not shared_directory.

Do a Internet seach for "RHEL NFSv4 howto" or "Centos NFSv4" and you will find lots of information.
Sponsored Links
    #5  
Old Unix and Linux 09-10-2009   -   Original Discussion by arunsriniv
arunsriniv's Unix or Linux Image
arunsriniv arunsriniv is offline
Registered User
 
Join Date: Aug 2007
Last Activity: 4 March 2012, 1:34 PM EST
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Hi Murphy, Thanks for the help.

The server is NFSv4 enabled and the firewall is disabled. However, I could not get what you meant by this (am relatively newbie)

>>>>>
You need to ensure the ID to name mapping daemon (idmapd) is running on the server and is configured correctly (idmapd..conf) You also need to do this
>>>>>

Googling some NFSv4 How to pages, I did the below (and it did not throw me any error). Not sure what I did was correct.

On NFS ServerLinuxexample directories have been quoted below)



Code:
1. Edited /etc/exports by adding "/home/aruns/test 10.50.0.52 (rw,fsid=0,sync)"
2. Did "exportfs -r"

On Client side:



Code:
1. mount -t nfs4 10.50.0.52:/ /home/aruns/test

It got mounted successfully. But am half minded whether this is the correct process.

Would u like to help ??

Thanks.
Sponsored Links
    #6  
Old Unix and Linux 09-11-2009   -   Original Discussion by arunsriniv
fpmurphy's Unix or Linux Image
fpmurphy fpmurphy is offline
Registered User
 
Join Date: Dec 2003
Last Activity: 12 June 2016, 11:03 PM EDT
Location: /dev/ph
Posts: 4,996
Thanks: 73
Thanked 475 Times in 437 Posts
Quote:
Would u like to help ??
Read the following: NFSv4 setup for Fedora/Redhat/Centos
Sponsored Links
    #7  
Old Unix and Linux 09-12-2009   -   Original Discussion by arunsriniv
arunsriniv's Unix or Linux Image
arunsriniv arunsriniv is offline
Registered User
 
Join Date: Aug 2007
Last Activity: 4 March 2012, 1:34 PM EST
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Thanks a lot Murphy.
Sponsored Links
Closed


Linux More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
how to install new java versions to 264 version4.0 alpha rasa_still_here UNIX for Dummies Questions & Answers 0 11-13-2008 04:01 AM
home directory is not mounting durgaprasadr13 SuSE 1 10-16-2008 04:18 AM
mounting new directory tjay83 Slackware 16 09-03-2008 10:37 AM
/data directory not mounting khelen SCO 2 04-07-2006 04:01 PM
mounting a directory to a windows 2000 shared folder cw1972 Windows & DOS: Issues & Discussions 2 10-01-2003 04:48 AM



All times are GMT -4. The time now is 12:49 PM.