Pages

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:

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

    ReplyDelete
  2. O THANK JESUS !!! and you :)

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

    ReplyDelete
  4. worked like a charm! many thanks :-)

    ReplyDelete
  5. Works great! thanks

    ReplyDelete
  6. Works like a charm!

    ReplyDelete
  7. 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.

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

    ReplyDelete
  9. 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

    ReplyDelete
  10. 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...

    ReplyDelete

All Comments are Welcome.
thanks for leaving a comment.