# How do I refresh NFS shares?



## mrjayviper (May 8, 2014)

I have started using NFS sharing and have "mapped" an FreeBSD 9.x NFS shared folder on my Mac Pro running 10.9. I renamed a folder (via `mv`) but the folder name in the NFS share is still the old name. I restarted `nfsd` and reloaded `mountd` to no effect. Other than reboot (which may or may not help), what can I do to refresh NFS shares as seen from a client? I searched the net but nothing came up. Thanks 

Thanks 

edit: seems it refreshed now but it took more than an hour to see the new name.


----------



## SirDice (May 8, 2014)

mrjayviper said:
			
		

> I renamed a folder (via `mv`) but the folder name in the NFS share is still the old name.


Have a look at your /etc/exports file. NFS shares are defined there.



> I restarted `nfsd` and reloaded `mountd` to no effect.


If you haven't changed exports(5) nothing will actually change.



> Other than reboot (which may or may not help), what can I do to refresh NFS shares as seen from a client?


After modifying exports(5) a `pkill -HUP mountd && pkill -HUP nfsd` will refresh it.


----------



## acheron (May 8, 2014)

SirDice said:
			
		

> After modifying exports(5) a `pkill -HUP mountd && pkill -HUP nfsd` will refresh it.



There is no need to `pkill -HUP nfsd`


----------



## SirDice (May 9, 2014)

acheron said:
			
		

> SirDice said:
> 
> 
> 
> ...


Did this change some time ago? When I started using NFS many moons ago it certainly was needed. But things may have changed since adding support for NFSv4. Old habits die hard  :e


----------



## acheron (May 9, 2014)

SirDice said:
			
		

> Did this change some time ago? When I started using NFS many moons ago it certainly was needed. But things may have changed since adding support for NFSv4. Old habits die hard  :e


I don't think it has changed since mountd is the one to handle mount requests from client machine and not nfsd (but maybe I'm wrong)


----------



## Snurg (Dec 19, 2020)

Sorry for necromancing, but this page appeared at the top when I asked G**g**.
I did `service nfsd restart`, but `showmount -e server` did not show the updated exports.
Reading the thread, I notice possibly a single `service mountd restart` might have been sufficient.

So nowadays is no need to `pkill -HUP`anymore.

By the way, I'd appreciate if somebody could put me out of moderation.
I will not criticize anything or anybody again.


----------



## SirDice (Dec 20, 2020)

Restarting the service causes it to go offline for a second or so. You will cause disconnects on clients that are already connected. Sending a SIGHUP doesn't kill those sessions.


----------



## Snurg (Dec 20, 2020)

Ohh yes it is good to avoid these disconnects  Thank you!

Not remembering ever having read about the SIGHUPing the servers, I looked into the handbook again.
There is told another "modern official" way instead, `service mountd reload`.

I guess that "reload" will just do that SIGHUP in the background.
This takes away the burden of memorizing the individual ways every service wants to have its configuration reloaded.
So, thumbs up to the people making FreeBSD more and more easy to maintain!


----------

