From owner-freebsd-stable@FreeBSD.ORG Wed Aug 23 03:36:58 2006 Return-Path: X-Original-To: freebsd-stable@freebsd.org Delivered-To: freebsd-stable@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5F5F616A4E2 for ; Wed, 23 Aug 2006 03:36:58 +0000 (UTC) (envelope-from joe@osoft.us) Received: from mail.osoft.us (osoft.us [67.14.192.59]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3E14943D5A for ; Wed, 23 Aug 2006 03:36:57 +0000 (GMT) (envelope-from joe@osoft.us) Received: from [10.134.0.53] (ip-69-33-53-199.dfw.megapath.net [69.33.53.199]) by mail.osoft.us (Postfix) with ESMTP id 325A633C7B; Tue, 22 Aug 2006 22:36:56 -0500 (CDT) Message-ID: <44EBCD59.1060507@osoft.us> Date: Tue, 22 Aug 2006 22:36:57 -0500 From: Joe Koberg User-Agent: Thunderbird 1.5.0.5 (Windows/20060719) MIME-Version: 1.0 To: Antony Mawer References: <44E47092.7050104@mawer.org> In-Reply-To: <44E47092.7050104@mawer.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-stable@freebsd.org Subject: Re: The need for initialising disks before use? X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Aug 2006 03:36:58 -0000 Antony Mawer wrote: > > Is it recommended/required to do something like: > > dd if=/dev/zero of=/dev/ad0 bs=1m > > before use to ensure the drive's sector remappings are all in place, > before then doing a newfs? It seems logical to read the whole device first with "conv=noerror" to be sure the drive has encountered and noted any correctable or uncorrectable errors present. Only then write the entire drive, allowing it to remap any noted bad sectors. i.e.: # dd if=/dev/ad0 of=/dev/null bs=64k conv=noerror # dd if=/dev/zero of=/dev/ad0 bs=64k The problem is that when dd hits the first bad sector, the whole 64k block containing the sector will be skipped. There could be more bad sectors there... or none... If you hit errors I would re-read the affected area with "bs=512" to get down to sector granularity. I seem to recall a utility posted to a freebsd mailing list some time ago that worked like dd(1), but would "divide and conquer" a block that returned with a read error. Intent being to get the job done fast with large blocks but still copy every sector possible off a failing drive by reducing to sector-sized blocks if necessary.... Unfortunately I can't find it now. Joe Koberg joe at osoft dot us