LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux > Linux - General
User Name
Password
Linux - General This 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

Tags used in this thread
Popular LQ Tags , ,

Reply
 
Thread Tools
Old 04-02-2008, 04:29 AM   #1
sstendal
LQ Newbie
 
Registered: Apr 2008
Posts: 2
Thanked: 0
Using testdisk to recover deleted lvm2 partition


[Log in to get rid of this advertisement]
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?
sstendal is offline  
Tag This Post , ,
Reply With Quote
Old 04-02-2008, 08:15 AM   #2
Agrouf
Senior Member
 
Registered: Sep 2005
Location: France
Distribution: LFS
Posts: 1,314
Thanked: 19
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.
Agrouf is offline     Reply With Quote
Old 04-02-2008, 09:30 AM   #3
sstendal
LQ Newbie
 
Registered: Apr 2008
Posts: 2
Thanked: 0

Original Poster
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.
sstendal is offline  
Tag This Post , ,
Reply With Quote

Reply

Bookmarks


Thread Tools

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 Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
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
Recover LVM2 with Data? bodaduk Linux - General 4 06-22-2007 10:11 AM
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


All times are GMT -5. The time now is 02:34 PM.

Main Menu
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
RSS2  LQ Podcast
RSS2  LQ Radio
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration