linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tao Ma <tm@tao.ma>
To: Daniel Taylor <Daniel.Taylor@wdc.com>
Cc: linux-ext4@vger.kernel.org
Subject: Re: breaking ext4 to test recovery
Date: Tue, 29 Mar 2011 11:10:39 +0800	[thread overview]
Message-ID: <4D914DAF.6060600@tao.ma> (raw)
In-Reply-To: <25B374CC0D9DFB4698BB331F82CD0CF20D61B8@wdscexbe08.sc.wdc.com>

On 03/29/2011 10:45 AM, Daniel Taylor wrote:
> I would like to be able to break our ext4 file system
> (specifically corrupt the journal) to be sure that we
> can automatically notice the problem and attempt an
> autonomous fix.
> 
> dumpe2fs tells me the inode, but not, that I can see, the
> blocks where the journal exists (for "dd"ing junk to it).
yeah, AFAICS, you can corrupt it by dd.
As for the journal, normally the journal file uses the inode no 8.
So use
debugfs -R 'stat <8>' /dev/sdx.
Then you will get the disk layout of your journal.
In my box, it looks as:

Inode: 8   Type: regular    Mode:  0600   Flags: 0x80000
Generation: 0    Version: 0x00000000:00000000
User:     0   Group:     0   Size: 33554432
File ACL: 0    Directory ACL: 0
Links: 1   Blockcount: 65536
Fragment:  Address: 0    Number: 0    Size: 0
 ctime: 0x4d86f9ad:00000000 -- Mon Mar 21 15:09:33 2011
 atime: 0x4d86f9ad:00000000 -- Mon Mar 21 15:09:33 2011
 mtime: 0x4d86f9ad:00000000 -- Mon Mar 21 15:09:33 2011
crtime: 0x4d86f9ad:00000000 -- Mon Mar 21 15:09:33 2011
Size of extra inode fields: 28
EXTENTS:
(0-8191): 131072-139263

So see, you get the file's physical block number of that file
131072-139263.
Now corrupt the file as you wish with dd. ;)

Regards,
Tao

  reply	other threads:[~2011-03-29  3:10 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-29  2:45 breaking ext4 to test recovery Daniel Taylor
2011-03-29  3:10 ` Tao Ma [this message]
2011-03-29 13:50 ` Eric Sandeen
2011-03-29 14:33   ` Rogier Wolff
2011-03-29 17:33     ` Greg Freemyer
2011-03-29 22:26       ` Daniel Taylor
2011-03-29 22:33         ` Eric Sandeen
2011-03-31 22:11     ` Andreas Dilger
2011-03-31 22:22       ` Andreas Dilger
2011-03-31 22:21   ` Andreas Dilger
2011-03-31 22:44     ` Eric Sandeen
2011-04-01 15:26       ` Lukas Czerner
2011-04-01 15:52         ` Ric Wheeler
2011-04-02  2:15       ` Andreas Dilger
2011-04-02 12:38         ` Ric Wheeler
2011-04-02 18:50           ` Andreas Dilger
2011-04-03  2:37           ` Tao Ma

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=4D914DAF.6060600@tao.ma \
    --to=tm@tao.ma \
    --cc=Daniel.Taylor@wdc.com \
    --cc=linux-ext4@vger.kernel.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).