LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices

Reply
 
Search this Thread
Old 07-31-2013, 03:39 PM   #1
gwiesenekker
LQ Newbie
 
Registered: Oct 2005
Posts: 14

Rep: Reputation: 10
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
 
Old 07-31-2013, 06:08 PM   #2
Ser Olmy
Senior Member
 
Registered: Jan 2012
Distribution: Slackware
Posts: 1,915

Rep: Reputation: Disabled
Quote:
Originally Posted by gwiesenekker View Post
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?
I would think so. If a block is marked as being in use, there should be a referencing inode. Even a block inside the journal itself should not return "block not found".

Quote:
Originally Posted by gwiesenekker View Post
e2fsck -f /dev/sdf5 shows the filesystem is OK.
Very strange. Do you get any errors if you try to mount the file system? Anything suspicious in the logs?
 
Old 07-31-2013, 11:32 PM   #3
gwiesenekker
LQ Newbie
 
Registered: Oct 2005
Posts: 14

Original Poster
Rep: Reputation: 10
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
 
Old 07-31-2013, 11:49 PM   #4
Ser Olmy
Senior Member
 
Registered: Jan 2012
Distribution: Slackware
Posts: 1,915

Rep: Reputation: Disabled
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.
 
Old 08-01-2013, 04:25 AM   #5
H_TeXMeX_H
Guru
 
Registered: Oct 2005
Location: $RANDOM
Distribution: slackware64
Posts: 12,928
Blog Entries: 2

Rep: Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269
Bad blocks are a sign that the HDD may fail, so make sure to backup your data.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
re-allocated sectors count shows 2 bad sectors, in Ubuntu 10.04 disk utility james2b Linux - Hardware 4 10-12-2010 11:16 PM
Bad sectors jnreddy Linux - Server 2 07-30-2010 01:08 PM
how do I find names of files affected by fsck ? jtmoon Linux - Software 3 03-08-2009 05:44 AM
Bad sectors, what to do with them? SuperDude123 Linux - Hardware 4 02-15-2009 07:36 PM
Bad sectors blystovski Linux - Software 1 10-17-2001 12:18 PM


All times are GMT -5. The time now is 07:21 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration