strange badblocks problem

Bill's LFS Login lfsbill at
Sun Jan 18 14:45:38 PST 2004

On Sun, 18 Jan 2004, marnixk wrote:

> Bill's LFS Login wrote:
> > Using the correct blocksize (-b) or specifying the count of blocks when
> > using 1K (-c) should have some beneficial effects. [...]

> Okay, I have done the following:
> cdimage root # badblocks -sv /dev/hda8
> Checking for bad blocks in read-only mode
> >From block 0 to 3036253
> Checking for bad blocks (read-only test): 303625236/  3036253
> done
> Pass completed, 1 bad blocks found.
> cdimage root # badblocks -sv -c1 -b 512 /dev/hda8
> Checking for bad blocks in read-only mode
> >From block 0 to 6072507
> Checking for bad blocks (read-only test): 607250412/  6072507
> 6072505
> 6072506
> done
> Pass completed, 3 bad blocks found.
> cdimage root # badblocks -sv -c1 -b 4096 /dev/hda8
> Checking for bad blocks in read-only mode
> >From block 0 to 759063
> Checking for bad blocks (read-only test): done
> Pass completed, 0 bad blocks found.
> As would be expected after your post, giving the correct parameters to
> badblocks solved the problem. Cool!

One down, one to go! But I'm pessimistic about the second one because I
really do believe we have bugs in either the libraries or kernel. When I
expressed this in the previous thread, IIRC I was pooh-pooh'd. Maybe
someday I'll write some pgms to (dis)prove my feelings.

> However, doing something similar with dd did not:
> cdimage root # dd if=/dev/hda8 of=/dev/null bs=4096
> dd: reading `/dev/hda8': Input/output error
> 759063+0 records in
> 759063+0 records out
> and i know of no parameters that i could pass to cat, so this remains the
> same also:
> cdimage root # cat < /dev/hda8 > /dev/null
> cat: -: Input/output error

If there really are bugs, as I feel there are, you results tend to
confirm that. I'll ask again if you googled or checked other lists to
see if this was a issue that was known, and maybe being worked on.

> > Much of what we discussed still holds since the number of sectors is not
> > evenly divisable by 8.
> I am going to repartion my disk *now*, so that all partitions hold a number
> of sectors that is evenly divisible by 8. Still, IMHO maybe partitioning
> software should take care of this automatically, or the kernel/applications
> should handle this better? I say this because not everybody carefully
> determines its partitions in terms of the number of sectors in them being a
> multiple of 8.

Multiples of 8 is only significant when blocksize if 4096 or you whish
to assure that sectors divided by block factors (2, 4, 8) will always
come out even. Other than that, partitioning software has no need or
reason to do that. Other OSs that may use what the partitioning software
lays in may have no problems with the odd numbers (e.g. real original
UNIX kernels weere unaffected by this).

> However, i'm beginning to believe that it actually is not a
> *big* problem, since normal programs just use the FS, instead of the raw
> partition... And i have seen no actual problems with FS. The reboot needed
> after fsck-ing the root partition i described earlier has only occured once
> or twice, and may not be related to this problem...

Right. You are relatviely secure.

> > I'm not sure what is updating the FS information ATM. It would not
> > surprise me if getting badblocks to see the correct blocksize and
> > block count stopped this. Or not. Of course, having the partition end on
> > a block boundary should also provide benefit.
> see above. In a previous post i compared the normal superblock with a backup
> superblock and they appeared the same (if i did it correctly). So i think
> nothing is updating the FS information? Although this does not explain why
> sometimes the problem seems to be affected by mount/unmount of course, but
> maybe this is just some artefact of the partitions being not divisible by 8
> as well. hmmm...

Well, as I mentioned in passing, it could be an in-core copy of
something that is affected. That might be indicated by the fact that
reboot clears the problems.

> > HTH (at last?)
> You have been most helpfull and i've learned a lot. I will post the results
> of my re-partitioning strategy later...I feel this *should* work!

I'm glad you got here. I had started (and am still in the process of)
going over each of our posts to get rid of my uncertainty that I had not
missed something. I can let that go now, thank goodness.

I'm glad it all worked out (apparently). Sorry it took so long, but
that's the nature of these problems when combined with the way I go
about things.

> Thanks,
> Marnix

NOTE: I'm on a new ISP, if I'm in your address book ...
Bill Maltby
Fix line above & use it to mail me direct.

More information about the lfs-support mailing list