LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 11-07-2014, 11:17 AM   #1
rodrigo.baldasso
LQ Newbie
 
Registered: Nov 2014
Posts: 3

Rep: Reputation: Disabled
Recover files from deleted LVM volume


Hi guys,

Our system has deleted one VHD-* volume from our VG, and unfortunately this VM (we run XenServer) wasn't on our backup routine yet.

I was able to recover a lot of data using PhotoRec, however I don't have the .MYD that stores the MySQL data, which was the most important data.

There's any way to recover this LVM partition, or the data inside? I tried extgrep, but it only worked with the non-LVM partition, I wasn't able to use in the LVM partition (always said that superblock magic number is invalid, etc..).

Thanks.
 
Old 11-07-2014, 01:21 PM   #2
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: Rocky Linux
Posts: 4,779

Rep: Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212
As long as you have made no other changes to that VG, you can look in directory /etc/lvm/backup for the file that was saved just before that volume was deleted (look at the "description = ..." lines near the top of each file), and then use vgcfgrestore with the "--file" option to restore that VG's configuration back to the way it was. If that VG is still in use and there were subsequent changes to its configuration, you have to be very careful or you risk damage to its current contents.
 
Old 11-08-2014, 05:07 AM   #3
rodrigo.baldasso
LQ Newbie
 
Registered: Nov 2014
Posts: 3

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by rknichols View Post
As long as you have made no other changes to that VG, you can look in directory /etc/lvm/backup for the file that was saved just before that volume was deleted (look at the "description = ..." lines near the top of each file), and then use vgcfgrestore with the "--file" option to restore that VG's configuration back to the way it was. If that VG is still in use and there were subsequent changes to its configuration, you have to be very careful or you risk damage to its current contents.
Hi!

Unfortunately, just after the vm deletion, has been created a new disk in the same 'pv0' stripe.
 
Old 11-08-2014, 12:42 PM   #4
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: Rocky Linux
Posts: 4,779

Rep: Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212
Quote:
Originally Posted by rodrigo.baldasso View Post
Unfortunately, just after the vm deletion, has been created a new disk in the same 'pv0' stripe.
Then there is probably not much you can do beyond what photorec has already recovered. Reformatting with the same type of filesystem that was there before ensures that all of the previous filesystem metadata is overwritten. If all that was done was making a new PV and LV (i.e., no mkfs), then the old filesystem would still be there, perhaps not aligned at the start of the new LV, but still there. Which was it?

Last edited by rknichols; 11-08-2014 at 12:45 PM.
 
Old 11-09-2014, 12:13 PM   #5
rodrigo.baldasso
LQ Newbie
 
Registered: Nov 2014
Posts: 3

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by rknichols View Post
Then there is probably not much you can do beyond what photorec has already recovered. Reformatting with the same type of filesystem that was there before ensures that all of the previous filesystem metadata is overwritten. If all that was done was making a new PV and LV (i.e., no mkfs), then the old filesystem would still be there, perhaps not aligned at the start of the new LV, but still there. Which was it?

Hi,

We had a CentOS installations, só probably was another lvm with ext3 inside!

Also, the new LV it's smaller than the old, and contain no data inside (was just a new virtual disk created on the server, but never used).

Thanks

Last edited by rodrigo.baldasso; 11-09-2014 at 12:15 PM.
 
  


Reply



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
[SOLVED] How to recover deleted files from a fat32 volume in Linux? colucix Linux - General 12 01-24-2019 09:56 PM
can't recover LVM volume: Please specify a *single* volume group to restore SoftDux Linux - General 1 08-04-2011 03:31 PM
Recover deleted LVM? your_shadow03 Linux - Newbie 1 02-26-2010 06:43 AM
Need to recover data from a LVM volume deyv Linux - General 13 07-25-2005 05:43 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

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

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
Open Source Consulting | Domain Registration