Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 18 Aug 2006 13:41:27 -1000
From:      Antony Mawer <fbsd-stable@mawer.org>
To:        Brooks Davis <brooks@one-eyed-alien.net>
Cc:        Kirk Strauser <kirk@daycos.com>, freebsd-stable@freebsd.org
Subject:   Re: The need for initialising disks before use?
Message-ID:  <44E65027.6060605@mawer.org>
In-Reply-To: <20060818142925.GA2463@lor.one-eyed-alien.net>
References:  <44E47092.7050104@mawer.org> <200608180919.04651.kirk@daycos.com> <20060818142925.GA2463@lor.one-eyed-alien.net>

next in thread | previous in thread | raw e-mail | index | archive | help
On 18/08/2006 4:29 AM, Brooks Davis wrote:
> On Fri, Aug 18, 2006 at 09:19:04AM -0500, Kirk Strauser wrote:
>> On Thursday 17 August 2006 8:35 am, Antony Mawer wrote:
>>
>>> A quick question - is it recommended to initialise disks before using
>>> them to allow the disks to map out any "bad spots" early on?
>> Note: if you once you actually start seeing bad sectors, the drive is almost 
>> dead.  A drive can remap a pretty large number internally, but once that 
>> pool is exhausted (and the number of errors is still growing 
>> exponentially), there's not a lot of life left.
> 
> There are some exceptions to this.  The drive can not remap a sector
> which failes to read.  You must perform a write to cause the remap to
> occur.  If you get a hard write failure it's gameover, but read failures
> aren't necessicary a sign the disk is hopeless.  For example, the drive
> I've had in my laptop for most of the last year developed a three sector[0]
> error within a week or so of arrival.  After dd'ing zeros over the
> problem sectors the problem sectors I've had no problems.

This is what prompted it -- I've been seeing lots of drives that are 
showing up with huge numbers of read errors - for instance:

> Aug 19 04:02:27 server kernel: ad0: FAILURE - READ_DMA status=51<READY,DSC,ERROR> error=40<UNCORRECTABLE> LBA=66293984
> Aug 19 04:02:27 server kernel: g_vfs_done():ad0s1f[READ(offset=30796791808, length=16384)]error = 5
> Aug 19 04:02:31 server kernel: ad0: FAILURE - READ_DMA status=51<READY,DSC,ERROR> error=40<UNCORRECTABLE> LBA=47702304
> Aug 19 04:02:31 server kernel: g_vfs_done():ad0s1f[READ(offset=21277851648, length=16384)]error = 5
> Aug 19 04:02:36 server kernel: ad0: FAILURE - READ_DMA status=51<READY,DSC,ERROR> error=40<UNCORRECTABLE> LBA=34943296
> Aug 19 04:02:36 server kernel: g_vfs_done():ad0s1f[READ(offset=14745239552, length=16384)]error = 5
> Aug 19 04:03:08 server kernel: ad0: FAILURE - READ_DMA status=51<READY,DSC,ERROR> error=40<UNCORRECTABLE> LBA=45514848
> Aug 19 04:03:08 server kernel: g_vfs_done():ad0s1f[READ(offset=20157874176, length=16384)]error = 5

I have /var/log/messages flooded with incidents of these "FAILURE - 
READ_DMA" messages. I've seen it on more than one machine with 
relatively "young" drives.

I'm trying to determining of running a dd if=/dev/zero over the whole 
drive prior to use will help reduce the incidence of this, or if it is 
likely that these are developing after the initial install, in which 
case this will make negligible difference...

Once I do start seeing these, is there an easy way to:

     a) determine what file/directory entry might be affected?
     b) dd if=/dev/zero over the affected sectors only, in order to
          trigger a sector remapping without nuking the whole drive
     c) depending on where that sector is allocated, I presume I'm
          either going to end up with:
         i) zero'd bytes within a file (how can I tell which?!)
        ii) a destroyed inode
       iii) ???

Any thoughts/comments/etc appreciated...

How do other operating systems handle this - Windows, Linux, Solaris, 
MacOSX ...? I would have hoped this would be a condition the OS would 
make some attempt to trigger a sector remap... or are OSes typically 
ignorant of such things?

Regards
Antony




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?44E65027.6060605>