Gentoo Archives: gentoo-user

From: Rich Freeman <rich0@g.o>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] data recovery advice needed
Date: Sun, 16 Dec 2018 00:19:53
Message-Id: CAGfcS_=RSLMoKvUqXFyfzZ4+5kYJ+sE16rQ0O-bx0zNUDHeuCg@mail.gmail.com
In Reply to: [gentoo-user] data recovery advice needed by Jack
1 On Sat, Dec 15, 2018 at 6:33 PM Jack <ostroffjh@×××××××××××××××××.net> wrote:
2 >
3 > So, I removed that HDD for safekeeping (completely reinstalled the
4 > laptop on a new drive) and now I'm trying to recover data from an
5 > intact partition on the old drive, the problem being that the drive is
6 > giving some read errors, so I want to minimize access, lest it die
7 > completely.
8
9 Ok, step 1 - make a copy of the drive before you go messing with it.
10 I suggest using ddrescue for this. Basically it works like dd
11 (creates an image of the drive), but it is persistent in the face of
12 read errors.
13
14 Once you have a copy of the drive you can now start experimenting.
15 Obviously keep that copy safe and if you want to write to it create
16 another copy.
17
18 As far as fixing dates goes - the touch suggestion might work but
19 honestly unless you're in a super hurry I'd just do another copy.
20
21 If you've lost any kind of drive metadata such that files are missing
22 completely there are utilities that can scan disk blocks looking for
23 things like text files, or jpegs. That is going to be a massive
24 headache but if you've lost something indispensible it is an option.
25
26 Ultimately your goal is going to be to get the files you care about
27 off the drive. Then you can just copy/rsync them to a completely
28 fresh filesystem - I wouldn't go trying to copy the old filesystem
29 using dd if it has been subject to read errors or especially partial
30 overwrites of metadata. You want the metadata to be clean.
31
32 And then once you have your data back on a disk give some thought to
33 your backup strategy. If you care about data enough to be going
34 through trouble to rescue it, you should probably have a backup of it.
35 When I was messing around with btrfs and the filesystem ate my data I
36 wasn't messing around with hex editors - I just wiped the filesystem
37 and rsynced from a backup. Sure, it takes time, but you know the
38 filesystem is completely clean when you're done.
39
40 --
41 Rich

Replies

Subject Author
Re: [gentoo-user] data recovery advice needed Jack <ostroffjh@×××××××××××××××××.net>