Hans-Peter Jansen writes:
 > 
 > Hi Nikita,
 > 
 > while diggin' on the topic in the net, I came across 
 > http://namesys.com/bad-block-handling.html, which
 > answers some of my questions, but generates new ones:
 > 
 > 1.)
 > What about giving a hint how to gather the blocksize?
 > It's the commonly used 4096, I guess.

Block size is recorded in a super-block. You can get it by running
/bin/debugreiserfs

 > 
 > 4. & 5.)
 > How about loosing a word whats happening behind the scenes
 > here? Right now, I interpret 4. as the necessary step to 
 > mark some blocks bad. But why marking the block as "used" 
 > first, and as free before running reiserfsck, then. Does 
 > this mean, reiserfsck cannot handle bad blocks yet, and I 
 > have to restore them afterwards, or what?

Yes, you are right, reiserfsck doesn't handle bad-blocks yet.

 > 
 > What does the third parameter "set" in add-bad-block.c?

When you manually mark block as "used" in bitmap, special counter in
super-block is incremented (this is supposed to be used by reiserfsck in
a future). "set" option allows one to set this counter to given value.

 > What about the foo file? What happens, if I remove it?

Nothing. This file is just a stub.

 > 
 > My problem is, the fs is populated already, and I've found
 > this in the logs today: 
 > Nov  8 13:51:48 shrek kernel: end_request: I/O error, 
 >  dev 03:09 (hda), sector 40027056
 > Nov  8 13:52:43 shrek kernel: hda: dma_intr: status=0x51
 >  { DriveReady SeekComplete Error }
 > Nov  8 13:52:43 shrek kernel: hda: dma_intr: error=0x40
 >  { UncorrectableError }, LBAsect=85282224
 > 
 > I was able to isolate two defect sectors on this hd with:
 > dd if=/dev/hda bs=512 count=1 skip=85282224
 > dd if=/dev/hda bs=512 count=1 skip=85282225
 > giving I/O errors.
 > 
 > It's a IBM-DTLA-307060. I've patched/compiled my 2.4.13-ac7
 > with linux-2.4.8-reiser-badblocks-1.b.diff already, and
 > will wait for any hopefully enlighting reply before messing
 > with add-bad-block.

It looks like you are having bad-blocks already allocated for files or
meta-data.

You should perform the following:

 - full backup (dd is inadequate for this, as it doesn't do seek on
   output device when read from input device fails).
 - /sbin/reiserfsck --check /device. If this fails you have got
   bad-blocks in meta-data. If so, copy data from /device to
   /good-device and run /sbin/reiserfsck --rebuild-tree /good-device.
   If /sbin/reiserfsck --check /device didn't fail, find what files
   contain corrupted blocks (by catting all files to /dev/null for 
   example), remove them, and mark bad-blocks as used.

 > 
 > Thanks in advance,
 > Hans-Peter

Nikita.

Reply via email to