Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 23 Jan 2007 09:19:59 +0100 (CET)
From:      Oliver Fromme <olli@lurza.secnetix.de>
To:        freebsd-hackers@FreeBSD.ORG, freebsd-geom@FreeBSD.ORG, vd@FreeBSD.ORG, xride@x12.dk, silby@silby.com
Subject:   Re: Where to start?
Message-ID:  <200701230819.l0N8Jxrm003876@lurza.secnetix.de>
In-Reply-To: <20070122083727.GA61615@qlovarnika.bg.datamax>

next in thread | previous in thread | raw e-mail | index | archive | help
Vasil Dimov wrote:
 > Mike Silbersack wrote:
 > > Soeren Straarup wrote:
 > > [...]
 > > > I'm looking for a project.
 > > [...]
 > > I'd like to see the ability to run gjournal without reformatting.
 > > If you could create a dummy file inside the filesystem, then use
 > > that area for the journal, it might be possible.  I'm sure that
 > > would let a lot more people see if journalling is right for them.
 > 
 > I am not sure about gjournal internals but what if a system crash
 > occurs in the middle of a transaction and the fs gets corrupted and
 > the data, necessary to fix it is in the journal, but you cannot
 > access the journal because the file, which contains the journal,
 > is on a corrupted fs?

I think you should still be able to mount the file system
read-only, even if it's not "clean", so there's no problem
locating the journal file.  Particularly, note that the
journal file should probably be located in the root of the
file system, and it will have a constant size and should
be allocated from the start (i.e. it never grows nor
changes allocation), which means there is no way that its
meta data could be damaged.

On the other hand, _if_ the file system is so seriously
busted that the journal file could not be located or used
anymore, then it's probably a sign of physical damage, and
in that case the journal wouldn't be able help you anyway.
Journalling is only able to fix things after "regular"
crashes.

Disclaimer:  I'm not a GEOM code expert.  Someone please
correct me if I'm wrong.

BTW, I've just got an idea.  Wouldn't it be possible to
set up a "journal file" in a similar manner as you set up
a swap file?  That is, you create a sufficiently large
file with dd(1) from /dev/zero, then run vnconfig(8) to
create an md(4) device for it, then -- instead of running
swapon(8) -- you enable journalling, using that file for
the journal.  I'm aware that this doesn't currently work
out of the box, and there's a hen-and-egg problem during
boot when fsck+mount is to be run.  But I think it should
be possible to make it work without too much trouble.

Best regards
   Oliver

PS:  I've set reply-to to the freebsd-geom list.  I think
it is more appropriate than -hackers.

-- 
Oliver Fromme,  secnetix GmbH & Co. KG, Marktplatz 29, 85567 Grafing
Dienstleistungen mit Schwerpunkt FreeBSD: http://www.secnetix.de/bsd
Any opinions expressed in this message may be personal to the author
and may not necessarily reflect the opinions of secnetix in any way.

"C++ is the only current language making COBOL look good."
        -- Bertrand Meyer



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