Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 8 Dec 2002 16:36:32 -0800 (PST)
From:      Archie Cobbs <archie@dellroad.org>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   bin/46110: why does fsck work with / mounted r/o but not growfs?
Message-ID:  <200212090036.gB90aWrV076082@arch20m.dellroad.org>

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

>Number:         46110
>Category:       bin
>Synopsis:       why does fsck work with / mounted r/o but not growfs?
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Sun Dec 08 16:50:01 PST 2002
>Closed-Date:
>Last-Modified:
>Originator:     Archie Cobbs
>Release:        FreeBSD 4.7-STABLE i386
>Organization:
Packet Design
>Environment:
System: FreeBSD arch20m.dellroad.org 4.7-STABLE FreeBSD 4.7-STABLE #0: Sat Nov 23 14:42:21 PST 2002 archie@arch20m.dellroad.org:/usr/obj/usr/src/sys/THINKPAD i386

>Description:

	Tried to use growfs on the / partition when booted in
	single-user mode, while / was still mounted read-only.
	growfs seemed to work. Then I typed "reboot". After the
	reboot, 'df' showed the partition to be the same size
	and things were screwy.

	Suggestion #1: document more clearly in the growfs man
	page that you can't use it on a file system even if that
	file system is mounted read-only.

	Suggestion #2: when growfs runs, check that the file
	system is not already mounted, and return an error if so.

	Suggestion #3: if fsck can work with / mounted read-only,
	why can't growfs?

	Snippet from the freebsd-current thread "backgroud fsck is still
	locking up system"

Date: Sun, 8 Dec 2002 08:54:03 +1100 (EST)
From: Bruce Evans <bde@zeta.org.au>
In-Reply-To: <200212072033.gB7KXddC072338@arch20m.dellroad.org>
Message-ID: <20021208083912.G14505-100000@gamplex.bde.org>
To: Archie Cobbs <archie@dellroad.org>

On Sat, 7 Dec 2002, Archie Cobbs wrote:

> Bruce Evans wrote:
> > Er, it should be obvious that growfs can't reasonably work on the mounted
> > partitions.  growfs.1 doesn't exist, but growfs.8 already has the warning
> > in a general form:
> >
> >      ....  Currently growfs can only enlarge unmounted file systems.  Do not
> >      try enlarging a mounted file system, your system may panic and you will
> >      not be able to use the file system any longer...
>
> Well, I suspected that it might not work... but I would disagree that it
> was *obvious* that it would not work. This was before "mount" had been
> run, so / was supposedly mounted (?) read-only.

Perhaps the unobvious point is that fsck could work.  If the mount is r/w,
then neither growfs nor fsck can even open the partition r/w.  fsck somehow
works in the case of a r/o root, but growfs apparently doesn't.  I think
fsck depends on no other processes making (significant) vfs syscalls for
on the same partition while it is running (even r/o ones might be harmful
if they caused reads of metadata which might be inconsistent).  Then when
fsck has finished it calls mount(... MNT_RELOAD...) to sync the metadata.
growfs doesn't do this, and even if it did it is not clear that it does
all the necessary syncing (growfs may change more or different metadata).
However, I think it does most of the necessary things.

Bruce

>How-To-Repeat:

	See above.

>Fix:


>Release-Note:
>Audit-Trail:
>Unformatted:

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message




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