:In message <[EMAIL PROTECTED]> Matthew Jacob
:writes:
:: Isn't this what the Linux badblocks program is for? Why don't you take that
:: and find a way to feed this into badsect(8)...
:
:I thought the linux badblocks program found bad blocks and keep the
:user from using them. I want to read the entire disk and the parts
:that don't read I want to try again later to see if I can maybe get
:lucky.
:
:The disk has too many bad sectors to really use...
:
:So far the brute force approach seems to be going quickly.
:
:Warner
I wrote a little program to 'recover' a bad disk at BEST, but I've
lost it.
It's simple, though. Just write a program to open up the raw device
and read() large (32K) chunks, writing the output to a file.
When you get a read() error lseek() back to the beginning of the 32K
block and then proceed to read the block using 512 byte reads. If/when
you get a read() error reading the smaller block, lseek/retry a couple
of times, report the problem, lseek past the bad block, and continue.
When you are through you will have an output image sitting in a file
that you can then fsck and dd onto a new disk.
-Matt
To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message