[ale] possible to use hard drives that have bad blocks ?

Greg Freemyer greg.freemyer at gmail.com
Sat Jun 25 16:25:07 EDT 2005


Scott,

That url is an interesting read, but it seems overly complex.

The author went to a lot of work to get to the badblock reallocation part:

>> To force the disk to reallocate this bad block we'll write zeros to
>> the bad block, and sync the disk:
-----------------------------------------------------------------------------------------------
>> root]# dd if=/dev/zero of=/dev/hda3 bs=4096 count=1 seek=2269012
>> root]# sync

I did not know dd had a seek option as opposed to a skip option, but
assuming it does what it implies then a simple pair of dd's would
work.  Just use the raw device, not that partition and use 512 bs and
seek to the bad LBA.

Greg


On 6/25/05, Scott Warfield <magius at wittsend.com> wrote:
> You can use smartctl.
> 
> Here's an example of how to use it.
> http://smartmontools.sourceforge.net/BadBlockHowTo.txt
> 
> 
> 
> -----Original Message-----
> From: ale-bounces at ale.org [mailto:ale-bounces at ale.org] On Behalf Of Greg
> Freemyer
> Sent: Saturday, June 25, 2005 2:09 PM
> To: Atlanta Linux Enthusiasts
> Subject: Re: [ale] possible to use hard drives that have bad blocks ?
> 
> On 6/25/05, Courtney Thomas <ccthomas at joimail.com> wrote:
> > I've got a couple of HDs that when I:
> >
> > dd if=/dev/hdX of=/dev/null bs=1m
> >
> > I get a single instance of something like:
> >
> > FAILURE - READ_DMA status=51 <READY, DSC, ERROR> error=40
> > <UNCORRECTABLE> LBA=19194112 Input/output error
> >
> > My question is: does this signify a single bad block and is there a
> > way to identify this error to some program that can block it's use, so
> > the drive can be used ?
> >
> > Thank you,
> > Courtney
> >
> 
> LBA is the Logical Block Address of the physical sector on the drive.
> 
> If indeed your only seeing one LBA address that is consistently bad you
> should be able fix it.
> 
> If your a C programmer, you could open /dev/hdX, lseek to LBA * 512 and try
> to read a sector (512) bytes.  It should cause the same error.
>  If not, try (LBA - 1) * 512.
> 
> If you can find the sector, then modify your code to write to the sector.
> That should either refresh the sector with a stronger magnetic field, or
> cause an internal disk problem that causes the disk to reassign the sector
> internally.
> 
> I would try the above before I started looking at filesystem level
> solutions.
> 
> Unfortunately, I don't know of a standard Linux tool to do the above, but
> I'm sure there is one.  (dd with the skip option is very slow because it
> actually reads everything being skipped).
> 
> Greg
> --
> Greg Freemyer
> The Norcross Group
> Forensics for the 21st Century
> _______________________________________________
> Ale mailing list
> Ale at ale.org
> http://www.ale.org/mailman/listinfo/ale
> 
> 


-- 
Greg Freemyer
The Norcross Group
Forensics for the 21st Century



More information about the Ale mailing list