Re: How to deal with defect block

Adam Piggott <[email protected]>
Newsgroups gmane.linux.utilities.smartmontools
Organization Proactive Services (Computing)
Message-ID <[email protected]>
On 21/07/2014 15:00, Rich wrote:
> I'd be curious to see said method - I was considering scripting this
> for both Windows and Linux (and possibly Solaris), because <s>I hate
> myself</s> I find myself needing to do this on occasion...

Might be easier to collaborate on IRC. I'm _aD on 
irc://irc.freenode.net/#smartmontools

http://proactiveservices.co.uk/contib/Hard_disk_bad_sector_to_file_mapping.ods

secinspect.exe:
http://www.microsoft.com/en-gb/download/details.aspx?id=19470

DiskView:
http://technet.microsoft.com/en-gb/sysinternals/bb896650.aspx

You will need to find out the partition offset. One method is using 
Microsoft's free secinspect.exe

Find the correct physical drive from the output, and then look for the 
StartingLBA number listed under the table for the Partition Table Entry. 
This is the "partition start offset byte" for the spreadsheet. The data 
here is a bit confusing but if you read through it carefully you should get 
an idea of which partitions are system ones and which has your data on it.

Your disk may have a sector size of 512 or 4096 bytes, this should also be 
listed in secinspect's output as "BytesPerSector". For "file system block 
size" this is usually 4096 bytes by default for NTFS, but must be verified. 
chkdsk

On the spreadsheet, "Bad LBA start" and "Number of bad LBAs" are where you 
enter data about the faulty sector and how many there are (sometimes disks 
have a block of them), you'll be then given the first and last file system 
block. Look for this using Sysinternals' free DiskView program. This 
requires some time and patience as you have to zoom in and out and use 
trial and error to find the correct file.

This entire method is laborious and has to be followed carefully, but in my 
experience it has proven accurate. It has also, in every time I've used it, 
found that some useless file is affected :-D

I have only had a chance to use this on pretty simple partition layouts 
etc. so it may have design flaws that I haven't uncovered. Please don't 
rely on it! I suppose now is as good a time as any to make this method 
fully scripted, easy to use, and more importantly, accurate.
-- 
Adam Piggott, Proprietor
Proactive Services (Computing)

------------------------------------------------------------------------------
Want fast and easy access to all the code in your enterprise? Index and
search up to 200,000 lines of code with a free copy of Black Duck
Code Sight - the same software that powers the world's largest code
search on Ohloh, the Black Duck Open Hub! Try it now.
http://p.sf.net/sfu/bds

_______________________________________________
Smartmontools-support mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/smartmontools-support
signature.asc (application/pgp-signature, 196 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.22 (MingW32)

iEYEARECAAYFAlPNJfkACgkQ7uRVdtPsXDmF1wCdGJVccxJ96WNcN/FUwC8sssIA
UPQAoJ8XKrhAMX3vOv8jo0j02Q5h4C+w
=ibhh
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.