From owner-freebsd-questions@FreeBSD.ORG Fri Jul 11 18:23:37 2003 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0A7FF37B401 for ; Fri, 11 Jul 2003 18:23:37 -0700 (PDT) Received: from smtp.covadmail.net (mx01.covadmail.net [63.65.120.61]) by mx1.FreeBSD.org (Postfix) with SMTP id 1ED3243FBD for ; Fri, 11 Jul 2003 18:23:36 -0700 (PDT) (envelope-from strick@covad.net) Received: (covad.net 20801 invoked from network); 12 Jul 2003 01:23:32 -0000 Received: from unknown (HELO ice.nodomain) (68.164.195.67) by sun-qmail16 with SMTP; 12 Jul 2003 01:23:31 -0000 Received: from ice.nodomain (localhost [127.0.0.1]) by ice.nodomain (8.12.8p1/8.12.8) with ESMTP id h6C1NX8T001009; Fri, 11 Jul 2003 18:23:34 -0700 (PDT) (envelope-from dan@ice.nodomain) Received: (from dan@localhost) by ice.nodomain (8.12.8p1/8.12.8/Submit) id h6C1NXBI001008; Fri, 11 Jul 2003 18:23:33 -0700 (PDT) Date: Fri, 11 Jul 2003 18:23:33 -0700 (PDT) From: Dan Strick Message-Id: <200307120123.h6C1NXBI001008@ice.nodomain> To: questions@freebsd.org cc: dan@ice.nodomain Subject: Re: Advise on data recovery from failed drive X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Jul 2003 01:23:37 -0000 On Friday July 12, 2003 (PST) Per olof Ljungmark wrote: >>>>>>>>>>>>>>>>>>> > I've had a drive crash where the spindle motor bearings overheated and > got stuck. > Using mild violence I now have the drive spinning again and need to do > some data recovery. > > It has to be something that is able to handle read errors without stopping, > I am thinking dd, any other suggestions? >>>>>>>>>>>>>>>>>>>>> I have an ancient program that I once wrote to make copies of disk drives with bad sectors. It normally reads/writes in large units, but goes back and rereads a section of the input disk one 512 byte sector at a time if it gets a read error. It will retry a single sector read several times before giving up. Unreadable sectors are "assumed" to be zero. This program was intended to be used with raw disk devices (drivers) doing unbuffered "physical" I/O with simple error recovery procedures (perhaps a limited number of read retries). I have not "ported" it to FreeBSD or even looked at it in many years, but it ought to work ok as is. The traditional dd program has a few problems if you use it with the "conv=noerror" option to copy sick disks. One problem is that you must specify "bs=512" (i.e. copy only one sector at a time) to avoid losing good disk sectors adjacent to a bad disk sector. This makes for a slow copy. Another problem is that is that if you tell dd to ignore input errors, it skips the bad blocks on input but not on output so that after a read error blocks are copied to a wrong disk address. I just did a man on the FreeBSD 4.8-RELEASE dd command and discovered a new option that avoids this problem. Specify "conv=noerror,sync" if you use the dd command. Dan Strick