3

Ok, so my Ubuntu 12.10 install seems to have gone slightly sideways. It currently boots from a Compactflash card that I was planning on replacing soon, but as luck would have it it's gone down now. The boot process gets to a certain point and then just sits there, and if I boot up a distro off a flash drive and then mount up the LVM partition, the live distro freezes after a couple of minutes. Now I'm not averse to installing and starting again, but I would love to pull off all my config files etc (all user data is stored on a separate ZFS pool).

Is it worth me trying to fsck the drive first, or am I better off avoiding doing anything more to it?

If so, how about importing the ZFS pool and then DDing the filesystem to an image on the pool? That way I'll be able to gain access to it.

RichVel
  • 3,633
alanbeard
  • 141

1 Answers1

2

I'd NOT fsck the drive as is - this risks damaging data further. I've actually done this recovery process in other situations, and I think it should work here.

Firstly, you want a copy of the drive, well, as far as possible. While DD is the tool everyone thinks of using, gnu ddrescue (aka ddrescue in the repositories - NOT dd_rescue, which is an unrelated bit of software) is probably what you want to do - this copies the contents of the drive, skipping anything thats messed up. I'd suggest imaging the root device (/dev/sdx) rather than a partition. As a bonus, ddrescue has a much simpler syntax than vanilla dd.

Then loopmount the images in your system - a standard loopmount will do with a single partition, but I favour kpartx for this - kpartx -a imagename.img mounts all the partitions inside imagename.img. You can then treat the image as any partition and run your preferred recovery software.