0

I've recently upgraded one of our machines to debian Squeeze from lenny. Previously, these machines mounted 2 NFS shares /home and /home/scans/data

After the upgrade they can only mount one at a time. If I try and mount them together I get the following error:

mount.nfs: access denied by server while mounting (null)

I also have to specify vers=3 in the fstab file or they are unable to mount at all due to the nfs server still being on Lenny.

Nothing permission wise has changed since the upgrade. There are other machines still on Lenny which still run with both shares mounted.

fstab entries for this machine:

nfs:/home /home nfs vers=3,exec,suid,nodev,nolock 0 0

nfs:/home/scans/data /home/scans/data nfs vers=3,exec,suid,nodev,nolock 0 0

  • mounting with "vers=2" specified in the fstab file works. Although I really shouldn't be using nfs version 2. – leeham38 Sep 16 '14 at 13:00
0

Mmmm... so your NFS server is called nfs? I am wondering if the code parsing your fstab is interpreting that as a protocol type rather than a hostname. That would mean that the hostname would effectively be null, which agrees with what the error message says.

I would try adding an alias in your hosts file and using the alias in your fstab.

Failing that, try showmount -e nfs.

| improve this answer | |
  • 1
    Thanks for the reply. nfs is the CNAME for our nfs server. I'll give that a go with the hosts file suggestion. – leeham38 Sep 16 '14 at 12:55
  • That didn't seem to work either. Even using the original DNS name still gives the same error. showmount -e nfs shows both of the shares, each of which have the machine listed. – leeham38 Sep 16 '14 at 12:59
  • How about trying the straight IP address temporarily? – Mark Setchell Sep 16 '14 at 13:02
  • Still the same :( sudo mount -a mount.nfs: access denied by server while mounting (null) Only one share of the two mounts. – leeham38 Sep 16 '14 at 13:05
  • Maybe post the NFS exports file from the NFS server. – Mark Setchell Sep 16 '14 at 13:09
0

I figured out the issue in the end.

I built a replica of our NFS server on a VM using Debian Squeeze. I can mount the shares fine when specifying vers=3 in the fstab file. It looks like it's just a version mismatch between Debian 5 and Debian 6.

| improve this answer | |
0

As of Ubuntu LTS 14.04, mount takes a -o 'vers=3' and works, but fstab needs nfsver.

# sudo mount -t nfs -o 'vers=3' -v 192.168.1.101:/data/info /share/info

fstab:

192.168.1.101:/data/info /share/info nfs user,rw,nfsvers=3,auto 0 0 

This takes a long time (20+ seconds). And, it doesn't seem to respect the 'auto' flag, necessitating a manual mount after boot.

I don't know why the fstab is a different syntax for me than the other answerers, but the Vim syntax highlighting fires on 'nfsvers' but not 'vers', so I suspect it's been this way for quite some time.

Another thing to consider is that according to https://wiki.archlinux.org/index.php/NFS/Troubleshooting the exported dirs actually have to be under /srv. This didn't make nfsv4 work for me though.

Did someone actually break nfs on an update?

| improve this answer | |
0

I have the same problem with slackware and latest nfs 1.3.3 I found this solution,simply check /etc/nfsmount.conf(probably on ubuntu has other name) and start with nfsmount.conf like this(all options are standard default with no mods,all commented)

#
# /etc/nfsmount.conf - see nfsmount.conf(5) for details
#
# This is an NFS mount configuration file. This file can be broken
# up into three different sections: Mount, Server and Global
# 
# [ MountPoint "Mount_point" ] 
# This section defines all the mount options that
# should be used on a particular mount point. The '<Mount_Point>'
# string need to be an exact match of the path in the mount 
# command. Example:
#     [ MountPoint "/export/home" ]
#       background=True
# Would cause all mount to /export/home would be done in
# the background
#
# [ Server "Server_Name" ]
# This section defines all the mount options that
# should be used on mounts to a particular NFS server. 
# Example:
#     [ Server "nfsserver.foo.com" ]
#       rsize=32k
#       wsize=32k
# All reads and writes to the 'nfsserver.foo.com' server 
# will be done with 32k (32768 bytes) block sizes.
#
[ NFSMount_Global_Options ]
# This statically named section defines global mount 
# options that can be applied on all NFS mount.
#
# Protocol Version [2,3,4]
# This defines the default protocol version which will
# be used to start the negotiation with the server.
# Defaultvers=4
#
# Setting this option makes it mandatory the server supports the
# given version. The mount will fail if the given version is 
# not support by the server. 
# Nfsvers=4
#
# Network Protocol [udp,tcp,rdma] (Note: values are case sensitive)
# This defines the default network protocol which will
# be used to start the negotiation with the server.
# Defaultproto=tcp
#
# Setting this option makes it mandatory the server supports the
# given network protocol. The mount will fail if the given network
# protocol is not supported by the server.
# Proto=tcp
#
# The number of times a request will be retired before 
# generating a timeout 
# Retrans=2
#
# The number of minutes that will retry mount
# Retry=2
#
# The minimum time (in seconds) file attributes are cached
# acregmin=30
#
# The Maximum time (in seconds) file attributes are cached
# acregmin=60
#
# The minimum time (in seconds) directory attributes are cached
# acregmin=30
#
# The Maximum time (in seconds) directory attributes are cached
# acregmin=60
#
# Enable Access  Control  Lists
# Acl=False
#
# Enable Attribute Caching
# Ac=True
#
# Do mounts in background (i.e. asynchronously)
# Background=False
#
# Close-To-Open cache coherence
# Cto=True
#
# Do mounts in foreground (i.e. synchronously)
# Foreground=True
#
# How to handle times out from servers (Hard is STRONGLY suggested)
# Hard=True
# Soft=False
#
# Enable File Locking
# Lock=True
#
# Enable READDIRPLUS on NFS version 3 mounts
# Rdirplus=True
#
# Maximum Read Size (in Bytes)
# Rsize=8k
#
# Maximum Write Size (in Bytes)
# Wsize=8k
#
# Maximum Server Block Size (in Bytes)
# Bsize=8k
#
# Ignore unknown mount options
# Sloppy=False
#
# Share Data and Attribute Caches
# Sharecache=True
#
# The amount of time, in tenths of a seconds, the client
# will wait for a response from the server before retransmitting
# the request.
# Timeo=600
#
# Sets all attributes times to the same time (in seconds)
# actimeo=30
#
# Server Mountd port mountport
# mountport=4001
#
# Server Mountd Protocol
# mountproto=tcp
#
# Server Mountd Version
# mounvers=3
#
# Server Mountd Host
# mounthost=hostname
#
# Server Port
# Port=2049
#
# RPCGSS security flavors 
# [none, sys, krb5, krb5i, krb5p ]
# Sec=sys
#
# Allow Signals to interrupt file operations
# Intr=True
#
# Specifies  how the kernel manages its cache of directory
# Lookupcache=all|none|pos|positive
#
# Turn of the caching of that access time
# noatime=True
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.