From owner-freebsd-questions@FreeBSD.ORG Fri Feb 18 14:46:48 2005 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4EE5116A4CE for ; Fri, 18 Feb 2005 14:46:48 +0000 (GMT) Received: from corbulon.video-collage.com (static-151-204-231-237.bos.east.verizon.net [151.204.231.237]) by mx1.FreeBSD.org (Postfix) with ESMTP id A7F6143D46 for ; Fri, 18 Feb 2005 14:46:47 +0000 (GMT) (envelope-from mi@corbulon.video-collage.com) Received: from corbulon.video-collage.com (mi@localhost.video-collage.com [127.0.0.1])j1IEkkla091998 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Fri, 18 Feb 2005 09:46:46 -0500 (EST) (envelope-from mi@corbulon.video-collage.com) Received: (from mi@localhost) by corbulon.video-collage.com (8.13.1/8.13.1/Submit) id j1IEkkOW091997 for questions@FreeBSD.org; Fri, 18 Feb 2005 09:46:46 -0500 (EST) (envelope-from mi) From: Mikhail Teterin Message-Id: <200502181446.j1IEkkOW091997@corbulon.video-collage.com> To: questions@FreeBSD.org Date: Fri, 18 Feb 2005 09:46:46 -0500 (EST) X-Mailer: ELM [version 2.5 PL7] MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Virus-Scanned: clamd / ClamAV version devel-20040615, clamav-milter version 0.73a on corbulon.video-collage.com X-Virus-Status: Clean X-Scanned-By: MIMEDefang 2.43 Subject: can not remount an FS read-only X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Feb 2005 14:46:48 -0000 Hello! My /opt filesystem (playing both LOCALBASE and X11BASE) is normally mounted read-only (not so much for security even, as for safety). When I add/remove ports, I remount it read-write: mount -orw -u /opt do, what I need and then remount it back `ro'. This works most of the times, but sometimes, like today (after /opt was "open" for some time), mount responds with EBUSY: mount: /dev/da0s2f: Device busy According to fstat, out of 134 files opened under /opt: fstat | fgrep -c /opt 134 NONE is opened for writing: fstat | fgrep /opt | grep -c 'w$' 0 Is there a bug in the open-file counter somewhere, or is fstat not telling me the whole story? In the past, trying to force the read-only mount (-f) caused quite a few processes to segfault (sometimes including X-server). Thanks! -mi P.S. I've seen this on both 4- and 5-stable.