From: Bruce A. <ba...@gr...> - 2004-03-02 17:11:12
|
Sergey, This is VERY helpful. Thank you! I have one question, below. (I am going to write up a how-to, once I have the details sorted out). > > so the error is at LBA = 0x016561e9 = 23421417 > > > > fdisk -lu /dev/hda shows: > > /dev/hda3 5269320 238227884 116479282+ 83 Linux > First you need to calculate the sector number relative to the start of > partition: > > 23421417 - 5269320 = 18152097 Good, I agree. > Then you need to convert the sector number to the filesystem block > number. To do this, you need to know the filesystem block size - > tune2fs -l /dev/hda1 will print this. Usually the block size is 4096 > bytes, which is 8 512-byte sectors. > > 18152097 / 8 = 2269012.125 (the integer part gives the block number) > So you need to do "icheck 2269012" in debugfs. I am concerned about this. Isn't it the case that the file system blocks are counted from 1, not from zero? debugfs: icheck 0 icheck: Invalid block number 0 debugfs: icheck 1 Block Inode number 1 <block not found> In this case, isn't the correct block given by 2269013 not 2269012? Note: I do agree with the 'seek' value: > One solution is to write zeros to the block with dd: > > dd if=/dev/zero of=/dev/hda3 bs=4096 count=1 seek=2269012 So, please let me know if you agree that the block used by debugfs needs to be offset by one from what you have calculated. Cheers, Bruce |