LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
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.

Notices



Reply
 
Search this Thread
Old 04-02-2008, 05:29 AM   #1
sstendal
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, 09:15 AM   #2
Agrouf
Senior Member
 
Registered: Sep 2005
Location: France
Distribution: LFS
Posts: 1,591

Rep: Reputation: 79
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, 10:30 AM   #3
sstendal
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/VolGroup00_00054.vg".
Running "vgcfgrestore -f /etc/lvm/archive/VolGroup00_00054.vg" did the trick.
 
  


Reply

Tags
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 01:16 PM
How to recover deleted FAT 32 partition? alan_ri Linux - General 4 02-21-2008 01:06 PM
how to fix when testdisk cant recover ext2/ext3? frenchn00b Linux - Newbie 3 07-19-2007 05:46 PM
Software to help me recover 'Deleted' FAT32 Partition Data? flamesrock Linux - Software 8 07-26-2005 11:39 PM
Recover deleted files from a Win partition in Linux? PenguinPwrdBox Linux - General 3 08-03-2004 05:05 AM


All times are GMT -5. The time now is 06:34 AM.

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