LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
LinkBack Search this Thread
Old 01-05-2009, 08:56 AM   #1
yafrank
LQ Newbie
 
Registered: Nov 2004
Posts: 23

Rep: Reputation: 16
Howto identify the file associated with an unreadable disk sector of vfat fs


Hi All,
My old 40G Maxtor disk couldn't pass the MHDD scan test and reported several UNC errors. All of them are in a vfat partition according to the LBA. I'd like to follow the http://smartmontools.sourceforge.net/badblockhowto.html, only to find there's no vfat example. I managed to get the block size by the "dosfsck -v" command. Then I used this number to calculate the block number of the unreadable sector. But I can't find a utility to do the final trick like debugfs for ext2 to identify the file associated with the sector.
Does anyone has any experience in this area?
Thanks in advance.

Regards,
Frank Wang
 
Old 01-05-2009, 01:15 PM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 21,575
Blog Entries: 47

Rep: Reputation: 1401Reputation: 1401Reputation: 1401Reputation: 1401Reputation: 1401Reputation: 1401Reputation: 1401Reputation: 1401Reputation: 1401Reputation: 1401
Maybe the Sleuth Kit tools (fls, ils et cetera) and docs like File System Analysis Techniques might help?
 
Old 01-06-2009, 10:12 AM   #3
yafrank
LQ Newbie
 
Registered: Nov 2004
Posts: 23

Original Poster
Rep: Reputation: 16
Quote:
Originally Posted by unSpawn View Post
Maybe the Sleuth Kit tools (fls, ils et cetera) and docs like File System Analysis Techniques might help?
I've installed the Sleuth Kit and tried some of its commands against the image of the partition. Ffind looks feasible for the job. I'm working on mapping the lba to the inode for the vfat partition.
Thanks for the quick reply.
 
Old 01-06-2009, 11:06 AM   #4
jiml8
Senior Member
 
Registered: Sep 2003
Posts: 3,171

Rep: Reputation: 112Reputation: 112
If you have or can borrow a copy of it, Spinrite might recover the drive to a fully functional state.
 
Old 01-07-2009, 08:19 AM   #5
yafrank
LQ Newbie
 
Registered: Nov 2004
Posts: 23

Original Poster
Rep: Reputation: 16
After trial and error and reading the http://www.sleuthkit.org/sleuthkit/docs/skins_fat.txt, I realize maybe the route to map the LBA to inode nubmer for vfat partition is not right. As both istat and "blkls -l" use sector, instead of cluster, there maybe no need to do such translation to locate the possible associated file(s).
The MHDD had remapped LBA from 17518937 to 17518941, and it falls to the first partition of the disk according to "fdisk -lu." I then dd'ed the whole partition to hdc1.img. The dd process didn't give me any error, because the bad sectors were addressed by the remap of the MHDD.

[root@test ~]# blkls -e -l -f fat32 hdc1.img $((17518937-63))-$((17518941-63))
class|host|image|first_time|unit
blkls|test.yarbs.cn||1231336092|Sector
addr|alloc
17518874|f
17518875|f
17518876|f
17518877|f
17518878|f

The above means they're all unallocated. This is in accordance with the "fsstat -f fat32 hdc1.img," as 17518874-17518878 is not listed in the fat contents.

Last edited by yafrank; 01-07-2009 at 08:23 AM.
 
Old 01-07-2009, 09:25 AM   #6
yafrank
LQ Newbie
 
Registered: Nov 2004
Posts: 23

Original Poster
Rep: Reputation: 16
Quote:
Originally Posted by jiml8 View Post
If you have or can borrow a copy of it, Spinrite might recover the drive to a fully functional state.
I don't have it, neither do my friends here. Thanks for recommending anyway.
 
Old 01-08-2009, 11:17 PM   #7
jiml8
Senior Member
 
Registered: Sep 2003
Posts: 3,171

Rep: Reputation: 112Reputation: 112
You can buy Spinrite at GRC.com. It costs $89. I personally consider it to have been well worth the money. The data is far, far more valuable than the hardware, and time spent trying to recover valuable data is time spent not making money. When you look at it that way, Spinrite is dirt cheap.
 
  


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
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Hard disk sector error trebek Linux - Hardware 8 04-01-2008 02:13 PM
How to know what sector of the disk a file is using ? maginotjr Linux - Software 2 01-29-2008 07:25 PM
how to identify a SCSI disk? anuode Solaris / OpenSolaris 1 12-16-2005 01:10 AM
Disk Sector errors on / sgl Linux - Hardware 2 12-28-2004 10:29 AM
howto identify what services are running via CLI? Lleb_KCir Linux - General 3 09-21-2004 11:44 PM


All times are GMT -5. The time now is 07:17 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
Open Source Consulting | Domain Registration