Gentoo Archives: gentoo-user

From: Stroller <stroller@××××××××××××××××××.uk>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] Re: is ddrescue this slow?
Date: Wed, 13 Jan 2010 05:18:54
Message-Id: 43DAF2B0-70F0-4095-84A5-9F3C7DDAF069@stellar.eclipse.co.uk
In Reply to: Re: [gentoo-user] Re: is ddrescue this slow? by Valmor de Almeida
1 On 11 Jan 2010, at 00:14, Valmor de Almeida wrote:
2 > ...
3 > Indeed I am using GNU ddrescue and the -n flag is supposed to expedite
4 > the recovery of data as posted in
5 > http://www.cgsecurity.org/wiki/Damaged_Hard_Disk
6 >
7 > "The best solution - both faster and more efficient - seems to be
8 > Antonio Diaz's 'ddrescue' (ddrescue)"
9 >
10 > # first, grab most of the error-free areas in a hurry:
11 > ./ddrescue -n /dev/old_disk /dev/new_disk rescued.log
12 > # then try to recover as much of the dicy areas as possible:
13 > ./ddrescue -r 1 /dev/old_disk /dev/new_disk rescued.log
14
15 I remember reading a very similar summary - the words "grab most of
16 the error-free areas in a hurry" seem quite familiar - when I started
17 using ddrescue, a few months ago.
18
19 > The first step above finished; don't know how long it took but it was
20 > a long time (maybe 20 hours or more?) and the screen output was
21 >
22 >
23 > Press Ctrl-C to interrupt
24 > Initial status (read from logfile)
25 > rescued: 0 B, errsize: 0 B, errors: 0
26 > Current status
27 > rescued: 58811 MB, errsize: 48909 kB, current rate: 83 B/s
28 > ipos: 58860 MB, errors: 95, average rate: 1365 kB/s
29 > opos: 58860 MB, time from last successful read: 0 s
30 > Copying non-tried blocks...
31 > ddrescue: write error: Input/output error
32 >
33 >
34 > Comparing with the screen output at the time of my first post,
35 >
36 > Current status rescued went from 58656 MB to 58811 MB, errsize went
37 > from 4408 kB to 48909 kB.
38 >
39 > Don't know how the write error: Input/output error message affect the
40 > data in the new drive copied to. Not sure whether I should do the next
41 > step with option -r 1.
42 >
43 > This failed drive is still bootable and the corruption is in the
44 > partitions /var (which I do not care) and /home; these cannot be
45 > mounted. I would like to attempt to get a couple of files from /home
46 > that were not in the most recent backup. Maybe I should try to rescue
47 > only the partition /home. However this partition is under LVM.
48 > Specifically, /dev/sda4 is a linux LVM partition. The volume group is
49 > vfda and the logical volume of interest is /dev/vfda/home which has
50 > reiserfs file system. Is it possible to rescue data only from this
51 > partition when under LVM?
52
53 I would try running fsck on a copy of the image.
54
55 Your original command was to clone to /dev/sdc - you can now safely
56 `dd if=/dev/sdc2 of=/mnt/foo/olddrive.img` and then loopback mount the
57 image. You should be able to fun fsck on it, also. (Where sdc2 is the
58 partition /home was on)
59
60 I have invested in a fair amount of hard-drive space recently, and the
61 extra room allows you a lot of breathing space for operations like this.
62
63 If fsck doesn't work then you can dry photorec. I would try on both
64 sdcX and olddrive.img (where X is the partition /home was on).
65
66 DISCLAIMER: I don't know anything about LVM or how that might affect
67 things. In fact, I avoid LVM for this reason. I might do something
68 like backing up (using `dd`) the other partitions that contribute to
69 the affected volume groups, then lvm-mount them together with your
70 sdcX and try an reiserfsck on the resultant logical volume. The idea
71 position to be in (well, "ideal" once we have accepted the fact of the
72 failed drive) is to have images of all your drives before you start
73 mucking about any further; if the repair attempt fails you can revert
74 to the images and try again a different way.
75
76
77 >> Valmor: when I ran the `ddrescue -dr3` stage I had no success at
78 >> all, however the system was fine after a reboot & a `chkdsk`.
79 >> Better than it had been, in fact, on the old hard-drive. You might
80 >> have more luck getting *some* of the blocks showing as failed when
81 >> you run it on your drive, but don't be too disheartened if you don't.
82 >
83 > Stroller, you mean your rescue.log showed no problematic entries?
84
85 No, I had only one line in my rescue.log, my most recent attempt at
86 this. The `ddrescue -dr3` stage errored without managing to recover
87 that block, but it seems like the data in that block was not really
88 important.
89
90 The old drive failed to completely boot Windows because of this bad
91 block; the new drive - with that block missing - booted fine (perhaps
92 after a chkdsk). So I can only conclude that - using the old drive -
93 Windows died because some unimportant system file was thought to be
94 there. It couldn't read the block and kept trying. With the new drive
95 the file was clearly absent or damaged, so Windows was able to
96 continue the boot without it. Perhaps some unimportant system service
97 failed to start, but in any case the system worked fine.
98
99 I'm pretty sure I also dealt last year with another drive which had
100 about 3 errors on it, but I don't remember any of the details.
101
102 > I got over 400 lines in my rescue.log file.
103 >
104 > root@sysresccd /root % head rescued.log
105 > # Rescue Logfile. Created by GNU ddrescue version 1.11
106 > # current_pos current_status
107 > 0xDB45D9000 ?
108 > # pos size status
109 > 0x00000000 0x9CE341000 +
110 > 0x9CE341000 0x00000200 -
111 > 0x9CE341200 0x0001F000 *
112 > 0x9CE360200 0x00000200 -
113 > 0x9CE360400 0x00020000 *
114 > 0x9CE380400 0x3BD63AC00 +
115
116
117 It seems to me that your drive was in a very bad way, and this is why
118 you has so many errors. You don't say how large it was - ddrescue
119 terminated at 58811 MB. Was it only a 60GB drive?
120
121 It seems to me that ddrecue died before managing to complete the first
122 pass. I don't think you should have seen the "ddrescue: write error:
123 Input/output error" line if the first pass completed ok - you should
124 have just seen something like "Completed: XXX copied, Y errors". Then
125 you would try a second pass (eg `ddrescue -r 3`) and *hope* to get
126 fewer errors the second time around; the -r 3 tells ddrescue to keep
127 trying, make 3 attempts to read this block before giving up. Because
128 the logfile keeps a record of the failed blocks, when you run ddrescue
129 with the -r flag it only tries the blocks that have previously failed.
130 So you can quite safely keep running `ddrescue -r 3 /dev/old_disk /dev/
131 new_disk rescued.log`, optimistically hoping that maybe this time the
132 read will be successful. The only important thing is to make sure you
133 always use the same destination and rescued.log file when doing so -
134 using the same rescued.log file ensures you're not wasting time trying
135 blocks that you've already got on a previous pass, and using the same
136 destination ensures that any blocks that are read successfully this
137 time are written into an image file that is combined from the multiple
138 passes.
139
140 I think that the "write error: Input/output error" line indicates that
141 your drive really has failed badly & catastrophically, and that you're
142 not going to get any more off it. Feel free to try though. Console
143 yourself with the knowledge that ddrescue was the best tool for the
144 job, and that in using it you did all you could have done to recover
145 your data.
146
147 The number of errors you saw (95) indicates your drive was much worse
148 than the ones I have recently worked on. I'm pretty sure my
149 rescued.log was less than 40 lines long (I could `cat` or `less` it,
150 and it fitted within my 80 wide x 50 tall terminal, I'm sure).
151
152 I hope this makes sense. I'm by no means an expert, but I'm glad to
153 help in any way possible. Having lots of disk space helps a lot.
154
155 Stroller.

Replies

Subject Author
Re: [gentoo-user] [CLOSED] Re: is ddrescue this slow? Valmor de Almeida <val.gentoo@×××××.com>