LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux > Linux - General
User Name
Password
Linux - General This 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
 
Thread Tools
Old 01-05-2009, 09:56 AM   #1
yafrank
LQ Newbie
 
Registered: Nov 2004
Posts: 20
Thanked: 1
Howto identify the file associated with an unreadable disk sector of vfat fs


[Log in to get rid of this advertisement]
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
yafrank is offline     Reply With Quote
Old 01-05-2009, 02:15 PM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 16,716
Blog Entries: 30
Thanked: 283
Maybe the Sleuth Kit tools (fls, ils et cetera) and docs like File System Analysis Techniques might help?
unSpawn is offline     Reply With Quote
Old 01-06-2009, 11:12 AM   #3
yafrank
LQ Newbie
 
Registered: Nov 2004
Posts: 20
Thanked: 1

Original Poster
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.
yafrank is offline     Reply With Quote
Old 01-06-2009, 12:06 PM   #4
jiml8
Senior Member
 
Registered: Sep 2003
Distribution: mandriva 2009.1, 2008.1, kubuntu 8, fedora 8
Posts: 2,819
Thanked: 38
If you have or can borrow a copy of it, Spinrite might recover the drive to a fully functional state.
jiml8 is offline     Reply With Quote
Old 01-07-2009, 09:19 AM   #5
yafrank
LQ Newbie
 
Registered: Nov 2004
Posts: 20
Thanked: 1

Original Poster
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 09:23 AM..
yafrank is offline     Reply With Quote
Old 01-07-2009, 10:25 AM   #6
yafrank
LQ Newbie
 
Registered: Nov 2004
Posts: 20
Thanked: 1

Original Poster
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.
yafrank is offline     Reply With Quote
Old 01-09-2009, 12:17 AM   #7
jiml8
Senior Member
 
Registered: Sep 2003
Distribution: mandriva 2009.1, 2008.1, kubuntu 8, fedora 8
Posts: 2,819
Thanked: 38
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.
jiml8 is offline     Reply With Quote

Reply

Bookmarks


Thread Tools

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
Hard disk sector error trebek Linux - Hardware 8 04-01-2008 03:13 PM
How to know what sector of the disk a file is using ? maginotjr Linux - Software 2 01-29-2008 08:25 PM
how to identify a SCSI disk? anuode Solaris / OpenSolaris 1 12-16-2005 02:10 AM
Disk Sector errors on / sgl Linux - Hardware 2 12-28-2004 11:29 AM
howto identify what services are running via CLI? Lleb_KCir Linux - General 3 09-22-2004 12:44 AM


All times are GMT -5. The time now is 04:06 AM.

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
RSS2  LQ Podcast
RSS2  LQ Radio
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration