Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 17 Nov 2007 17:23:51 +0000 (GMT)
From:      Robert Watson <rwatson@FreeBSD.org>
To:        current@FreeBSD.org
Subject:   "mount -a -o rdonly" doesn't work (very well)
Message-ID:  <20071117134709.C73806@fledge.watson.org>

next in thread | raw e-mail | index | archive | help

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



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