Linux – Recover data from corrupted LVM partition with TestDisk

data-recoverylinuxlvmtestdiskUbuntu

I had setup 3 disks in a LVM array with each disk holding some data. A few weeks back one of the disks "disappeared" from the LVM array and BIOS. After rebooting, the disk reappeared but does not display any of the data that was in it. The drive held a collection of ebooks that I can't easily rebuild so I'm keen to see if I can recover the data on it.

I'm trying to use TestDisk but have had little success so far. When I launch TestDisk to analyze the drive, I get the following message:

Initial Testdisk Output

Once I finish the Quick Search, I get an error about the Hard disk size being too small:

After Quick Search

I can then see that there are two partitions:

Partition Info

Trying to list the files however, just throws an error message:

Filesystem error

From GParted, It seems like the CHS settings detected by TestDisk are correct so the Disk too small error is a little baffling:

Gparted

I'm using TestDisk 6.13 on Ubuntu 12.04 LTS. Any suggestions on how I should proceed from here?

Best Answer

I wonder if the problem you are having is that Testdisk is looking for useable partitions and not recognizing it as an LVM partition.

One thing which might be worth looking at (although not sure if it will help epubs, although it should be able to recover PDFs) is "Photorec" - which will scan the raw disk and try and recognise content based on signatures and recover it.

Another question is are you able to add the volume back into LVM - have you played arround with the "pvscan" tool, and if so, what output have you received ?

Also have a look at this, this and this link about recovering LVM partitions. (Of-course, you really want to do a backup first - maybe DD everything to free disks if you have them)

Also, can you tell us a bit more about your setup, ie was this disk part of a single larger volume, or was each disk a separate volume, and provide the output of "pvs;vgs" - which might give some additional clues based on how other volumes were set up.

Related Question