From nobody@FreeBSD.org  Tue Dec 16 11:19:45 2008
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 4CABE1065670
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 16 Dec 2008 11:19:45 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21])
	by mx1.freebsd.org (Postfix) with ESMTP id 41BDB8FC20
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 16 Dec 2008 11:19:45 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.14.3/8.14.3) with ESMTP id mBGBJhlG089842
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 16 Dec 2008 11:19:43 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.14.3/8.14.3/Submit) id mBGBJhXR089841;
	Tue, 16 Dec 2008 11:19:43 GMT
	(envelope-from nobody)
Message-Id: <200812161119.mBGBJhXR089841@www.freebsd.org>
Date: Tue, 16 Dec 2008 11:19:43 GMT
From: Alexei Volkov <Alexei.Volkov@softlynx.ru>
To: freebsd-gnats-submit@FreeBSD.org
Subject: gjournal root did not mount on boot
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         129674
>Category:       kern
>Synopsis:       [geom] gjournal root did not mount on boot
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    freebsd-geom
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Dec 16 11:20:01 UTC 2008
>Closed-Date:    
>Last-Modified:  Mon Dec 22 05:30:01 UTC 2008
>Originator:     Alexei Volkov
>Release:        7.1-PRERELEASE
>Organization:
SoftLynx
>Environment:
FreeBSD testhost7.1-PRERELEASE FreeBSD 7.1-PRERELEASE #6 r185330: Wed Nov 26 14:12:01 MSK 2008     root@testhost:/usr/obj/usr/src/sys/GENERIC  amd64

>Description:
Under certain conditions the system did not boot from the single journaled root and fall into 

ad0: 10240MB <QEMU HARDDISK 0.9.1> at ata0-master WDMA2
ad1: 10240MB <QEMU HARDDISK 0.9.1> at ata0-slave WDMA2
GEOM_MIRROR: Device mirror/vol0 launched (1/2).
GEOM_MIRROR: Device vol0: rebuilding provider ad1.
GEOM_JOURNAL: Journal 4069545828: mirror/vol0a contains data.
GEOM_JOURNAL: Journal 4069545828: mirror/vol0a contains journal.
acd0: CDROM <QEMU DVD-ROM/0.9.1> at ata1-master WDMA2
Trying to mount root from ufs:/dev/mirror/vol0a.journal

Manual root filesystem specification:
<fstype>:<device>  Mount <device> using filesystem <fstype>
eg. ufs:da0s1a
?                  List valid disk boot devices
<empty line>       Abort manual input

mountroot> ?

List of GEOM managed disk devices:
mirror/vol0c mirror/vol0b mirror/vol0a mirror/vol0 ad1 ad0

>How-To-Repeat:
Prepare the filesystem as desribed 

gmirror label vol0 /dev/ad0 /dev/ad1

cat <<LABEL >/tmp/label
a:    *     *   unused
b:    1G    *   unused
c:    *     *   unused
LABEL


disklabel -B -R /dev/mirror/vol0 /tmp/label
gjournal label /dev/mirror/vol0a
newfs -J /dev/mirror/vol0a.journal
tunefs -a enable /dev/mirror/vol0a.journal

And install the system to that way prepared root.

After booting into it run

dd if=/dev/random of=/tmp/dump bs=16384

and press reset button.

Repeat the unexpected reset condition until the issue will appeared. In my case there was several attempts before reach the state.

The issue was initially discovered from the real running hardware.


>Fix:
There is no known fix, but some workaround. Boot into any FreeBSD livecd and 

kldload geom_mirror
kldload geom_journal

After the message GEOM_JOURNAL: Journal mirror/vol0a consistent will appear reboot back from HDD.

>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->freebsd-geom 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Thu Dec 18 06:59:08 UTC 2008 
Responsible-Changed-Why:  
Over to maintainer(s). 

http://www.freebsd.org/cgi/query-pr.cgi?pr=129674 

From: "Ulf Lilleengen" <ulf.lilleengen@gmail.com>
To: bug-followup@freebsd.org, Alexei.Volkov@softlynx.ru
Cc:  
Subject: Re: kern/129674: [geom] gjournal root did not mount on boot
Date: Thu, 18 Dec 2008 19:18:14 +0100

 ------=_Part_20526_24415106.1229624294334
 Content-Type: text/plain; charset=UTF-8
 Content-Transfer-Encoding: 7bit
 Content-Disposition: inline
 
 I noticed this line:
 
 GEOM_MIRROR: Device vol0: rebuilding provider ad1.
 
 Does it only happen when this message appears?
 
 -- 
 Ulf Lilleengen
 
 ------=_Part_20526_24415106.1229624294334--

From: Volkov Alexei <Alexei.Volkov@softlynx.ru>
To: bug-followup@FreeBSD.org, Alexei.Volkov@softlynx.ru
Cc:  
Subject: Re: kern/129674: [geom] gjournal root did not mount on boot
Date: Fri, 19 Dec 2008 00:12:57 +0300

 I can not assert that rebuilding mirror is required to bring this issue 
 up, but the same time did not fall in to the issue when the mirror has 
 only one provider.

From: Volkov Alexei <Alexei.Volkov@softlynx.ru>
To: bug-followup@FreeBSD.org, Alexei.Volkov@softlynx.ru
Cc:  
Subject: Re: kern/129674: [geom] gjournal root did not mount on boot
Date: Sun, 21 Dec 2008 22:21:48 +0300

 Yes, there was PR128529 http://www.freebsd.org/cgi/query-pr.cgi?pr=128529
 and it is my fault i did not find it while search around an issue, cause 
 PR128529 marked as fixed (solved) and my expectations were different.
 
 Finally, there is the last question. The PR128529 patch is available for 
 HEAD and direct backport to 7-STABLE is not trivial for me.
 Compiler stops on
 /usr/src/sys/modules/geom/geom_journal/../../../geom/journal/g_journal.c: 
 In function 'g_journal_worker':
 /usr/src/sys/modules/geom/geom_journal/../../../geom/journal/g_journal.c:2111: 
 error: 'struct g_journal_softc' has no member named 'sc_rootmount'
 
 Is there any known fix for 7.X branch?

From: linimon@lonesome.com (Mark Linimon)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/129674: gjournal root did not mount on boot
Date: Sun, 21 Dec 2008 23:25:59 -0600

 ----- Forwarded message from Patrick Lamaizire <patfbsd@davenulle.org> -----
 
 From: Patrick Lamaizire <patfbsd@davenulle.org>
 To: freebsd-bugs@freebsd.org, Alexei Volkov <Alexei.Volkov@softlynx.ru>
 Organization: /dave/nulle
 Cc: 
 Subject: Re: kern/129674: gjournal root did not mount on boot
 
 Looks the same as PR 128529
 http://www.freebsd.org/cgi/query-pr.cgi?pr=128529 
 
 There is a fix for CURRENT:
 http://www.freebsd.org/cgi/cvsweb.cgi/src/sys/geom/journal/g_journal.c#rev1.18
 
 ----- End forwarded message -----
>Unformatted:
