MacOS – NFS Mount failed and now it says `Device not configured`

macosmountNetworknfs

I have Macbook Pro 2015, running El Capitan 10.11.1 and I am having issues with NFS mounts. I also have an Android TV Box and it mounts NFS without any issues, so I guess the issue is with my laptop. Here is the NFS config(/etc/exports):

/media/mypassport 192.168.2.0/24(insecure,rw,all_squash,anonuid=1000,anongid=1000,no_subtree_check)

When I run showmount:

$ showmount -e rpi

Exports list on rpi:
/media/mypassport                   192.168.2.0/24

I mount from Finder > Go > Connect to Server and enter: nfs://rpi/media/mypassport

This mounts my NFS drive, however sometimes it disconnects and I am not able to remount again. I have to restart my machine and keep trying till it doesn't disconnect.

When I ls into /Volumes I get following error:

$ ls

ls: mypassport: Device not configured
Macintosh HD

Whats the issue here? Why it keeps unmounting or gets disconnected? And how do I remount without restarting?

Best Answer

Restart NFS without Rebooting

Issue the following command in Terminal:

sudo nfsd restart

This has the effect of stopping the NFS daemon, starting it back up, rereading your config and processing what's in your /etc/exports

OS X Disconnecting from NFS

Try this:

find . -name ._* | xargs rm on the R-Pi in the directory that gets mounted. That will remove any of the hidden "_filename" files that OS X creates when going through a directory

Based on this Apple Support Forum with similar symptoms: https://discussions.apple.com/thread/2733032?start=0&tstart=0