Date: Sun, 22 May 2011 02:19:00 -0400 From: grarpamp <grarpamp@gmail.com> To: freebsd-fs@freebsd.org Subject: Re: Write reallocator Message-ID: <BANLkTinE=Gn4qANWPjVvysZ2o7Zu%2B-%2BPQQ@mail.gmail.com> In-Reply-To: <6806.1305962015@critter.freebsd.dk> References: <BANLkTimRA==j01=AtdDaRMNk5SOU8So5uw@mail.gmail.com> <6806.1305962015@critter.freebsd.dk>
next in thread | previous in thread | raw e-mail | index | archive | help
>>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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?BANLkTinE=Gn4qANWPjVvysZ2o7Zu%2B-%2BPQQ>