Gentoo Archives: gentoo-amd64

From: Duncan <1i5t5.duncan@×××.net>
To: gentoo-amd64@l.g.o
Subject: [gentoo-amd64] Re: not amd64 specific - disk failure
Date: Mon, 19 Nov 2007 17:20:01
Message-Id: pan.2007.11.19.17.14.59@cox.net
In Reply to: Re: [gentoo-amd64] not amd64 specific - disk failure by Raffaele BELARDI
1 Raffaele BELARDI <raffaele.belardi@××.com> posted 47418F30.6050607@××.com,
2 excerpted below, on Mon, 19 Nov 2007 14:27:12 +0100:
3
4 > Most of the resources I've read up to now imply that e.g. /dev/sdc1 is
5 > detected and a 'bad superblock' message displayed when attempting to
6 > mount.
7 >
8 > In my case the kernel is unable to detect /dev/sdc1, after the long list
9 > of read errors below it ends up with only /dev/sdc.
10 >
11 > Does this look like superblock issue, or something worse?
12
13 If you have a spare drive of the same size or larger, you can try dd, or
14 probably better yet, merge dd-rescue and try it. They copy a file or
15 part of one, in this case an entire block device, from one location to
16 another, "raw". What you want to do is copy the entire bad device, /dev/
17 sdc above, to the new device. Then you have a copy to play around with
18 without worrying about making the bad device worse before you get
19 whatever you were trying to get off of it, off.
20
21 dd-rescue is different than dd in that if there are bad blocks, it will
22 run until it starts hitting them, then it will work backwards from the
23 other end until it hits them there, then it'll try blocks in the middle.
24 Thus, if you have good blocks, bad blocks, good blocks, bad blocks, good
25 blocks, dd-rescue recovers more of the disk in a reasonable amount of
26 time, as compared to straight dd, which will try straight thru only.
27
28 (The problem is that once you start hitting bad blocks, everything slows
29 down, because the system tries and retries the bad block multiple times
30 before giving up, taking minutes to read a block or finally decide it
31 can't, before moving on, where it'd read a good block in seconds. Thus,
32 to work thru even a few hundred bad blocks can take DAYS. Giving up
33 after a few and starting from the other end, then trying in the middle,
34 increases the number of blocks recovered, without sitting there waiting
35 for days for it to work thru all the bad ones and get to the rest of the
36 good ones again, and that's what dd-rescue does for you, automates the
37 give up and try from the other end and then in the middle stuff.)
38
39 The thing to remember when working with either program is that you want
40 to be **VERY** **SURE** you get the right devices specified, particularly
41 for the output device. If you tell it to write to the device that your
42 main system is on instead of the new empty device, it WILL overwrite your
43 main system device, boot record, partition table, and all. Thus, make
44 TRIPLE SURE you have the right output device specified before you hit
45 that enter key.
46
47 The reason I'm suggesting dd/dd-rescue is because they'll grab the raw
48 data (what they can of it) directly off of the device you point them at (/
49 dev/sdc above, but as I said, be absolutely sure the devices aren't
50 reordered after you attach the new one). Since you can't mount the
51 partition, you need something that can grab the info off of the
52 unpartitioned drive itself. Then, once you get a copy to work with, you
53 can check what fdisk says about it and go from there.
54
55 In fact, if the data is worth it and you have the money, you may want to
56 get TWO replacement drives, one to make a "safe" copy to, and a second to
57 make a working copy (from the safe copy) to. Then you play with the
58 working copy, and if you screw up, you can simply recopy from the safe
59 copy, without having to go back to the damaged drive -- because it's
60 possible you'll only get the one chance to get stuff off of the damaged
61 one.
62
63 If the damage is severe enough dd-rescue can't pull anything off,
64 consider wrapping the drive in paper for padding and moisture absorption)
65 then plastic (preferably double- or triple-wrapped), then put it in your
66 freezer overnight. There are quite a number of tales of folks that had
67 dead drives that they were able to revive long enough by freezing them,
68 to get the stuff or at least part of the stuff off that they needed to.
69 Keep in mind that as soon as you take it out and plug it in, it'll start
70 warming up, and you may only have a few minutes, if it's bad enough. In
71 that case, if you have just a few smaller files you really want, you can
72 hope the filesystem is usable again, and you may have time enough to
73 retrieve them. If that's not the case, and you need to go for the bulk,
74 then you can write down how far you get, then try freezing it again, and
75 tell dd-rescue to start where it stopped the second time. Of course, you
76 may have a limited number of times even freezing the drive will work, and
77 you likely won't recover the entire thing this way, but if some is better
78 than none...
79
80 There are special forensics LiveCD distributions out there. Try STD and
81 INSERT (google them, that's how I found them), both based off KNOPPIX, I
82 believe. INSERT is small enough to fit on the small credit/business-card
83 sized CD, 180 MB or some such. STD is a full-sized CD-image, basically a
84 normal KNOPPIX only with enough stuff removed to load the extra forensics/
85 recovery/etc tools. It even still has some games (Frozen Bubble, etc) on
86 it. They may help you recover something workable off the image you
87 copied over with dd-rescue. Of course, since they have a bunch of
88 programs, including AV and other MS Windows recovery stuff (there's a
89 nice MS eXPrivacy password blanker utility on there, my boss ran into
90 trouble, hadn't created a password reset disk, and I had to use it on his
91 box, yes, it was his), and network troubleshooting stuff as well, you'll
92 probably want to grab them and play around with them a bit to see what
93 they are like, before actually starting to work on recovering your data.
94
95 Hope that's useful.
96
97 --
98 Duncan - List replies preferred. No HTML msgs.
99 "Every nonfree program has a lord, a master --
100 and if you use the program, he is your master." Richard Stallman
101
102 --
103 gentoo-amd64@g.o mailing list

Replies

Subject Author
Re: [gentoo-amd64] Re: not amd64 specific - disk failure Raffaele BELARDI <raffaele.belardi@××.com>