From owner-freebsd-current@FreeBSD.ORG Thu Nov 4 06:48:12 2004 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 977FD16A4CE for ; Thu, 4 Nov 2004 06:48:12 +0000 (GMT) Received: from mail2.speakeasy.net (mail2.speakeasy.net [216.254.0.202]) by mx1.FreeBSD.org (Postfix) with ESMTP id 20FB243D3F for ; Thu, 4 Nov 2004 06:48:12 +0000 (GMT) (envelope-from jmg@hydrogen.funkthat.com) Received: (qmail 22278 invoked from network); 4 Nov 2004 06:48:11 -0000 Received: from gate.funkthat.com (HELO hydrogen.funkthat.com) ([69.17.45.168]) (envelope-sender ) by mail2.speakeasy.net (qmail-ldap-1.03) with SMTP for ; 4 Nov 2004 06:48:11 -0000 Received: from hydrogen.funkthat.com (uxoxqv@localhost.funkthat.com [127.0.0.1])iA46m4B6073877; Wed, 3 Nov 2004 22:48:05 -0800 (PST) (envelope-from jmg@hydrogen.funkthat.com) Received: (from jmg@localhost) by hydrogen.funkthat.com (8.12.10/8.12.10/Submit) id iA46m3YJ073876; Wed, 3 Nov 2004 22:48:03 -0800 (PST) Date: Wed, 3 Nov 2004 22:48:03 -0800 From: John-Mark Gurney To: David Gilbert Message-ID: <20041104064803.GZ22681@funkthat.com> Mail-Followup-To: David Gilbert , freebsd-current@freebsd.org References: <41868E49.8070809@daveg.ca> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <41868E49.8070809@daveg.ca> User-Agent: Mutt/1.4.1i X-Operating-System: FreeBSD 4.2-RELEASE i386 X-PGP-Fingerprint: B7 EC EF F8 AE ED A7 31 96 7A 22 B3 D8 56 36 F4 X-Files: The truth is out there X-URL: http://resnet.uoregon.edu/~gurney_j/ X-Resume: http://resnet.uoregon.edu/~gurney_j/resume.html cc: freebsd-current@freebsd.org Subject: Re: fsck --run-with-scissors X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: John-Mark Gurney List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Nov 2004 06:48:12 -0000 David Gilbert wrote this message on Mon, Nov 01, 2004 at 14:28 -0500: > You know... I've had a number of unrelated disk failures in the last 7 > days. In general, we have backups. Some of the failures are such that > I can still mount the fs readonly and avoid the dead area and get the > last iota of data off, but some are not. > > It would be really useful if fsck_ffs had a --run-with-scissors mode. > Meaning a mode of last resort that may or may not make the disk work and > may or may not totally screw with the disk. > > As an example, my laptop drive died. I don't really care about the data > on disk because it's backed up. However, it will be another day before > Dell shows up with a new drive... meaning that now I'm suffering in XP. > In many cases, if the block-in-question was written to (even though it > can't be read), it would be reallocated by the drive logic. Run with > scissors should write all zeros to a block it can't read. dd will do this... dd if=/dev/zero of=/dev/diskdev oseek= bs=512 count=1 I've done this before.. Though you have to make sure you're using the correct block number which can be verified with: dd if=/dev/diskdev iseek= bs=512 count=1 of=/dev/null Just as a little bit of fun, even if the bad block is in the primary super block, and you can successfully use fsck -b , you can copy one of the secondary superblocks back over the primary, but be VERY careful when doing this... (I've successfully recovered a bad disk this way once..) -- John-Mark Gurney Voice: +1 415 225 5579 "All that I will do, has been done, All that I have, has not."