From owner-freebsd-net@freebsd.org Tue Oct 29 04:49:46 2019 Return-Path: Delivered-To: freebsd-net@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 509F8176D54 for ; Tue, 29 Oct 2019 04:49:46 +0000 (UTC) (envelope-from rmacklem@uoguelph.ca) Received: from CAN01-TO1-obe.outbound.protection.outlook.com (mail-eopbgr670084.outbound.protection.outlook.com [40.107.67.84]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail.protection.outlook.com", Issuer "GlobalSign Organization Validation CA - SHA256 - G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 472JzG101Gz41Rt; Tue, 29 Oct 2019 04:49:45 +0000 (UTC) (envelope-from rmacklem@uoguelph.ca) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QPvEegh0634zs2gl2TngcCBeIAuK2LWQJasU6V7MdwkpKBN7qS6cKgEl7eDheoaQ6zUa24vTHLo/QPQ4rBTbn80VRNlMwZmViwAL7NKKs60gQ/ATXLHGiPXh2hWGqnRnpG9GhsIFMKiobBx23PSS86kBzLKJGDPVgVyYMc29/RabSGMq4M8W0/iRmiP9z++de+LLn+yYtGbslbKBchPSGleUusRNwxvVA+7z7aCWY6VJCzZxiOXsS81F9CBDUI3AUfWG3qSrgSiqov9Fs//GZ/9/vxeOz8ZA01bcbgZSBuQQCi/RUaWROZrdb4D8SjcgzG0ctbcai/GUESv1cm7UWA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=LtoD0AU1EsVcJb45KvvDF4rMFXJm3viE2KiHaWK5DcQ=; b=c+oYuSxsEfrGzmpVv3C1CD08lsHmhqTZf0Fx+oEdoXoUwhbkHZ8RkHNgfunlO2QGt9CGFAlAGums3Sn2AdXwP/FRn7NoU/Rq8OKd/jT0jE8FW3pvnQ09+7wIuGtVd1sjYl/Q3qHPqbMbiH3p7rZMUC33skbAJQowqlo9iMrm0VWm0cOUWZRQbS5pGJ1qPnKhBoLTKieAiKvaF0EMYZifUtF1cPY46oWgH9GQVwB/d3PNUBqusPw+DEqIxFWZhfm0XMdZp/wq0hVtSQdvqmraHzyrOco54u65MDGsP1rA6uCJ/3dNnu+nP2z0Qi6gWXC7k9sdphCTxZrx0QZEMw2DIw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=uoguelph.ca; dmarc=pass action=none header.from=uoguelph.ca; dkim=pass header.d=uoguelph.ca; arc=none Received: from YTBPR01MB2845.CANPRD01.PROD.OUTLOOK.COM (10.255.13.156) by YTBPR01MB2717.CANPRD01.PROD.OUTLOOK.COM (10.255.12.26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2408.17; Tue, 29 Oct 2019 04:49:44 +0000 Received: from YTBPR01MB2845.CANPRD01.PROD.OUTLOOK.COM ([fe80::45c3:a411:3ee8:a12e]) by YTBPR01MB2845.CANPRD01.PROD.OUTLOOK.COM ([fe80::45c3:a411:3ee8:a12e%5]) with mapi id 15.20.2387.027; Tue, 29 Oct 2019 04:49:44 +0000 From: Rick Macklem To: Alan Somers , Thomas Mueller CC: FreeBSD Net Subject: Re: Umounting an NFS-mounted share after connection is lost? Thread-Topic: Umounting an NFS-mounted share after connection is lost? Thread-Index: AQHVjgSdm6U3QW1VD0O1ny/4bAcMSKdxCndI Date: Tue, 29 Oct 2019 04:49:43 +0000 Message-ID: References: <5db7a997.1c69fb81.febc8.0d1cSMTPIN_ADDED_MISSING@mx.google.com>, In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [2001:569:fac0:e900:9da9:2b52:2595:9095] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: a3578083-70d1-49ea-a666-08d75c2b6ac3 x-ms-traffictypediagnostic: YTBPR01MB2717: x-ms-exchange-purlcount: 1 x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:9508; x-forefront-prvs: 0205EDCD76 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(366004)(396003)(136003)(39860400002)(376002)(346002)(189003)(199004)(33656002)(7696005)(6246003)(76176011)(5660300002)(66574012)(55016002)(8676002)(71200400001)(71190400001)(316002)(786003)(110136005)(486006)(11346002)(8936002)(14454004)(6306002)(9686003)(446003)(305945005)(81166006)(476003)(81156014)(4326008)(6116002)(966005)(6436002)(478600001)(2906002)(46003)(66946007)(86362001)(74316002)(229853002)(66446008)(64756008)(25786009)(66476007)(66556008)(91956017)(76116006)(6506007)(52536014)(102836004)(186003)(7736002)(14444005)(256004)(99286004); DIR:OUT; SFP:1101; SCL:1; SRVR:YTBPR01MB2717; H:YTBPR01MB2845.CANPRD01.PROD.OUTLOOK.COM; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: uoguelph.ca does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 1fiDiwt9rRfKYOa+Swm9BexDs1Ouy+WUfp/bLSEvz8pcC5Y+gyHdC8zchz7H44aszB0dJQdcLdXgDurm24XqkDiZ0k9ikGrjjK6ApDg1KFQFXzqUxptpFhRu9RjNKL59ATYrXXyLDBRWmk3vEe2ccwbJ0s0QpMfdJqjReatkcT87DvcsiOI9oJ0jzkpmPnuCcMfphjkXdTONLKR3eSInrhfeKfNbqLAxC87yUcQ7rvgCZfSfUl/LefFFVgxnam29syvWn0wkebKYCcOVjk5shsrZBoYnJgHrnibCxmfEtsQ8MFj+ilo6eU+XpCk37dAM2EEMtVwDUiyJC+NwnAZFp5Kg1jGhoxU1QiHBi8PFMSVFDQcHlF4V2Wgodqij0X8ZCFmDJyGaxufLog7VLJwDYPGoJq7qlC4gsnLYco3GGOBT/1TUcwxD0JyyMvqB0I++D84teSYIcfK7pWON82YfS+CUl65IwsK7pa5oDoVwa/w= x-ms-exchange-transport-forked: True Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: uoguelph.ca X-MS-Exchange-CrossTenant-Network-Message-Id: a3578083-70d1-49ea-a666-08d75c2b6ac3 X-MS-Exchange-CrossTenant-originalarrivaltime: 29 Oct 2019 04:49:43.9731 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: be62a12b-2cad-49a1-a5fa-85f4f3156a7d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: 7m0Yrq83q1I8kq05Kf31+HQqdw7CoZW1p2f8LBBkrWcpzA3/7zwPbvP5bHZ9cvx+kK87w7LfAHB7heJVokc5XA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: YTBPR01MB2717 X-Rspamd-Queue-Id: 472JzG101Gz41Rt X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-5.99 / 15.00]; NEURAL_HAM_MEDIUM(-0.99)[-0.994,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Oct 2019 04:49:46 -0000 Alan Somers wrote:=0A= =0A= >On Mon, Oct 28, 2019 at 8:53 PM Thomas Mueller >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 =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 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=