Mounting a directory using nfs version4


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users Mounting a directory using nfs version4
# 8  
Old 11-12-2013
RedHat

Quote:
Originally Posted by arunsriniv
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.
I recently ran into this problem. The solution offered here (and elswhere on the Internet) insufficiently failed to answer it. I had to dig deep to find it.

Depending on the precise server configuration, you might also see one of the following messages:
Code:
mount.nfs: access denied by server while mounting 10.0.2.2:/

Code:
mount.nfs: No such process

Code:
mount.nfs: Interrupted system call

For all of these error messages, the solution was the same.

It probably happens because of a bug in the NFS client or server shipped with 64-bit RHEL6 / CENTOS6 (nfs-utils 1.2.3-36.el6, nfs-utils-lib 1.1.5-6.el6), the one which supports NFSv4 and by default, requires the remote client to connect from a port number < 1024. The client NFS program refuses to use a low (<1024) port number, even if given the "resvport" option. The actual error you get depends on whether the server or the rpcbind daemon configuration (/etc/sysconfig/nfs on rhel6/centos6) has NFS 2 & 3 disabled, and which options are enabled for the IP shares exported.

Another quirk to my configuration is that I was trying to mount from a VM a share served by the hypervisor. So:
Code:
---------------
|  Host  H     |
|              |
|  ----------  |
| |  Host C1 | |
|  ----------  |
|  ----------  |
| |  Host C2 | |
|  ----------  |
---------------

Host C1 and C2 were trying to mount a share S served by host H.

The solution
Again, appropriate for version 4, as tested with RHEL6.4, is to specify "insecure" in the exports file for all IPs allowed to share that resource.

Code:
/export/shared   10.1.1.0(rw,insecure) 127.0.0.1(rw,insecure)


-------

Note: Many recipes/solutions (including the one offered above) call to add "fsid=0", but this is necessary and appropriate only if you want to mount the volume as that host's "root" filesystem. If that solved the problem (which it shouldn't have) then the problem lies elsewhere -- possibly mounting the wrong share-path or a path-permissions problem (a guess).

Note 2: The man pages indicate you can specify the mount program to use a reserved port, and I tried this, but my version refused to use a low port even using the resvport option. This might be due to a kernel configuration specific to RHEL6.

Note 3: You can use mount's -v option to see what happens when the mount fails. In the pathalogical case, the client tries V4, then V3, then V2 before giving up:

Code:
# mount -v 10.0.2.2:/ /mnt/share/
mount: no type was given - I'll assume nfs because of the colon
mount.nfs: timeout set for Tue Nov 12 18:15:35 2013
mount.nfs: trying text-based options 'vers=4,addr=10.0.2.2,clientaddr=10.0.2.15'
mount.nfs: mount(2): Operation not permitted
mount.nfs: trying text-based options 'addr=10.0.2.2'
mount.nfs: prog 100003, trying vers=3, prot=6
mount.nfs: trying 10.0.2.2 prog 100003 vers 3 prot TCP port 2049
mount.nfs: prog 100005, trying vers=3, prot=17
mount.nfs: portmap query retrying: RPC: Program not registered
mount.nfs: prog 100005, trying vers=3, prot=6
mount.nfs: portmap query failed: RPC: Program not registered
mount.nfs: prog 100003, trying vers=2, prot=6
mount.nfs: trying 10.0.2.2 prog 100003 vers 2 prot TCP port 2049
mount.nfs: portmap query retrying: RPC: Program/version mismatch
mount.nfs: prog 100003, trying vers=2, prot=17
mount.nfs: trying 10.0.2.2 prog 100003 vers 2 prot UDP port 2049
mount.nfs: portmap query failed: RPC: Program/version mismatch
mount.nfs: prog 100003, trying vers=2, prot=6
mount.nfs: trying 10.0.2.2 prog 100003 vers 2 prot TCP port 2049
mount.nfs: portmap query retrying: RPC: Program/version mismatch
mount.nfs: prog 100003, trying vers=2, prot=17
mount.nfs: trying 10.0.2.2 prog 100003 vers 2 prot UDP port 2049
mount.nfs: portmap query failed: RPC: Program/version mismatch
mount.nfs: No such process

You can run a packet sniffer on the server to see that the remote side initiates a connection from a high port number:
Code:
18:15:07.350172 IP localhost.55088 > localhost.nfs: Flags [S], seq 2207422108, win 32792, options [mss 16396,sackOK,TS val 336392919 ecr 0,nop,wscale 7], length 0

These 2 Users Gave Thanks to otheus For This Post:
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Solaris

Mounting NFS

Hi, I am having some issues mounting NFS files. for some reason the mount -F nfs is not being recognized.. bash-3.2# mount -F nfs -o rw 192.168.245.129:/mnt/nfs1/ /mnt UX:vxfs mount: ERROR: V-3-20135: FSType nfs not recognized UX:vxfs mount: INFO: V-3-20147: Usage: mount {special |... (5 Replies)
Discussion started by: br1an
5 Replies

2. Red Hat

NFS mounting issue

The server ip is 10.2.2.24. I have installed nfs-utils package the i have edited /etc/exports i have added the following line /home 10.2.2.0/24(rw,sync,no_root_squash,no_all_squash) i have saved, i have started the nfs service, then i am trying to mount nfs sharing from client machine using... (5 Replies)
Discussion started by: ainstin
5 Replies

3. Red Hat

NFS mounting from client pc

The server ip is 10.2.2.24. I have installed nfs-utils package the i have edited /etc/exports i have added the following line /home 10.2.2.0/24(rw,sync,no_root_squash,no_all_squash) i have saved, i have started the nfs service, then i am trying to mount nfs sharing from client machine using... (1 Reply)
Discussion started by: ainstin
1 Replies

4. Red Hat

NFS not mounting using ipaddress of client

Dear All, I have an NFS Server and client. I am trying to include the ipaddress of the client in servers exports file /etc/exports. In this case , I could not mount , saying permission denied. But when I give * symbol in the place of ipaddress ( Global , any IPS ) it is mounting. ... (1 Reply)
Discussion started by: jegaraman
1 Replies

5. UNIX for Dummies Questions & Answers

Mounting NFS filesystem

Hi All, I need to mount an nfs filesystem as below. xxx.xx.xx.xxx:/media/nss/Rocky Catherine/logs For the above as there is space in between the name, hoping it will not mount, if i give it with double quotes as below will it work? mount "xxx.xx.xx.xxx:/media/nss/Rocky... (2 Replies)
Discussion started by: Rockyc3400
2 Replies

6. HP-UX

Mounting of unix NFS to windows XP

is it possible? i will only config on the windows side. is there a third party software to help me accomplish this? tnx (3 Replies)
Discussion started by: Amaru
3 Replies

7. Solaris

problem NFS mounting onto Solaris 10

On my Solaris 10 server, I want to share out the directory /export/home/data, so in the /etc/dfs/dfstab file, I have this line: share -F nfs -o rw /export/home/data In the /etc/hosts.equiv file, I have this: + When I do a "ps -ef" command, I see that the "nfsd' daemon is started. ... (2 Replies)
Discussion started by: serendipity1276
2 Replies

8. Linux

NFS not mounting during kickstart

Hi, Re-building linux server from a kickstart image on cdrom. We have a kickstart server. the cdrom contacins the kickstart ks.cfg file and does a NFS mount from an IP to load the iso images and other files needed during the kickstart (re-build) Now for some reason the kickstart stops and... (2 Replies)
Discussion started by: Andrek
2 Replies

9. IP Networking

Write permisson in NFS mounting

Hi all i have done set up for nfs. at server <dir> <client IP>/<netmask>(rw,sync) at client mount -o rw -nfs <server IP>:<dir1><dir2> with this i am successful in mounting the directory with write permission. But the write permission is not activate in client machine for the file which... (5 Replies)
Discussion started by: bhakti
5 Replies

10. OS X (Apple)

Mounting an NFS drive in OSX 10.3

Hi all ! I am looking for a command in the terminal or GUI to mount an NFS drive. Second , is there any solution to get rid of / " * in old files names I know it can be done i just dont know how ! Hope that some one can help Best R. Yovel (2 Replies)
Discussion started by: yoveln
2 Replies
Login or Register to Ask a Question