Problem trying to find out which files could be affected by bad sectors
I regularly check my Linux partitions under Windows with HD Sentinel. It found some bad sectors on my ext4 / partition (/dev/sdf5) and now I am trying to find out which files could be affected to assess the damage.
I found the block size of the ext4 file system: tune2fs -l /dev/sdf5 | grep Block which returned 4096. I checked for bad blocks: badblocks -b 4096 /dev/sdf5 It found 3 bad blocks, one of them being block number 1692288. Now to find the affected files I ran: debugfs open /dev/sdf5 testb 1692288 icheck 1692288 testb returns 'Block 1692288 marked in use', but icheck (to find the inode) returns '<block not found>'. What does this mean? Is the filesystem corrupt? e2fsck -f /dev/sdf5 shows the filesystem is OK. Regards, Gijsbert |
Quote:
Quote:
|
I can mount the filesystem and I do not get any errors in the logs. Meanwhile I found the reason why icheck returns '<block not found>': the blocks are reserved as bad:
# dumpe2fs -b /dev/sdf5 dumpe2fs 1.41.12 (17-May-2010) 1692288 1692318 1692320 Regards, Gijsbert |
I guess they must have been detected by a previous fsck run. You should check with smartctl -a /dev/sdf before and after writing to these blocks to confirm that the drive reallocates properly. Pay special attention to the Reallocated_Sector_Ct and Current_Pending_Sector values.
If you're not already monitoring the drive with smartd, that may also be worth considering. |
Bad blocks are a sign that the HDD may fail, so make sure to backup your data.
|
All times are GMT -5. The time now is 02:48 AM. |