From owner-freebsd-questions@freebsd.org Sun Apr 17 08:40:23 2016 Return-Path: Delivered-To: freebsd-questions@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5FF18AEE0E2 for ; Sun, 17 Apr 2016 08:40:23 +0000 (UTC) (envelope-from steve@sohara.org) Received: from uk1mail2513.mymailbank.co.uk (UK1MAIL2513-PERMANET.IE.mymailbank.co.uk [217.69.47.44]) by mx1.freebsd.org (Postfix) with ESMTP id D52B71070 for ; Sun, 17 Apr 2016 08:40:21 +0000 (UTC) (envelope-from steve@sohara.org) Received: from smtp.lan.sohara.org (UnknownHost [88.151.27.41]) by uk1mail2513-d.mymailbank.co.uk with SMTP; Sun, 17 Apr 2016 09:40:03 +0100 Received: from [192.168.63.1] (helo=steve.lan.sohara.org) by smtp.lan.sohara.org with smtp (Exim 4.86 (FreeBSD)) (envelope-from ) id 1ariFK-0004Dk-Gk; Sun, 17 Apr 2016 08:39:58 +0000 Date: Sun, 17 Apr 2016 09:39:57 +0100 From: Steve O'Hara-Smith To: Matthias Apitz Cc: freebsd-questions@freebsd.org Subject: Re: tool for mapping away bad blocks on an external disk Message-Id: <20160417093957.0b1acb4c37d7c15a4b06af88@sohara.org> In-Reply-To: <20160417072641.GA2358@c720-r292778-amd64> References: <20160417072641.GA2358@c720-r292778-amd64> X-Mailer: Sylpheed 3.5.0 (GTK+ 2.24.29; amd64-portbld-freebsd10.1) X-Clacks-Overhead: "GNU Terry Pratchett" Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Apr 2016 08:40:23 -0000 On Sun, 17 Apr 2016 09:26:41 +0200 Matthias Apitz wrote: > > Hello, > > I have an older external disk, connected through USB, which has bad > blocks: The tool you're looking for is badsect - I'm moderately surprised it's still around, the last time I used it was on FreeBSD 1.1.5.1 but it is still in FreeBSD 10.3. It doesn't do the analysis though - you'll have to do that with the filesystem unmounted and just used dd conv=noerror if= of=/dev/null to read the whole device and pull the duff sectors out of the error messages. However it's been a *long* time since this was worth doing except perhaps as a last ditch data recovery exercise, drives have had internal sector remapping for a long time now and when that stops working they are well and truly banjaxed. -- Steve O'Hara-Smith