Monday, January 23, 2012

mount.nfs: access denied by server while mounting

If your nfs mounts stop working
and mount-a gives you the following error.
mount.nfs: access denied by server while mounting /blah_blah_blah/blah_blah


Chances are, your machine has been upgraded and now uses the NFS version 4 as default nfs version
 instead of 3

To fix this issue you need to explicitly tell nfs to mount your share using the older nfs version 3

simply add nfsvers=3  to your nfs mount stanza in your /etc/fstab file


eg
vi /etc/fstab


192.168.1.10:/shared/files  /mnt/files nfs soft,intr,nfsvers=3 0 0

save the file and type
mount -a  

Your nfs mounts will now work.

10 comments:

prat said...

Nice help!!!!!!!! it works in my case..
cheers

Unknown said...

O THANK JESUS !!! and you :)

Unknown said...

O thanks jesus i mean you lol i really wish red hat would tell peaple this shit -_-

actinium said...

worked like a charm! many thanks :-)

Anonymous said...

Works great! thanks

Anonymous said...

Works like a charm!

Anonymous said...

My Ubuntu client was having this error trying to mount from a CentOS 6.2 NFS server. I used the command $ sudo mount -t nfs -o nfsvers=3 192.168.x.x:/path/to/share/ /mnt/

by adding the nfsvers=3 option, the error went away. It had nothing to do with the firewall, since I had previously set static ports in NFS and opened the corresponding ports in iptables.

Anonymous said...

not working in my case... shows bad line in /etc/fstab :(

Sorin said...

I my case is doesn't work. The "access denied" message remain.
Additionally, on screen appear:
mount.nfs: trying 10.0.0.101 prog 1005 vers 3 prot UDP port 4157
mount.nfs:mount(2):Permission denied

Sorin said...

Not working either in my case.
on screen appear:

mount.nfs: trying 10.0.0.101 prog 100005 vers 3 prot UDP port 4517
mount.nfs: mount(2): Permission denied
mount.nfs: access denied by server...