Gentoo Archives: gentoo-user

From: Christopher Koeber <ckoeber@×××××.com>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] Recovering MySQL Database from EXT4 Formatted Hard Disk ...
Date: Wed, 29 Feb 2012 22:18:04
Message-Id: CAEZ7XM1CLZUQSLte-vng+X+tcMZcOXEY802BR-KGo2qGbhw1Xw@mail.gmail.com
In Reply to: Re: [gentoo-user] Recovering MySQL Database from EXT4 Formatted Hard Disk ... by Mick
1 On Wed, Feb 8, 2012 at 4:27 PM, Mick <michaelkintzios@×××××.com> wrote:
2
3 > On Wednesday 08 Feb 2012 11:33:42 Hinnerk van Bruinehsen wrote:
4 > > On 08.02.2012 12:02, Michael Mol wrote:
5 > > > On Tue, Feb 7, 2012 at 6:28 PM, Christopher Kurtis Koeber
6 > > >
7 > > > <ckoeber@×××××.com> wrote:
8 > > >> Hello,
9 > > >>
10 > > >> I am trying to recover MySQL databases (which were properly shut
11 > > >> down) from an EXT4 formatted hard disk.
12 > > >
13 > > > What happened to require the recovery? Which parts of the database
14 > > > server shut down properly, and which didn't?
15 > > >
16 > > >> I loaded the SystemRescueCD distro that you can get online and
17 > > >> when running TestDisk I can see the partitions but I cannot
18 > > >> recover said partitions because it tells me the structure is bad
19 > > >> (any options here, by the way?)
20 >
21 >
22 > > You could try Autopsy & sleuthkit[1].
23 > > Before you do anything to the drive it would be wise to copy it via dd
24 > > so that no accidental write makes anythoing worse...
25 > >
26 > >
27 > >
28 > > [1] http://www.sleuthkit.org/autopsy/desc.php
29 >
30 >
31 > Definitely create an image of the partition first, rather than keep
32 > accessing
33 > the real thing. At this moment you don't know what caused the corruption
34 > - it
35 > could well be a warning of worse things to come as far as this drive is
36 > concerned ... ;-)
37 >
38 > It is much better if you create the image with dd-rescue/ddrescue (can't
39 > recall which of the two packages is claimed to be better). You may also
40 > want
41 > to make a backup copy of the image in case you embark on any destructive
42 > operations on it.
43 >
44 > Multiple passes with ddrescue may recover more bits/bytes so hopefully
45 > you'll
46 > have a more complete set of data to work with.
47 >
48 >
49 > > >> With PhotoRec, I can recover parts of the MySQL Database but I
50 > > >> cannot get the important *.MYD files because I guess PhotoRec
51 > > >> doesn't have the signatures for that type of file.
52 > > >>
53 > > >> So, any options I have at this point?
54 >
55 > You can use dd or hexdump to pick up some blocks at the start of a known
56 > good
57 > *.MYD file, create a signature for PhotoRec and add it on the list of
58 > files to
59 > check for.
60 >
61 > See the instruction of how to go about this here:
62 >
63 > http://www.cgsecurity.org/wiki/Add_your_own_extension_to_PhotoRec
64 > --
65 > Regards,
66 > Mick
67 >
68
69 Never had a chance to reply back but this was very helpful.
70
71 Now to search online to see if people created signatures for "IBD" files
72 (where the actual data for a MySQL database lives) as the headers are
73 different for every sample "IBD" I tried from working databases.
74
75 Regards,
76 Christopher Koeber