Gentoo Archives: gentoo-user

From: Stroller <stroller@××××××××××××××××××.uk>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] Re: USB Disk failure - Buffer I/O error on device sda2, logical block 1289 lost page write due to I/O error on sda2
Date: Sun, 10 Oct 2010 22:03:19
Message-Id: D261F76B-929C-44F0-8745-54AAE2B64235@stellar.eclipse.co.uk
In Reply to: Re: [gentoo-user] Re: USB Disk failure - Buffer I/O error on device sda2, logical block 1289 lost page write due to I/O error on sda2 by "Fatih Tümen"
1 On 10 Oct 2010, at 17:21, Fatih Tümen wrote:
2 > There problem is I have two more partition with about 80GB of data.
3 >
4 >> ....
5 >> If you need to get data off this disk then we can advise (but search the archives for GNU dd_rescue, or just read its manual) but apart from that there's nothing we can do for this drive.
6 >
7 > I will that a look at dd_rescue, thanks.
8
9
10 My previous spelling was wrong - the GNU version is without the underscore. You want ddrescue NOT dd_rescue.
11
12 $ eix -I rescue
13 [I] sys-fs/ddrescue
14 Available versions: 1.9 1.11 ~1.12
15 Installed versions: 1.11(12:52:56 05/03/10)
16 Homepage: http://www.gnu.org/software/ddrescue/ddrescue.html
17 Description: Copies data from one file or block device to another with read-error recovery
18
19 $
20
21 I have found it very useful. From my previous casual glance at your logs you have some hopes - you may not be able to read block 1289, but you may well be able to get blocks 1288 & 1290. My (limited) experience has been that even with a *really* badly failing hard-drive, over 99% of the blocks are recoverable.
22
23 Confer with the manual <http://www.gnu.org/software/ddrescue/manual/ddrescue_manual.html#Examples> and then do something like:
24
25 ddrescue -f -n /dev/sda2 /mnt/volumes/my_disk/recovered.img recovery.log
26 <wait a day or two>
27 ddrescue -d -f -r3 /dev/sda2 /mnt/volumes/my_disk/recovered.img recovery.log
28
29 (where /dev/sda2 is the partition containing the data you want to recover).
30
31 Keep running `ddrescue -r X` (where X is a number) for as many passes as you can. If you get data off on one pass, then another one may get more, if you have the time for it. If you're really lucky then you'll find that only a block or two are unrecoverable, if you're unlucky then the unrecoverable blocks will be measured in megabytes.
32
33 If you have multiple partitions then post back here (with their sizes and the total size of the disk). You'll need to have at least enough empty space (on a single usable partition) for the whole partition that you want to recover. Ideally you'll have twice that much space, or even three times - this is not the time to skimp on hard-drive capacity. Ideally what you want to do when the above commands have finished is make a copy of recovered.img, so that if one method of recovery doesn't work, you can try another.
34
35 I'm not sure what will happen if you simply tried to loopback mount recovered.img - hopefully fsck would run on it automagically, but I suspect that would be too easy. You might have to use losetup to treat the .img as a block device, and then run fsck on /dev/loop0, or something like that. <http://tinyurl.com/2bllb25>
36
37 If the disk / partition image fscks without toooooo many errors (and a page or two of them would probably be quite acceptable - expect one error per unrecoverable block) then you still need enough free disk space for all the files you intend to copy off.
38
39 Keep posting your progress back here, so we can advise further.
40
41 Stroller.

Replies