rebuild partition table with LVM physical volumes

How to use TestDisk to recover lost partition
Post Reply
Posts: 2
Joined: 29 Mar 2012, 17:59

rebuild partition table with LVM physical volumes

#1 Post by franz » 29 Mar 2012, 18:18

Hi everybody,

I happened to wipe out the beginning 1MB of a 2TB disk
which was partitioned with the following LVM scheme:
three LVM logical volumes (root/swap/home)
on two LVM physical volumes, namely,
two different partitions of this large disk
(the second one was added as a second LVM pv
after cloning a smaller 320GB disk which was to be replaced)

now, the testdisk advanced analysis seem to find the first partition correctly,
but sadly, it fails to detect the second one, therefore,
if I write the recovered partition scheme,
the "home" Logical Volume (which of course is the one I care of)
appears to be UNAVAILABLE

I was wondering what exactly does the "deep search" mode?
could it be that it misses the "signature" that marks the beginning
of the (much larger) second LVM physical volume?

I'm afraid I cannot make use of any LVM analysis/recovery tool
as long as I do not feed LVM the correct physical volume start and size


Francesco 'Franz' Castelli

Sponsored links

Posts: 2
Joined: 29 Mar 2012, 17:59

Re: rebuild partition table with LVM physical volumes

#2 Post by franz » 30 Mar 2012, 14:38

Great news guys (at least for me)!

I succeeded to recover the whole LVM structure,
and even the boot capability via grub-install (whew!)

sadly, while the first PV was successfully detected
by testdisk 'deep search' mode, for the missing second PV
I had to work my way through the disk physical sectors using lde,
searching for the same data pattern that showed
in the beginning sectors of the first PV

once found that pattern, I did a trivial sector#-to-CHS conversion
and manually added the tentative third partition via testdisk
(I already knew that the partition spanned 'til the end of the physical disk)

I wonder why did testdisk fail to do what I did manually,
however, many, many thanks to Mr Cristophe Grenier
and to all the other guys and girls who helped writing,
fixing and improving testdisk !!!


Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests