Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 29 Oct 2019 04:49:43 +0000
From:      Rick Macklem <rmacklem@uoguelph.ca>
To:        Alan Somers <asomers@freebsd.org>, Thomas Mueller <mueller6722@twc.com>
Cc:        FreeBSD Net <freebsd-net@freebsd.org>
Subject:   Re: Umounting an NFS-mounted share after connection is lost?
Message-ID:  <YTBPR01MB284546A49CDA2E177D350CB0DD610@YTBPR01MB2845.CANPRD01.PROD.OUTLOOK.COM>
In-Reply-To: <CAOtMX2iUNBW74-aDGuO71qwKCj2FSfj3u6BtXMd8WRd7Bmwqeg@mail.gmail.com>
References:  <5db7a997.1c69fb81.febc8.0d1cSMTPIN_ADDED_MISSING@mx.google.com>, <CAOtMX2iUNBW74-aDGuO71qwKCj2FSfj3u6BtXMd8WRd7Bmwqeg@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Alan Somers wrote:=0A=
=0A=
>On Mon, Oct 28, 2019 at 8:53 PM Thomas Mueller <mueller6722@twc.com> >wrot=
e:=0A=
>=0A=
>> How do you umount a file system that has been mounted with mount_nfs whe=
n=0A=
>> the connection is lost?=0A=
>>=0A=
>> Server can crash, cable modem could quit and not hold power, or a change=
=0A=
>> in cable modem or router could change 192.168.0.1 to 192.168.1.1 .=0A=
>>=0A=
>> Running umount hangs the terminal session.  Is there a way out short of=
=0A=
>> rebooting?=0A=
# umount -N <mount_path>=0A=
- You will lose any outstanding file changes that haven't yet been sent to =
the=0A=
  server. (It may take a couple of minutes to complete.)=0A=
=0A=
>>=0A=
>> In the case of a server crash, I could reboot the server, mount the=0A=
>> desired partition, run "/etc/rc.d/mountd restart", and be good again.=0A=
>>=0A=
>> But last weekend, the cable modem-router lost power, could be restored b=
y=0A=
>> unplugging and replugging, but would only hold for maybe a half minute=
=0A=
>> before going dark again.=0A=
>>=0A=
>> Charter Spectrum support told me that I could get a free replacement,=0A=
>> which I did, cable modem and router were two separate pieces this time.=
=0A=
>>=0A=
>> I was able to install the equipment successfully but noticed that the=0A=
>> router address was 192.168.1.1 rather than the old 192.168.0.1 .=0A=
>>=0A=
>> I was left with /homeawayfromhome that I couldn't unmount except by=0A=
>> rebooting.=0A=
>>=0A=
>> Tom=0A=
>>=0A=
>=0A=
>If you mount your NFS share with the -o intr option, then you can forcibly=
=0A=
>unmount it when the server is unavailable.  However, that's not generally=
=0A=
>recommended.  A lot of applications can't gracefully handle an error in=0A=
>read(2) or write(2).=0A=
Actually "-o intr" allows a process stuck on a wedged NFS server to be kill=
ed=0A=
with <ctrl>C. =0A=
=0A=
To force the dismount, you need the "-N" option on the umount command,=0A=
as noted above. ("-f" won't work reliably for this)=0A=
=0A=
And as Alan noted, a lot of applications won't understand the EINTR failure=
=0A=
for a read/write and any cached writes won't get written to the server and=
=0A=
will be lost, but at least you don't need to reboot.=0A=
=0A=
rick=0A=
=0A=
-Alan=0A=
_______________________________________________=0A=
freebsd-net@freebsd.org mailing list=0A=
https://lists.freebsd.org/mailman/listinfo/freebsd-net=0A=
To unsubscribe, send any mail to "freebsd-net-unsubscribe@freebsd.org"=0A=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?YTBPR01MB284546A49CDA2E177D350CB0DD610>