From: Theodore Tso <tytso@MIT.EDU>
To: Alberto Bertogli <albertito@blitiri.com.ar>
Cc: linux-ext4@vger.kernel.org, linux-mm-cc@lists.laptop.org,
dm-devel@redhat.com
Subject: Re: jbd2 inside a device mapper module
Date: Wed, 24 Dec 2008 18:49:15 -0500 [thread overview]
Message-ID: <20081224234915.GA23723@mit.edu> (raw)
In-Reply-To: <20081224211038.GT4127@blitiri.com.ar>
On Wed, Dec 24, 2008 at 07:10:38PM -0200, Alberto Bertogli wrote:
>
> I'm writing a small device mapper module, and I'm interested in placing
> a jbd/jdb2 journal on the backing device.
>
> I started by trying to do a __bread() manually (just for early tests)
> inside my map function. But it got stucked, as far as I could see,
> waiting for a buffer head in wait_on_buffer() IIRC (I could track it
> down again if it's needed). And I couldn't find why it was locked, since
> it was an unused loopback device, and my code didn't even deal with
> buffer heads.
I have no idea why you would need to do manual __breads(). No doubt
I'm missing some context here.
> Then, since I was planning on using jbd/jdb2 anyway, I decided to use it
> (and went for jbd2).
>
> Now, I'm having issues with journal creation.
>
> I tried using "mkfs.ext3 -O journal_dev", but jbd2_journal_load()
> complains that it can't find the journal superblock.
So I'll tell you how to do this via simple hard drives, and you can
figure out how to make it work with dm. Note that if the journal
device isn't on a stand-alone spindle, it's probably not going to help
you. The whole point of using an external journal device is to avoid
the seeking on the journal device, or to take advantage of the speed
of a battery-backed NVRAM device. I'm not sure how much sense it
makes to use dm-based external journal device.... what exactly do you
hope to achieve.
To create an external journal device on the device /dev/sda:
mke2fs -O journal_dev /dev/sda
To create a new filesystem on /dev/sdb1 that will use the external
journal found on /dev/sda:
mke2fs -j -J device=/dev/sda /dev/sdb1
- Ted
P.S. All of this is in the mke2fs man page....
next prev parent reply other threads:[~2008-12-24 23:52 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-12-24 21:10 jbd2 inside a device mapper module Alberto Bertogli
2008-12-24 22:38 ` Alberto Bertogli
2008-12-24 23:49 ` Theodore Tso [this message]
2008-12-25 14:35 ` Alberto Bertogli
2008-12-25 15:52 ` Theodore Tso
2008-12-26 0:00 ` Alberto Bertogli
2008-12-26 3:37 ` Theodore Tso
2008-12-26 16:17 ` Alberto Bertogli
2008-12-26 18:06 ` Theodore Tso
2008-12-27 3:00 ` Alberto Bertogli
2008-12-27 19:29 ` Theodore Tso
2008-12-29 21:30 ` Alberto Bertogli
2008-12-27 20:01 ` Andreas Dilger
2008-12-29 6:20 ` Shyam_Iyer
2008-12-29 21:05 ` [dm-devel] " Alberto Bertogli
2008-12-30 6:55 ` Alex Tomas
2008-12-30 13:51 ` Alberto Bertogli
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20081224234915.GA23723@mit.edu \
--to=tytso@mit.edu \
--cc=albertito@blitiri.com.ar \
--cc=dm-devel@redhat.com \
--cc=linux-ext4@vger.kernel.org \
--cc=linux-mm-cc@lists.laptop.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).