All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chris Hiszpanski <hiszpans@its.caltech.edu>
To: reiserfs-list@namesys.com
Subject: Contribution
Date: Sat, 26 Mar 2005 00:51:41 -0800	[thread overview]
Message-ID: <20050326085141.GA29906@sue.caltech.edu> (raw)

[-- Attachment #1: Type: text/plain, Size: 2389 bytes --]

Hi,

Recently, I ran a --rebuild-tree on a reiserfs partition in an attempt to
restore several files that I had accidentally deleted. Due to my own stupidity
I did not back up my files on the partition before doing this (!).

What can go wrong did, and --rebuild-tree stopped at the first bad block,
leaving an unmountable /home partition.

I ran badblocks on the partition and passed this to reiserfsck. Some of the
bad blocks were journal superblocks, and reiserfsck gave up at this point. Web
documentation suggested running a dd_rescue. Since I was working on a remote
machine and had no extra drives available this wasn't an open option.

I noticed that writing to the badblocks should cause the hard disk to remap the
blocks, making reiserfsck happy, though losing data (turned out that apparently
not much data was stored in these blocks, and this data was inaccessible
anyway, so not a big loss :).

The non-destructive write (i.e. badblocks -n ...) didn't remap the blocks. Only
the destructive writes (i.e. badblocks -w) did. Therefore, I modified the
lib/io.c code with a pretty trivial update that others in this situation may
find useful.

The contribution adds two options as #define in lib/io.c, NOSUPERDIE and NODIE.
When NOSUPERDIE is 1, the bread function calls badblocks -w to destructively
write the bad block, hopefully remapping it (since the remapped block is
meaningless data, I didn't worry about having bh point to meaningful data).
When NOSUPERDIE is 0, but NODIE is 1, the bread function returns a 0, acting
as if the block was in the bad blocks list, avoiding the need for running
bad blocks separately. When both NOSUPERDIE and NODIE are 0, the code compiles
unaltered.

The point of this contribution is to prevent reiserfsck from dieing on bad
blocks, to get it to finish, so that the file system, what's left of it, can
be mounted.

The results that I received were pretty good. I was able to recover most of
my files, and the file system appears to be in tact. Can anyone tell me how
in tact is actually is? I'm not exactly sure what was destroyed when I remapped
the journal superblocks.

I'd appreciate some feedback on this hack, any problems with it especially.

Hopefully the community finds this useful.

Cheers,
Chris

(attached reiserfsprogs-3.6.19-hiszpans.tar.gz)
(http://www.its.caltech.edu/~hiszpans/pub/reiserfsprogs-3.6.19-hiszpans.tar.gz)


[-- Attachment #2: reiserfsprogs-3.6.19-hiszpans.tar.gz --]
[-- Type: application/x-tar-gz, Size: 7818 bytes --]

             reply	other threads:[~2005-03-26  8:51 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-03-26  8:51 Chris Hiszpanski [this message]
2005-03-26 14:17 ` flush file system John Sconiers
2005-03-26 19:36   ` Simon Raffeiner
2005-03-28 17:24 ` Contribution Hans Reiser
     [not found] <mailman.65479.1492027745.22739.grub-devel@gnu.org>
2017-04-12 20:57 ` Contribution Nicole
     [not found] <mailman.37.1492012806.25481.grub-devel@gnu.org>
2017-04-12 16:51 ` Contribution Nicole
2017-04-12 17:03   ` Contribution Xen
2017-04-12 20:06     ` Contribution Vladimir 'phcoder' Serbinenko
     [not found] <mailman.65311.1491983735.22739.grub-devel@gnu.org>
2017-04-12 10:36 ` Contribution Nicole
2017-04-12 10:41   ` Contribution Vladimir 'phcoder' Serbinenko
  -- strict thread matches above, loose matches on Subject: below --
2014-05-28 14:58 Contribution Alexandre MALKI
     [not found] <CAA8043idUL1qbWfrBffhYXL8JX0LZ+WsMseUypatret7PrxBGw@mail.gmail.com>
     [not found] ` <CABBk=J9-hrMgGJ6ofvR0uuzX_gTfKJhH_TFCS4fR6m6gD=UBmg@mail.gmail.com>
     [not found]   ` <CAA8043g_vkZvx_ErHZbF8eq12T2bvvXGWA_u=NRdwEWnmaqaug@mail.gmail.com>
2013-07-01 19:52     ` Contribution christophe courtaut
2013-07-01 20:23       ` Contribution Yehuda Sadeh
2013-07-04 13:58         ` Contribution christophe courtaut
2013-07-05  7:05           ` Contribution Yehuda Sadeh
2013-07-10 15:24             ` Contribution christophe courtaut
2013-07-10 16:08               ` Contribution Yehuda Sadeh
2013-06-27 14:38 Contribution christophe courtaut
2009-01-10  6:48 Contribution Mehdi Sheikhalishahi
2004-11-26 10:13 contribution Artem B. Bityuckiy

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=20050326085141.GA29906@sue.caltech.edu \
    --to=hiszpans@its.caltech.edu \
    --cc=reiserfs-list@namesys.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.