From archie@dellroad.org Sun Dec 8 16:45:04 2002 Return-Path: Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0381337B401 for ; Sun, 8 Dec 2002 16:45:04 -0800 (PST) Received: from InterJet.dellroad.org (adsl-63-194-81-26.dsl.snfc21.pacbell.net [63.194.81.26]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0CF6B43EA9 for ; Sun, 8 Dec 2002 16:45:03 -0800 (PST) (envelope-from archie@dellroad.org) Received: from arch20m.dellroad.org (arch20m.dellroad.org [10.1.1.20]) by InterJet.dellroad.org (8.9.1a/8.9.1) with ESMTP id QAA16599 for ; Sun, 8 Dec 2002 16:37:09 -0800 (PST) Received: from arch20m.dellroad.org (localhost [127.0.0.1]) by arch20m.dellroad.org (8.12.6/8.12.6) with ESMTP id gB90aWFF076083 for ; Sun, 8 Dec 2002 16:36:32 -0800 (PST) (envelope-from archie@arch20m.dellroad.org) Received: (from archie@localhost) by arch20m.dellroad.org (8.12.6/8.12.6/Submit) id gB90aWrV076082; Sun, 8 Dec 2002 16:36:32 -0800 (PST) Message-Id: <200212090036.gB90aWrV076082@arch20m.dellroad.org> Date: Sun, 8 Dec 2002 16:36:32 -0800 (PST) From: Archie Cobbs Reply-To: Archie Cobbs To: FreeBSD-gnats-submit@freebsd.org Subject: why does fsck work with / mounted r/o but not growfs? X-Send-Pr-Version: 3.113 >Number: 46110 >Category: bin >Synopsis: [growfs] why does fsck work with / mounted r/o but not growfs? >Confidential: no >Severity: non-critical >Priority: medium >Responsible: freebsd-bugs >State: closed >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Sun Dec 08 16:50:01 PST 2002 >Closed-Date: Sat Jul 30 01:20:25 GMT 2005 >Last-Modified: Sat Jul 30 01:20:25 GMT 2005 >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 In-Reply-To: <200212072033.gB7KXddC072338@arch20m.dellroad.org> Message-ID: <20021208083912.G14505-100000@gamplex.bde.org> To: Archie Cobbs 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: Responsible-Changed-From-To: freebsd-bugs->tomsoft Responsible-Changed-By: kris Responsible-Changed-When: Fri Jul 18 15:18:46 PDT 2003 Responsible-Changed-Why: Assign to growfs maintainer http://www.freebsd.org/cgi/query-pr.cgi?pr=46110 State-Changed-From-To: open->feedback State-Changed-By: linimon State-Changed-When: Thu Aug 26 02:58:18 GMT 2004 State-Changed-Why: Is this still a problem with recent versions of FreeBSD? Responsible-Changed-From-To: tomsoft->freebsd-bugs Responsible-Changed-By: linimon Responsible-Changed-When: Thu Aug 26 02:58:18 GMT 2004 Responsible-Changed-Why: With bugmeister hat on, reassign from inactive committer. http://www.freebsd.org/cgi/query-pr.cgi?pr=46110 State-Changed-From-To: feedback->closed State-Changed-By: kris State-Changed-When: Sat Jul 30 01:20:18 GMT 2005 State-Changed-Why: Feedback timeout http://www.freebsd.org/cgi/query-pr.cgi?pr=46110 >Unformatted: