Linux/nfs: Difference between revisions

From Omnia
Jump to navigation Jump to search
(Created page with "== Restart NFS Client == You forced lazy unmount, but now your dmesg is still filled with: [4321018.374470] nfs: server my-nfs-store not responding, timed out [4321031.750618] nfs: server my-nfs-store not responding, timed out Restart client nfs services: sudo systemctl restart nfs-client.target rpcbind change /etc/fstab to: MYNFSSERVER:/shared_dir /mnt/your_mount_point nfs rw,soft,intr,bg,timeo=100,retrans=2 0 0 • soft: Tells the client to return an I/O e...")
 
No edit summary
Line 1: Line 1:
== Restart NFS Client ==
== Restart NFS Client ==
Stuck nfs:
umount -f -l /nfs-mount


You forced lazy unmount, but now your dmesg is still filled with:
You forced lazy unmount, but now your dmesg is still filled with:
Line 5: Line 8:
  [4321031.750618] nfs: server my-nfs-store not responding, timed out
  [4321031.750618] nfs: server my-nfs-store not responding, timed out


Restart client nfs services:
Method 1: Flush the Kernel RPC State
  sudo systemctl restart nfs-client.target rpcbind
  sudo systemctl restart nfs-client.target rpcbind


change /etc/fstab to:
Method 2: Flush the System Inode & Dentry Caches
sudo sync
sudo echo 2 > /proc/sys/vm/drop_caches
 
Method 3: Temporarily Fake the Network Target (The "Trick" Fix)
# Assign that IP to your loopback interface
sudo ip addr add <SERVER_IP>/32 dev lo
# wait 30 seconds, for it to get rejected, then..
sudo ip addr del <SERVER_IP>/32 dev lo
 
Change /etc/fstab to:
  MYNFSSERVER:/shared_dir  /mnt/your_mount_point  nfs  rw,soft,intr,bg,timeo=100,retrans=2  0  0
  MYNFSSERVER:/shared_dir  /mnt/your_mount_point  nfs  rw,soft,intr,bg,timeo=100,retrans=2  0  0


• soft: Tells the client to return an I/O error to the application after a timeout, instead of hanging forever.
* soft: Tells the client to return an I/O error to the application after a timeout, instead of hanging forever.
• intr: Allows you to interrupt stuck processes (like using Ctrl + C).
* intr: Allows you to interrupt stuck processes (like using Ctrl + C).
• bg: If the server is offline during a system reboot, Ubuntu will mount it in the background instead of stalling your entire boot process.
* bg: If the server is offline during a system reboot, Ubuntu will mount it in the background instead of stalling your entire boot process.
• timeo=100: Sets the timeout to 10 seconds before retrying.
* timeo=100: Sets the timeout to 10 seconds before retrying.

Revision as of 21:36, 3 November 2026

Restart NFS Client

Stuck nfs:

umount -f -l /nfs-mount

You forced lazy unmount, but now your dmesg is still filled with:

[4321018.374470] nfs: server my-nfs-store not responding, timed out
[4321031.750618] nfs: server my-nfs-store not responding, timed out

Method 1: Flush the Kernel RPC State

sudo systemctl restart nfs-client.target rpcbind

Method 2: Flush the System Inode & Dentry Caches

sudo sync
sudo echo 2 > /proc/sys/vm/drop_caches

Method 3: Temporarily Fake the Network Target (The "Trick" Fix)

# Assign that IP to your loopback interface
sudo ip addr add <SERVER_IP>/32 dev lo
# wait 30 seconds, for it to get rejected, then..
sudo ip addr del <SERVER_IP>/32 dev lo

Change /etc/fstab to:

MYNFSSERVER:/shared_dir  /mnt/your_mount_point  nfs  rw,soft,intr,bg,timeo=100,retrans=2  0  0
  • soft: Tells the client to return an I/O error to the application after a timeout, instead of hanging forever.
  • intr: Allows you to interrupt stuck processes (like using Ctrl + C).
  • bg: If the server is offline during a system reboot, Ubuntu will mount it in the background instead of stalling your entire boot process.
  • timeo=100: Sets the timeout to 10 seconds before retrying.