[plug] Working around bad blocks

Fred Janon fjanon at yahoo.com
Sat Dec 23 21:01:23 WST 2006


If it is a SCSI drive, you should be able to reassign the bad blocks.
If it is an ATA drive, rewriting the bad blocks will trigger the
reassign... You should be able to use the space. Disk drives always
have bad blocks. Some are detected at the factory, but they all develop
bad blocks overtime, so the disk drivers are designed to deal with
them, sometimes not very well :( unfortunately.

SCSI drives do not need a format to reassign blocks (although it is the
simplest way of dealing with them), there is a specific SCSI command to
reassign one or several blocks. The Linux driver should have that
integrated.

Here is a short thingy from Apple, but it says pretty much it...
========================
The SCSI low level format option does not verify, and thus does
reallocate bad blocks. Choose low level format carefully as any
difficulties encountered once the format begins can prevent use of the
drive. Specifically, power failure, or otherwise interrupting the drive
before format is complete may cause the drive to appear as unusable. To
remedy this situation, you must run Drive Setup and initialize with the
low level format option selected and allow the format process to
complete. As a rule, use initialization with only the write zero option
selected followed by Test Disk to achieve the best level of block data
integrity.

ATA (IDE) drives internalize tracking and sparing of bad blocks. Drive
Setup and ATA drivers thus have little control over this process. Which
is why the low-level format option is dimmed when initializing an ATA
(IDE) hard drive. Reallocation (sparing) of bad blocks that the ATA
drive tracks will occur when the block is subsequently written to. Thus
the best way to force the drive to reallocate bad blocks is to
initialize using the write zeros feature. Use Test Disk to verify
surface integrity only. Given this strategy, there on occasion may be a
need to initialize using write zeros, verify using Test Disk and if any
errors occur, attempt to reinitialize using write zeros again.
=======================================

--- Arie Hol <arie99 at ozemail.com.au> wrote:

> 
> 
> On 23 Dec 2006 at 19:53, Timothy White wrote:
> 
> > Ok, I have a HDD that I know has 4 bad blocks on it, and no more.
> The
> > reason for them was a heat problem in a previous machine. I won't
> be
> > storing critical data on the drive, but would still like to use it.
> > $badblocks /dev/sda 3195200 3195201 3195202 3195203
> > 
> > >From that, I've worked out that (from the man page default block
> size
> > is 1024 bytes), that it's roughly at the 3120Mb point of the drive.
> > So what I would do, is make a /tmp and swap in the first 3000Mb's
> of
> > the drive, then a special blank 40Mb partition that would certainly
> > cover the bad blocks, then use the rest of the drive for what I
> want
> > to use it for, Debian mirrors.
> > 
> > Does this sound right to everyone? (i.e. my maths?)
> > 
> 
> Sounds alright to me - but I would be inclined to "NOT" partition the
> 
> area of the drive which contains the Bad Blocks ie - leave that area 
> unpartitioned.
> 
> I say this because - if you ever use a partition checking utility -
> it 
> may trip up on the Bad Blocks.
> 
> I say this because I recently had a problem on a dual boot machine,
> where 
> there was an error in the partition table (thanks to Win XP) I tried
> to 
> use Partition Magic to fix it - when it started up it reported that
> it 
> had found an error in the partition table and that it could repair
> the 
> error.
> 
> I clicked on OK and all was good - until I rebooted the PC to use
> Linux - 
> there was a problem - grub could not find any Linux partitions
> because 
> they were "Gone".
> 
> Your problem is not related to my problem - but I would leave the Bad
> 
> Blocks on an unused portion of the drive - just in case...........
> 
> Regards Arie
> ------------------------------------------------------------------
>  For the concert of life, nobody has a program.
> ------------------------------------------------------------------
> _______________________________________________
> PLUG discussion list: plug at plug.org.au
> http://www.plug.org.au/mailman/listinfo/plug
> Committee e-mail: committee at plug.linux.org.au
> 




More information about the plug mailing list