From owner-freebsd-current@FreeBSD.ORG Sat Nov 17 17:24:13 2007 Return-Path: Delivered-To: current@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 39E6F16A468 for ; Sat, 17 Nov 2007 17:24:13 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from cyrus.watson.org (cyrus.watson.org [209.31.154.42]) by mx1.freebsd.org (Postfix) with ESMTP id 15CDA13C4B8 for ; Sat, 17 Nov 2007 17:24:12 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from fledge.watson.org (fledge.watson.org [209.31.154.41]) by cyrus.watson.org (Postfix) with ESMTP id 36CF146E6C for ; Sat, 17 Nov 2007 12:26:08 -0500 (EST) Date: Sat, 17 Nov 2007 17:23:51 +0000 (GMT) From: Robert Watson X-X-Sender: robert@fledge.watson.org To: current@FreeBSD.org Message-ID: <20071117134709.C73806@fledge.watson.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: Subject: "mount -a -o rdonly" doesn't work (very well) X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Nov 2007 17:24:13 -0000 I noticed this morning while testing some buggy kernel code that a system tested in single-user mode was coming back up with an unclean root file system. Turns out, I'd been running "mount -a -o rdonly" to mount /usr before running tests, and while /usr had come up read-only, the mount command had also remounted / as writable -- not my intended result! I was wondering if someone familiar with the mount flags/etc could take a look at this. Here's the output: (boot single-user) # mount /dev/ad0s1a on / (ufs, local, read-only) devfs on /dev (devfs, local) # mount -a -o rdonly # mount /dev/ad0s1a on / (ufs, local, soft-updates) devfs on /dev (devfs, local) /dev/ad0s1e on /usr (ufs, local, read-only) # mount -a -o rdonly /dev/ad0s1a on / (ufs, loal, read-only, soft-updates) devfs on /dev (devfs, local) /dev/ad0s1e on /usr (ufs, local, read-only) As you can see, a somewhat odd sequence, as first the read only flag is removed from /, and then re-added the second time. Robert N M Watson Computer Laboratory University of Cambridge