Umounting an NFS-mounted share after connection is lost?

Alan Somers asomers at freebsd.org
Tue Oct 29 02:57:29 UTC 2019


On Mon, Oct 28, 2019 at 8:53 PM Thomas Mueller <mueller6722 at twc.com> wrote:

> How do you umount a file system that has been mounted with mount_nfs when
> the connection is lost?
>
> Server can crash, cable modem could quit and not hold power, or a change
> in cable modem or router could change 192.168.0.1 to 192.168.1.1 .
>
> Running umount hangs the terminal session.  Is there a way out short of
> rebooting?
>
> In the case of a server crash, I could reboot the server, mount the
> desired partition, run "/etc/rc.d/mountd restart", and be good again.
>
> But last weekend, the cable modem-router lost power, could be restored by
> unplugging and replugging, but would only hold for maybe a half minute
> before going dark again.
>
> Charter Spectrum support told me that I could get a free replacement,
> which I did, cable modem and router were two separate pieces this time.
>
> I was able to install the equipment successfully but noticed that the
> router address was 192.168.1.1 rather than the old 192.168.0.1 .
>
> I was left with /homeawayfromhome that I couldn't unmount except by
> rebooting.
>
> Tom
>

If you mount your NFS share with the -o intr option, then you can forcibly
unmount it when the server is unavailable.  However, that's not generally
recommended.  A lot of applications can't gracefully handle an error in
read(2) or write(2).

-Alan


More information about the freebsd-net mailing list