LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 01-14-2012, 10:46 AM   #1
ciwl
LQ Newbie
 
Registered: Jan 2012
Posts: 3

Rep: Reputation: Disabled
LVM and lost information


Hello,

There is a virtual machine Xen (Centos 5.6). Inside was a lvm volume. At some point, a failure of power and the error appears. Launched fchk, fixed a bug. I launched it one more time - fell errors and the system not loading.
Mounted on another virtual machine (also Centos 5.6), tried to rename VG, but the second VM also stop loading (its data is not so critical, it is a test).

Created a third machine, the system disk without lvm, mounted a problem lvm-partition.
It became visible name given partition in the process of renaming on previous VM. Drive with the necessary data, appear to do was not in volume group. Nothing smarter than create a new vg and mount this disk does not come up.

# Vgdisplay
--- Volume group ---
VG Name resquevol
System ID
Format lvm2
Metadata Areas 1
Metadata Sequence No 1
VG Access read / write
VG Status resizable
MAX LV 0
Cur LV 0
Open LV 0
Max PV 0
Cur PV 1
Act PV 1
VG Size 135.00 GiB
PE Size 4.00 MiB
Total PE 34 559
Alloc PE / Size 0 / 0
Free PE / Size 34 559 / 135.00 GiB
VG UUID Qnva3K-DX6q-a3a2-wqIe-QE0D-MQue-vrGLiw

Initialization of logical partitions did, only created with the disk vg /dev/xvdb3
Does this mean that my data is destroyed? If not, how to restore it?

PS sorry for my bad English
 
Old 01-15-2012, 03:44 AM   #2
mpapet
Member
 
Registered: Nov 2003
Location: Los Angeles
Distribution: debian
Posts: 453

Rep: Reputation: 46
The next step is to check and see if loop has max_part option. (modinfo loop as root) Reload loop with max_part=16.

Then losetup pointing to the troubled disk image.

From there, things get kind of vague for me because I'm not a Xen guy. You need to see if there's a FUSE module to mount the disk image. If there is, then it's pretty easy. Losetup /dev/loop0 /path/to/disk/image. If you did it right, Linux magically detects the partitions and will have a /dev/loop0 device, and another /dev/loop0p1 device Mount /dev/loop0 /mnt/some_dir -o read-about-fuse-module-options. If that doesn't work, try the /dev/loop0p1 device.

Once you get the file system mounted on a loop device, fdisk and testdisk is your best bets.

http://www.cgsecurity.org/wiki/TestDisk It's in Debian's repo's. That's how easy Debian is.
 
1 members found this post helpful.
Old 01-15-2012, 10:11 AM   #3
ciwl
LQ Newbie
 
Registered: Jan 2012
Posts: 3

Original Poster
Rep: Reputation: Disabled
Thanks for reply.

I looped my bad partition /dev/xvdc3 to /dev/loop0 , but I get "mount: unknown filesystem type 'LVM2_member'" while trying "mount /dev/loop0 /mnt". Module fuse already loaded

Code:
 lsmod | grep -i fuse
fuse                   50924  0
 
Old 01-15-2012, 12:38 PM   #4
mpapet
Member
 
Registered: Nov 2003
Location: Los Angeles
Distribution: debian
Posts: 453

Rep: Reputation: 46
Quote:
Originally Posted by ciwl View Post
Thanks for reply.

I looped my bad partition /dev/xvdc3 to /dev/loop0 , but I get "mount: unknown filesystem type 'LVM2_member'" while trying "mount /dev/loop0 /mnt". Module fuse already loaded

Code:
 lsmod | grep -i fuse
fuse                   50924  0
If you reinserted the loop kernel module with the option I mentioned, there will be more than one /dev/loop0, probably a /dev/loop0p1. Try mounting it.

If that doesn't work, still lots of options. You can find the ext3/4/ntfs/whatever partition offset in fdisk (fdisk -l /dev/loop0) and then mount it specifying the offest. Lots of examples of using the offset option around. Another option is to run testdisk on /dev/loop0 and see what it finds. I'm pretty confident the partition is not lost. You are going to know more about partitions/disks by the time you find/mount the partition.

Very last ditch effort, create a backup of the entire disk on /dev/loop0. Then losetup /dev/loop1 /path/to/dd-image Try activating the logical volume using /dev/loop1 as the device. This is a bit tricky because you aren't creating a new logical volume. That would rewrite the partition information. You are just changing the device path of an existing LVM. Which is why doing it on a disk image is strongly recommended.

Last edited by mpapet; 01-15-2012 at 12:42 PM.
 
1 members found this post helpful.
Old 01-15-2012, 02:36 PM   #5
ciwl
LQ Newbie
 
Registered: Jan 2012
Posts: 3

Original Poster
Rep: Reputation: Disabled
Many thanks for your help.

The issuse solved in such way: I manually edit vgcfgbackup-file, adding there my lost partition (I looked the way in the another my server with almost same lvm config). Then, I make vgcfgrestore and it works fine - losted partition correctly mounted as ext3 so I could navigate there with standard system tools. Data was corrupted, but it was duplicated about 20 times in different places of the FS so I could find a good one.
 
  


Reply


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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Abstract lvm information Linux sandeep_hello Programming 1 03-20-2011 03:48 AM
Trashed LVM partition information - Can I recover it? westiej Linux - Software 1 05-21-2009 03:09 AM
journaling - lost of information hDUQUE Fedora 2 12-08-2008 12:20 PM
Lost my lvm partition timonvo Linux - Software 1 05-15-2007 11:30 AM
I lost my LVM and 11 databases Basher52 Fedora 1 03-25-2004 02:10 AM


All times are GMT -5. The time now is 04:51 AM.

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
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration