From owner-freebsd-current@FreeBSD.ORG Tue Jun 19 22:46:23 2007 Return-Path: X-Original-To: freebsd-current@freebsd.org Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B948716A400 for ; Tue, 19 Jun 2007 22:46:23 +0000 (UTC) (envelope-from nike_d@cytexbg.com) Received: from sellinet.net (galileo.sellinet.net [82.199.192.2]) by mx1.freebsd.org (Postfix) with SMTP id 11B3313C447 for ; Tue, 19 Jun 2007 22:46:22 +0000 (UTC) (envelope-from nike_d@cytexbg.com) Received: (qmail 1726 invoked by uid 1009); 20 Jun 2007 01:46:21 +0300 Received: from nike_d@cytexbg.com by galileo by uid 1002 with qmail-scanner-1.22 (spamassassin: 3.0.3. Clear:RC:1(82.199.197.152):. Processed in 0.027494 secs); 19 Jun 2007 22:46:21 -0000 Received: from unknown (HELO ndenev.totalterror.net) (82.199.197.152) by galileo.sellinet.net with SMTP; 20 Jun 2007 01:46:21 +0300 Received: (qmail 45642 invoked from network); 20 Jun 2007 01:34:34 +0300 Received: from unknown (HELO ?127.0.0.1?) (127.0.0.1) by ndenev.totalterror.net with SMTP; 20 Jun 2007 01:34:34 +0300 Message-ID: <467859FA.5050203@cytexbg.com> Date: Wed, 20 Jun 2007 01:34:34 +0300 From: Niki Denev User-Agent: Thunderbird 1.5.0.10 (X11/20070326) MIME-Version: 1.0 To: freebsd-current@freebsd.org References: <4666D696.4080908@totalterror.net> <20070607091739.GJ7666@obelix.dsto.defence.gov.au> <46682F9F.9090204@totalterror.net> <466D1B2E.5020800@totalterror.net> In-Reply-To: <466D1B2E.5020800@totalterror.net> X-Enigmail-Version: 0.94.3.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: gjournal + WARNING: R/W mount of / denied. Filesystem not clean - run fsck. 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: Tue, 19 Jun 2007 22:46:23 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Niki Denev wrote: > Niki Denev wrote: >> Wilkinson, Alex wrote: >>> 0n Wed, Jun 06, 2007 at 06:45:26PM +0300, Niki Denev wrote: >>> > I have the following problem when using gjournal for the root filesystem on my laptop (Sony VAIO PCG-U3) >>> > If there is a unclean shutdown (hard poweroff/ kernel panic) on the next boot the machine starts to load normally, >>> > i have messages as : >>> > >>> > GEOM_JOURNAL: Journal ad0s1a consistent. >>> > Trying to mount root from ufs:/dev/ad0s1a.journal >>> > WARNING: / was not properly dismounted >>> > >>> > Then the system continues with executing fsck in preen mode (fsck -p), >>> > which reports : >>> > /dev/ad0s1a.journal: FILESYSTEM CLEAN; SKIPPING CHECKS >>> > and fsck returns with zero, but after this when a read/write mount is tried the >>> > system barfs this : >>> > >>> > WARNING: R/W mount of / denied. Filesystem not clean - run fsck. >>> > mount: : Operation not permitted >>> Make sure your "Pass" column is correct in fstab(5). >>> -aW >>> IMPORTANT: This email remains the property of the Australian Defence Organisation and is subject to the jurisdiction of section 70 of the CRIMES ACT 1914. If you have received this email in error, you are requested to contact the sender and delete the email. > > >> What do you mean by correct? Right now it's the default for root >> filesystems "1". Is there a special setting needed for gjournaled >> filesystems? > > > > Well, i still can't find a way to make my system skip fsck on unclean > shutdown/reboot. > The strange thing is that "fsck -p" reports that the filesystem is > clean, but the kernel refuses to mount it r/w with the message "WARNING: > R/W mount of / denied. Filesystem is not clean - run fsck" > > I guess i'm doing something wrong.. just can't see what it is.. any > ideas are appreciated. > > Thanks. > > I think that i tracked down the problem. When fsck_ffs runs on dirty gjournaled filesystem in preen mode, it checks it correctly, and marks it clean but exits too soon and does not call mount with MNT_RELOAD so the superblock is not being reread from the disk and the kernel still thinks that the filesystem is dirty, alshough on-disk it has been marked clean. My quick and dirty hack was instead of just calling exit(0) in src/sbin/fsck_ffs/main.c::checkfilesys() after the call to gjournal_check(), i do a nasty goto to the end of the function where there is additional code which checks if the filesystem is mounted, and if it is, then it tries to reload the superblock and the other disk/fs data. Ideally this could be done better :) I'll try to come up with something and file a PR if someone doesn't read this and make a better fix. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7 (FreeBSD) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFGeFn6HNAJ/fLbfrkRAqgxAKC6RAi/NZOqU6ht2uun9r1efhJKkwCdF59S WW6+iPecm5bDbuq5+ygeeLY= =54UK -----END PGP SIGNATURE-----