Australian cloud for business software — built and run in Sydney since 2002

NetLeverage
NetLeverage

mount.nfs: access denied by server while mounting: check the export, the client address and the source port

Technical article
Troubleshooting

About this article: This article is reviewed against the cited sources. This is source research, not lab validation. Check the stated versions and your own requirements before making changes.

An NFS mount that ends with mount.nfs: access denied by server while mounting nas01:/export/data (the nfs-utils source prints the message as "%s: access denied by server while mounting %s", with the program name first and the server and path last) was refused by the server, not by the network. The server answered, and the Red Hat solution attributes the refusal it describes to the server's mount daemon, and its diagnostic steps also show an NFS4ERR_PERM in a packet capture. In the logged case the server refused this client's request. Check three things on the server: the path is exported, the export names the client's address, and the client's source port is allowed. Then apply the change and try again.

What the error means

When a client mounts an NFS share, it asks the server's mount service for the export. The server keeps a table of exports. The exportfs manual says the master table is /var/lib/nfs/etab, which "is read by rpc.mountd when a client sends an NFS MOUNT request". If the path is not in the table, or the client does not match, or a rule such as the port rule fails, the request is refused.

Red Hat's knowledge base describes the same message, and for one cause it quotes a server-side log line from rpc.mountd: refused mount request from an address for /path/to/export (/path/to/export): illegal port and a port number. The server log is therefore the quickest way to tell causes apart, because the client prints the same words for each.

Three mechanisms in the exports(5) manual bear on this refusal.

  • Who may mount. Each export line lists clients. A client can be a host name, an address, an IP network written as address/netmask, a wildcard name, a netgroup, or * for all. The manual states that "Wildcard characters generally do not work on IP addresses". No whitespace is allowed between a client and its option list.
  • Which port. The secure option "requires that requests not using gss originate on an Internet port less than IPPORT_RESERVED (1024). This option is on by default. To turn it off, specify insecure."
  • Which path. The manual says each line contains an export point and the clients "allowed to mount the file system at that point". It says "Normally you should only export only the root of a filesystem", and that exporting a subdirectory is allowed but has drawbacks. For a filesystem mounted on another exported filesystem, the nohide entry says a client that mounts only the parent "will see an empty directory" at that place; that is an empty directory, not this refusal.

The nfs(5) manual adds the client side of the port rule. By default the client uses a privileged source port. With noresvport it uses a non-privileged one, and "NFS servers must be configured to allow clients to connect via non-privileged source ports." The same manual says the client tries version 4.2 first and negotiates down, and that nfsvers=n forces a version: if the server does not support it, "the mount request fails".

Likely causes

Cause What you see How to confirm
The export does not name this client's address Refused from some machines and not others exportfs -v on the server lists the clients for the path; the client's address is not covered
The path is not exported, or the export file was changed but not applied Refused for every client The path is missing from exportfs -v; the exports file has it
The client's source port is above 1023 and the export is secure Server log shows a refused request with illegal port The server's rpc.mountd log line, and noresvport in the client's mount options
The client asks for a path the server does not export Refused for that path only Compare the mounted path with the export list in exportfs -v
NFS version differs from what the server offers nfs(5) says only that the mount request fails when the forced version is not supported; whether this exact message appears is not documented Try nfsvers=3 and nfsvers=4.2
Wildcard used on an IP address Rule seems right but never matches The export line uses * inside an address

Prove the cause before changing anything

All of these are read-only.

1. Read the server's log at the time of the attempt. Look for a line from rpc.mountd that says a mount request was refused, and read the reason. The log location depends on your system; on a systemd host, journalctl with the mount daemon's unit shows it.

2. Show what the server exports. On the server:

exportfs -v

The exportfs manual says -v also shows export options when displaying the list. Check the path, each client, and whether the entry says insecure or not.

3. Read the exports files. On the server, read /etc/exports, and the files ending in .exports under /etc/exports.d. The exports(5) manual says those files are read as extra export tables.

4. List exports from the client.

showmount -e nas01

The showmount manual describes -e as showing the server's export list. Its notes say it works "by contacting the server's MNT service directly" and that "NFSv4-only servers have no need to advertise their exported root filehandles via this method, and may not expose their MNT service to clients". If showmount fails against an NFSv4-only server, that tells you nothing about the mount.

5. Try the other versions. Risk: a successful test mounts the real export, and a mount hides whatever the directory held until it is unmounted, so use an empty directory you create for the test, /mnt/test here, and unmount it straight after. A mount can also touch live data if the export is writable, so do not write to it. From the client:

mkdir -p /mnt/test
mount -v -t nfs -o nfsvers=3 nas01:/export/data /mnt/test
mount -v -t nfs -o nfsvers=4.2 nas01:/export/data /mnt/test

The mount manual describes -v as verbose mode. If one version works and the other is refused, the cause is the version or the path form. Unmount /mnt/test after each successful test with umount /mnt/test.

6. Check the client's own options. Read the client's /etc/fstab entry for noresvport.

Fix

Print the current export list and save the server's exports file first:

exportfs -v > /root/exportfs-2026-11-20.txt
cp -a /etc/exports /etc/exports.2026-11-20

If the export you will edit is in a file under /etc/exports.d (a file ending in .exports), copy that file too, for example cp -a /etc/exports.d/name.exports /etc/exports.d/name.exports.2026-11-20, where name.exports is the file you will edit. The copy name ends in a date, not in .exports, and exports(5) says only files ending in .exports in that directory are considered, so the dated copy is not read as an export table.

Disruptive step: changing exports, as the steps below do, can make clients that are already mounted lose their handles. Red Hat says "Share should be unmounted from all the clients before making any configuration changes on the NFS server, else the share will become stale". Plan for the other clients before you edit.

Name the client correctly

Edit the export line so that it lists the client's real address or network, with the options immediately after the client and no space between them, for example /export/data 192.0.2.0/24(rw,sync). Use an address and mask for networks, not wildcards. exports(5) and exportfs(8) document no syntax check for the exports file, so apply it and read the result:

exportfs -ra
exportfs -v

The exports(5) manual says changes apply with exportfs -ra. The exportfs manual describes -r as re-exporting all directories and synchronising the table with /etc/exports. To back out, copy /etc/exports.2026-11-20 over /etc/exports, run exportfs -ra, and read exportfs -v.

Export the path that clients mount

Compare the path the client mounts with the paths in exportfs -v, and correct the client's path or the export line so they agree. exports(5) warns about exporting a subdirectory of a filesystem: a client may reach files outside the exported subdirectory by guessing handles. For NFSv4, exports(5) says one filesystem is "the root of all exported filesystem", set with fsid=root or fsid=0; the path you give the client then depends on that layout.

Port rule

Red Hat's resolution for the illegal port case is to add insecure to the export line in /etc/exports, then run exportfs -rvf to re-export, and to try the mount again. The exportfs manual describes -f as flushing everything out of the kernel's export table, with fresh entries added when clients next mount, so exportfs -ra, the form exports(5) documents, is the gentler choice. Risk: with insecure, the server no longer requires the request to come from a port below 1024 (exports(5)), so a request from an unprivileged process on the client is no longer turned away by this rule. Use it only for clients you trust, preferably limited to one address range. The other route is to remove noresvport from the client's mount options so the client uses a privileged source port. To back out of the server change, copy /etc/exports.2026-11-20 back over /etc/exports (or the saved .exports copy over the file you edited), run exportfs -ra, and read exportfs -v.

Example (illustrative): app01 at 198.51.100.15 runs mount nas01:/export/data /mnt/data and gets mount.nfs: access denied by server while mounting nas01:/export/data. On nas01, exportfs -v lists /export/data for 192.0.2.0/24 only. app01 is on a different network. The administrator saves /etc/exports, adds 198.51.100.15(rw,sync) to the line, runs exportfs -ra, confirms the new client in exportfs -v, and the mount succeeds.

Confirm the fix

  1. exportfs -v on the server lists the path with the client's address.
  2. The mount command succeeds from the failing client, and ls on the mount point shows the files.
  3. Other clients that were already mounted still work, or have been remounted.
  4. The server log shows no new refusals for the client.

What to watch afterwards

  • Keep /etc/exports in change control, with a dated copy before each edit.
  • After a move or a change of client addresses, update the export lists.
  • Record which clients use insecure and why.
  • When an application stops writing to an NFS mount, look for a stale handle as well. See 'NFS "Stale file handle": what changed on the server and how to remount'.

Risks and limits

  • These commands have not been run or lab-tested.
  • The cause of a refusal can also be on the storage or NAS appliance, whose export policies differ from the Linux server rules. Those are not covered.
  • The log path and unit names depend on your distribution.
  • Read-only tests such as showmount -e may not work against NFSv4-only servers.

Sources

  • Mount failed with error, "mount.nfs: access denied by server while mounting" — Red Hat Customer Portal, updated December 29, 2025, accessed 20 November 2026
  • nfs-utils utils/mount/error.c — nfs-utils 3.1.1 source (Debian package 1:3.1.1-1); the sources.debian.org page shows the site stamp "Last update: Fri, 20 Nov 2026 02:14:52 -0000" and the file itself is undated, accessed 20 November 2026
  • exports(5) — nfs-utils manual page, 31 December 2009, accessed 20 November 2026
  • exportfs(8) — nfs-utils manual page, 30 September 2013, accessed 20 November 2026
  • showmount(8) — nfs-utils manual page, 6 October 1993, accessed 20 November 2026
  • nfs(5) — nfs-utils manual page, 9 October 2012, accessed 20 November 2026
  • mount.nfs(8) — nfs-utils manual page as rendered by Arch Linux, 5 Jun 2006, accessed 20 November 2026
  • mount(8) — util-linux 2.43.devel, 2026-08-03, accessed 20 November 2026
  • cp(1) — GNU coreutils 9.11, April 2026, accessed 20 November 2026