Gentoo Archives: gentoo-user

From: Stroller <stroller@××××××××××××××××××.uk>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] Re: Desperately need advice on fixing a corrupt XFS partition
Date: Tue, 09 Dec 2008 21:57:51
Message-Id: DD89A4E9-5115-4976-9EB1-DF71A117ECCA@stellar.eclipse.co.uk
In Reply to: [gentoo-user] Re: Desperately need advice on fixing a corrupt XFS partition by Paul Hartman
1 On 9 Dec 2008, at 17:49, Paul Hartman wrote:
2 > ...
3 > xfs_repair exists, but the man page says it can only be used against
4 > clealy unmounted drives... which seems kind of funny. I ran it anyway,
5 > in read-only mode, and it was unable to find the primary superblock
6 > and started scanning the disk for the secondary. I aborted it because
7 > I don't know how much torture this drive can take.
8 >
9 > When I run "less -f /dev/sdf1" i can see amongst the bits all of the
10 > names of my directories and files etc... so I am pretty sure the data
11 > is there and readable, but I can't figure out how to get XFS to go
12 > ahead and mount it so I can copy all of that stuff off and swear off
13 > USB hard drive adapters forever. :)
14
15 I would probably `dd` the whole drive to a new disk.
16
17 You want to copy everything off one way or the other, so the minimum
18 amount of torture you need to inflict upon the drive is reading every
19 bit from it once. Ok, you probably only want to read *some* bits of
20 the disk, so you only really need to read x% of that, but with an
21 uncertain recovery strategy you may find that you need to read some
22 bits of the fisk more than once.
23
24 If the drive can survive being completely read once, then `dd` allows
25 you to do what the heck you like with the image whilst you make
26 different attempts. I would personally try to find two drives - one at
27 least as large as the failing one and one a bit larger. Format the
28 larger disk ext3 and `dd if=/dev/failing-disk of=/mnt/largest-disk/
29 image.img` then `dd if=/mnt/largest-disk/image.img of=/dev/at-least-as-
30 large-disk`.
31
32 You can then work on the disk that is "at least as large", and even if
33 xfs_repair (or whatever) fails & b0rks the filesystem up even worse,
34 you can always recreate the last known "good" state.
35
36 Stroller.