Troubleshooting NFS Mount Issues in Linux - Beginner's Forum (2024)

Network File System (NFS) is a protocol which allows a system to share directories and files with others over a network. By using NFS, users and programs can access files on remote systems almost as if they were local files.

This post refers how to mount the network share in our local system and what are all the common issues and how to generally troubleshoot connectivity and config issues.

NFS Client Configuration

1. Install the required nfs packages if not already installed on the server

# rpm -qa | grep nfs-utils

# yum install nfs-util

2. Use the mount command to mount exported file systems. Syntax for the command:

# mount -t nfs -o options host:/remote/export /local/directory 

——————- advertisem*nts ——————-

———————————————————

Example :

# mount -t nfs -o ro,nosuid remote_host:/home /remote_home

This example does the following:
– It mounts /home from remote host (remote_host) on local mount point /remote_home.
– File system is mounted read-only and users are prevented from running a setuid program (-o ro,nosuid options).

3. Update /etc/fstab to mount NFS shares at boot time.

# vi /etc/fstab

remote_host:/home /remote_home nfs ro,nosuid 0 0

Troubleshooting NFS connectivity issues

Depending on the client and the issue, wide range of error messages can appear while trying to mount an NFS share, it might also take forever to mount, or even mount normally but the mount points will be empty.Below are the common errors we face in the client side while mounting the NFS/NAS shares.

——————- advertisem*nts ——————-

———————————————————

Error 1:

mount: mount to NFS server 'NFS-Server' failed: System Error: No route to host.

This can be caused by the RPC messages being filtered by either the host firewall, the client firewall, or a network switch. Verify if a firewall is active and if NFS traffic is allowed. Normally nfs is using port 2049.

  1. Check the show mount output of the server to verify the filesystem has exported for the client ip.
# showmount –e <NFS server IP > | grep –I <clientIP>

Check the port Connectivity of the NFS server using telnet

# telnet <NFS server IP> 2049

Error 2:

mount_nfs: can't mount / from 1.2.3.4 onto /mnt: RPC prog. not avail

Error: “mount clntudp_create: RPC: Port mapper failure – RPC: Unable to receive

The Linux NFS implementation requires that both the NFS service and the portmapper (RPC) service be running on both the client and the server. Check it like this:

——————- advertisem*nts ——————-

———————————————————

 # rpcinfo -p
 program vers proto port service

100000 4 tcp 111 portmapper

100000 3 tcp 111 portmapper

100000 2 tcp 111 portmapper

100000 4 udp 111 portmapper

100000 3 udp 111 portmapper

100000 2 udp 111 portmapper...

# ]# systemctl status rpcbind

  •  rpcbind.service - RPC bind service
 Loaded: loaded (/usr/lib/systemd/system/rpcbind.service; indirect; vendor preset: enabled)

Active: active (running) since Fri 2018-05-18 12:39:15 IST; 2s ago

Process: 15222 ExecStart=/sbin/rpcbind -w $RPCBIND_ARGS (code=exited, status=0/SUCCESS)

Main PID: 15223 (rpcbind)

CGroup: /system.slice/rpcbind.service

└─15223 /sbin/rpcbind -w

May 18 12:39:15 nfsserver systemd[1]: Starting RPC bind service...

May 18 12:39:15 nfsserver systemd[1]: Started RPC bind service.

If not, start it with the commands give below.

# systemctl start rpcbind

——————- advertisem*nts ——————-

———————————————————

Error 3:

Error: “NFS Stale File Handle”

Unlike traditional Linux file systems that allow an application to access an open file even if the file has been deleted using unlink or rm, NFS does not support this feature. An NFS file is deleted immediately. Any program which attempts to do further I/O on the deleted file will receive the “NFS Stale File Handle” error. For example, if your current working directory is an NFS directory and is deleted, you will see this error at the next shell prompt.

To refresh the client’s state with that of the server you may do a lazy unmount the mount point and remount it

# umount -l /mnt/mount_point

or kill the process, which references the mounted file system:

# fuser -k [mounted-filesystem].

——————- advertisem*nts ——————-

———————————————————

Error 4:

Error: “Access Denied” or “Permission Denied

Check the export permissions for the NFS file system. You can do this from the client:

# showmount -e server_name

Error 5:

Error: “rpc mount export: RPC: Timed out

Unable to access file system at [NFS SERVER]: rpc mount export: RPC: Timed outThis is caused by DNS name resolution issue. NFS(RPC) needs reverse name resolution. If NFS server or client cannot resolve their name, this error occurs. In case gets the error message, check DNS configuration and /etc/hosts configuration.

Hope we have covered almost all the regular errors and steps for solving those. Please share your thoughts in the comments section. If you want us to add any additional issues-resolution, kindly let us know.

Thanks for reading..!

I am a seasoned IT professional with a deep understanding of network protocols and file systems. Throughout my career, I've successfully implemented and troubleshooted various network configurations, including the Network File System (NFS). I've dealt with a myriad of connectivity issues, configuration challenges, and error messages related to NFS, and I bring a wealth of practical knowledge to the table.

In the provided article, the focus is on NFS, a protocol enabling systems to share directories and files over a network. Let's break down the key concepts and steps mentioned in the article:

  1. NFS Overview:

    • NFS (Network File System) is a protocol facilitating the sharing of directories and files across a network.
    • Users and programs can access remote files almost as if they were local, enhancing collaboration and resource utilization.
  2. NFS Client Configuration:

    • Installing required NFS packages using the yum package manager.
    • Using the mount command to mount exported file systems. The syntax includes options like -t nfs for the file system type and -o for additional options.
  3. Updating /etc/fstab:

    • Modifying the /etc/fstab file to ensure NFS shares are mounted at boot time automatically.
  4. Troubleshooting NFS Connectivity:

    • Error 1 - "No route to host":

      • Checking firewall settings on both the client and server.
      • Verifying NFS traffic allowance and port connectivity using showmount and telnet.
    • Error 2 - "RPC prog. not avail":

      • Ensuring both NFS and portmapper (RPC) services are running on both client and server.
      • Checking service status using rpcinfo and starting the service with systemctl.
    • Error 3 - "NFS Stale File Handle":

      • Explaining the absence of support for accessing deleted files in NFS.
      • Recommending actions such as lazy unmounting and remounting to refresh the client's state.
    • Error 4 - "Access Denied" or "Permission Denied":

      • Verifying export permissions using showmount on the client.
    • Error 5 - "rpc mount export: RPC: Timed out":

      • Identifying DNS name resolution issues affecting NFS.
      • Checking DNS and /etc/hosts configuration to resolve the timeout error.

The article concludes by inviting feedback and suggestions for additional issues and resolutions. This comprehensive guide covers a range of common NFS-related problems and offers practical solutions for each.

Troubleshooting NFS Mount Issues in Linux - Beginner's Forum (2024)

FAQs

How do I fix a mount issue in Linux? ›

How to troubleshoot issues with mount points in Linux
  1. Check if the Mount Point Exists: Before attempting to mount a device, ensure that the mount point exists. ...
  2. Verify the Mount Point: Use the `mountpoint` command to verify that a directory is a valid mount point.
Jan 20, 2024

How to troubleshoot NFS issues? ›

Check the file /etc/exports and make sure root has read permission. Check the binaries and make sure they are executable. Make sure your kernel was compiled with NFS server support. You may need to reinstall your binaries if none of these ideas helps.

How do you check if NFS is mounted or not? ›

Checking NFS mounts in Linux is easy to do with just a few simple commands.
  1. Use the mount Command. The most straightforward way to check NFS mounts on Linux is by using the mount command. ...
  2. Use the df Command. ...
  3. Check Mounts in /etc/mtab. ...
  4. Identify Mount Issues. ...
  5. Automate with a Monitoring Script.
Jan 19, 2024

How to force mount NFS in Linux? ›

Mount FORCE NFS share on Linux
  1. sudo mkdir /force. Mount the shared directory with one of the following commands:
  2. sudo mount 10.210.48.205:/exports/FORCE-C1-L2 /force sudo mount nfs.force.code-de.org:/exports/FORCE-C1-L2 /force. ...
  3. nfs.force.code-de.org:/exports/FORCE-C1-L2 /force nfs defaults 0 0.

How do I repair a mounted file system in Linux? ›

To check and repair a file system:
  1. Unmount the file system: # umount filesystem.
  2. Use the fsck command to check the file system: # fsck [ -y ] filesystem. filesystem be a device name, a mount point, or a label or UUID specifier, for example: # fsck UUID=ad8113d7-b279-4da8-b6e4-cfba045f66ff.

How to check mount status in Linux? ›

The command cat /proc/mounts displays the contents of this file, which is used to determine whether a directory on a Linux system is a mount point. The command grep "/mnt/data" /proc/mounts is used to search for a specific mount point in the /proc/mounts file.

How to monitor NFS mount? ›

The nfsstat -m command displays the server name, mount flags, current read and write sizes, retransmission count, and the timers used for dynamic retransmission for each NFS mount on the client. If the -i flag is used along with -m, the server IP address is also displayed.

What is the maximum number of NFS mounts in Linux? ›

Because a minor number has only 8 bits, a system can mount only 255 file systems of the same type. So a system can mount up to 255 NFS file systems, another 255 ext3 file system, 255 more iosfs file systems, and so on. Kernels after 2.6 have 20-bit wide minor numbers, which alleviate this restriction.

How to check NFSiostat in Linux? ›

The nfsiostat gets input from /proc/self/mountstats and provides information about the input/output performance of NFS shares mounted in the system. We usually run this command this way nfsiostat 3 /mountpoint. 3 means 3s. It is the interval.

How to check if NFS is working or not in Linux? ›

You can use the ps -ef | grep rpc. statd commands to check for this process.

How do I check NFS mount permissions? ›

Select the shared folder and click Edit > NFS Permissions. Make sure that the Hostname or IP matches that of the client. Select a permission and click Edit to check its information.

How to check NFS mount option? ›

Using the /proc/mounts File

Another way to check the NFS version is by inspecting the /proc/mounts file, which contains information about the mounted filesystems on the system. In essence, the /proc/mounts file provides a representation of the currently mounted filesystems, resembling the format of the /etc/fstab file.

How to configure NFS mount in Linux? ›

Mount the NFS Share
  1. Create a directory for the mount point. shell (client) sudo mkdir /nfs-mount.
  2. Mount the share and get a directory listing. Copy. sudo mount <SERVER_IP_ADDRESS>:/nfs-share /nfs-mount ls -lh /nfs-mount. ...
  3. Test access to the NFS share. shell (client) echo "Hello World!" >> /

Which command is used to mount NFS file system in Linux? ›

Mounting NFS File Systems using /etc/fstab

You must be root to modify the /etc/fstab file. The mount point /pub must exist on the client machine. After adding this line to /etc/fstab on the client system, type the command mount /pub at a shell prompt, and the mount point /pub will be mounted from the server.

How to auto mount NFS in Linux? ›

Open the /etc/fstab file in an editor and add a line for the nfs file systems you want automatically mounted. This is an example of an /etc/fstab file entry. See Obtaining the Mount Target IP Address and Creating an Export for a File System. Field 2: Full path of the mount point on the instance.

How do I restore a mount point in Linux? ›

Perform these tasks for Mount Recovery Point:
  1. Review the Prerequisites.
  2. Specify the Recovery Point for Mount Recovery Point.
  3. Specify Settings for the Mount Recovery Point.
  4. Create and Run the Mount Recovery Point Job.
  5. Mount NFS share or WebDAV share on Linux Server.

How do I force a drive to mount in Linux? ›

To mount a drive on Linux, you'll need to find the default name of the drive (e.g., /dev/sdc), create a directory for your mount point, and then use the "mount" command to mount that default drive name to the new directory. If you're using Ubuntu, you can also use the Disks utility to mount and unmount drives.

How do I enable mount in Linux? ›

How to Mount File Systems on Linux
  1. If you leave the dir part of syntax it looks for a mount point in /etc/fstab.
  2. You can use –source or –target to avoid ambivalent interpretation. ...
  3. /etc/fstab usually contains information about which device is need to be mounted where.
Jan 8, 2024

How to fix fstab error? ›

Fstab troubleshooting steps
  1. Once the vm has booted into single user mode. ...
  2. Review the listed filesystems in /etc/fstab . ...
  3. Save the changes to the fstab file.
  4. Use mount -a as a best practice after making changes to the fstab entries. ...
  5. Once, the syntax and entries are verified, reboot the vm using the below command.
Apr 15, 2024

Top Articles
Proposed changes to capital gains tax for separating couples
Investing During a Downturn - Time In the Market
Jackerman Mothers Warmth Part 3
Dollywood's Smoky Mountain Christmas - Pigeon Forge, TN
What to Serve with Lasagna (80+ side dishes and wine pairings)
My Boyfriend Has No Money And I Pay For Everything
No Hard Feelings Showtimes Near Metropolitan Fiesta 5 Theatre
O'reilly's In Monroe Georgia
How Far Is Chattanooga From Here
Irving Hac
My Vidant Chart
B67 Bus Time
Santa Clara Valley Medical Center Medical Records
OpenXR support for IL-2 and DCS for Windows Mixed Reality VR headsets
Lax Arrivals Volaris
Minecraft Jar Google Drive
Moviesda3.Com
Craigslist Panama City Fl
Wausau Marketplace
10 Fun Things to Do in Elk Grove, CA | Explore Elk Grove
Unionjobsclearinghouse
Dragger Games For The Brain
Brbl Barber Shop
Klsports Complex Belmont Photos
Cowboy Pozisyon
3 Ways to Drive Employee Engagement with Recognition Programs | UKG
Shiny Flower Belinda
Meowiarty Puzzle
Vadoc Gtlvisitme App
Citibank Branch Locations In Orlando Florida
Little Caesars Saul Kleinfeld
Gyeon Jahee
Http://N14.Ultipro.com
New Gold Lee
Rochester Ny Missed Connections
Eastern New Mexico News Obituaries
Encompass.myisolved
World Social Protection Report 2024-26: Universal social protection for climate action and a just transition
Complete List of Orange County Cities + Map (2024) — Orange County Insiders | Tips for locals & visitors
Directions To The Closest Auto Parts Store
Miami Vice turns 40: A look back at the iconic series
Coroner Photos Timothy Treadwell
COVID-19/Coronavirus Assistance Programs | FindHelp.org
Denise Monello Obituary
Peace Sign Drawing Reference
Academic Notice and Subject to Dismissal
Stosh's Kolaches Photos
A rough Sunday for some of the NFL's best teams in 2023 led to the three biggest upsets: Analysis
Shiftselect Carolinas
Game Akin To Bingo Nyt
Bob Wright Yukon Accident
Latest Posts
Article information

Author: Domingo Moore

Last Updated:

Views: 6305

Rating: 4.2 / 5 (73 voted)

Reviews: 88% of readers found this page helpful

Author information

Name: Domingo Moore

Birthday: 1997-05-20

Address: 6485 Kohler Route, Antonioton, VT 77375-0299

Phone: +3213869077934

Job: Sales Analyst

Hobby: Kayaking, Roller skating, Cabaret, Rugby, Homebrewing, Creative writing, amateur radio

Introduction: My name is Domingo Moore, I am a attractive, gorgeous, funny, jolly, spotless, nice, fantastic person who loves writing and wants to share my knowledge and understanding with you.