Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - General
User Name
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.


  Search this Thread
Old 04-02-2008, 04:29 AM   #1
LQ Newbie
Registered: Apr 2008
Posts: 7

Rep: Reputation: 0
Using testdisk to recover deleted lvm2 partition

I am using testdisk to recover a lost lvm2 partition. The volume group is using only a single physical volume (/dev/md1).
The command "testdisk /dev/md1" creates a list of possible partitions to recover (with a lot of junk). My lost partition was there, listed as a "Linux" partition.

However, i don't understand what to do now. Testdisk seems to only let me recover this as an ordinary partition. It shows the cylinder information, with start and end cylinder for the partition. Is it possible to use this to manually edit the lvm configuration in some way. Or can testdisk recover this as an lvm2 partition for me?
Old 04-02-2008, 08:15 AM   #2
Senior Member
Registered: Sep 2005
Location: France
Distribution: LFS
Posts: 1,596

Rep: Reputation: 80
A partition is just a start and an end cylinder. If testdisk is correct that it starts where it starts and ends where it ends, then it doesn't matter what's inside because it's there.
If there is an lvm2 physical volume inside then recovering the partition will recover the physical volume. pvdisplay should detect it when it's recovered.
Old 04-02-2008, 09:30 AM   #3
LQ Newbie
Registered: Apr 2008
Posts: 7

Original Poster
Rep: Reputation: 0
I solved this.

The lvm system maintains backup copies of the lvm configuration in the /etc/lvm/archive folder. I found the backup copy from just before my lvm volume was deleted. By using "vgcfgrestore" and the archive file i was able to restore the lvm configuration as it was before the lvm volume was deleted.

"vgcfgrestore -l VolGroup00" shows a list of backed up configurations. I found that the correct configuration was in the file "/etc/lvm/archive/".
Running "vgcfgrestore -f /etc/lvm/archive/" did the trick.


lvm2, recover

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Recover LVM2 with Data? bodaduk Linux - General 5 09-27-2010 12:16 PM
How to recover deleted FAT 32 partition? alan_ri Linux - General 4 02-21-2008 12:06 PM
how to fix when testdisk cant recover ext2/ext3? frenchn00b Linux - Newbie 3 07-19-2007 04:46 PM
Software to help me recover 'Deleted' FAT32 Partition Data? flamesrock Linux - Software 8 07-26-2005 10:39 PM
Recover deleted files from a Win partition in Linux? PenguinPwrdBox Linux - General 3 08-03-2004 04:05 AM > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 03:06 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration