From owner-freebsd-fs@FreeBSD.ORG Sun May 22 06:19:01 2011 Return-Path: Delivered-To: freebsd-fs@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 648D6106564A for ; Sun, 22 May 2011 06:19:01 +0000 (UTC) (envelope-from grarpamp@gmail.com) Received: from mail-pw0-f54.google.com (mail-pw0-f54.google.com [209.85.160.54]) by mx1.freebsd.org (Postfix) with ESMTP id 3DCC58FC08 for ; Sun, 22 May 2011 06:19:01 +0000 (UTC) Received: by pwj8 with SMTP id 8so2905271pwj.13 for ; Sat, 21 May 2011 23:19:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:content-type; bh=fDKE98oLCE1D2ePvkrLp//u1vhCJdDYYw0w/tRQdnp4=; b=ij4iTRE8O01idKTZ2Nh5qzY6yo39Rz9VdA1S/XpTo/p8jmBF7K+dWca+udmOpwc7G8 gfcT6FjLNZFtEkRa7ua8lo7qa32FOgqMmK1TD3hhDY7twbWVvoQk43HgDmHEKMRQOiWa WV3k8RMViKR7PVLKvKw2fPTBeOabhMeB7vPTU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=VO7+j2k+FQMlRhhgCtS9dLEz/xmoaBhga3aHJF/ClmvgO8xSSgWsAPdrIpKdI0dUYx 2rWKTJLkaNRmi+MSnKzydzcohybF7Ex0leLXeo5f7wl0gX85EtWFh3swKjWD3ZnY6eBb UBHJZ7nLEpdWVrtV+thiTSELvyM3cZB49jvbM= MIME-Version: 1.0 Received: by 10.142.230.6 with SMTP id c6mr663600wfh.415.1306045140730; Sat, 21 May 2011 23:19:00 -0700 (PDT) Received: by 10.142.157.2 with HTTP; Sat, 21 May 2011 23:19:00 -0700 (PDT) In-Reply-To: <6806.1305962015@critter.freebsd.dk> References: <6806.1305962015@critter.freebsd.dk> Date: Sun, 22 May 2011 02:19:00 -0400 Message-ID: From: grarpamp To: freebsd-fs@freebsd.org Content-Type: text/plain; charset=UTF-8 Subject: Re: Write reallocator X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 May 2011 06:19:01 -0000 >>see if it will reallocate marginal reads when written to. >>Because the data is still semi valuable, I want to >>read and write back every block of the disk. >>Any tools that will do this? > > Recoverdisk ? This is interesting, yet man does not indicate rewriting capabilities, only copying off to other media. dd will throw error block indexes. recoverdisk will automagically attempt rereading them, sizing down the bs. It's not clear to me what the zero blocksize in '-b 0' means, since you can't read anything less than the native size. I think recoverdisk could have another useful mode to take a list of error sectors '-e elist' (whether from dd noerror or a first pass of itself), and then loop read those into numbered files, instead of copying the whole 3TB worth of disk. With an option to zero pad after n number of read attempts. Those could then be layed back onto disk by hand. In the past, I've noticed some disks will cough up the sector in question depending on the covering bs size used, don't know why. dd reads a block before writing it (presumably up to some blocksize limitation), so we still have this old trick. If it's a file, and after all the full bs sized records, the last block is shorter than the bs, it will need to be handled separately. If it's a device, it's ok as it throws a short write EOD. There is no safety net obviously. # dd if=/dev/urandom of=r bs=1m count=50 50+0 records in 50+0 records out 52428800 bytes transferred in 2.552598 secs (20539388 bytes/sec) # ls -isl r 5 51248 -rw-r--r-- 1 0 0 52428800 May 22 01:19 r # md5 r MD5 (r) = 92b48057a6af390fa337523c10b757bc # dd if=r of=r conv=notrunc,noerror,sync bs=512 102400+0 records in 102400+0 records out 52428800 bytes transferred in 1.388739 secs (37752807 bytes/sec) # dd if=r of=r conv=notrunc,noerror,sync bs=1m 50+0 records in 50+0 records out 52428800 bytes transferred in 0.636191 secs (82410485 bytes/sec) # dd if=r of=r conv=notrunc,noerror,sync bs=50m 1+0 records in 1+0 records out 52428800 bytes transferred in 0.905330 secs (57911263 bytes/sec) # ls -isl r 5 51248 -rw-r--r-- 1 0 0 52428800 May 22 01:20 r # md5 r MD5 (r) = 92b48057a6af390fa337523c10b757bc