LinuxQuestions.org
Register a domain and help support LQ
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 01-03-2008, 09:46 AM   #1
neuralnet
LQ Newbie
 
Registered: Aug 2007
Distribution: Ubuntu 7.04 (Feisty)
Posts: 9

Rep: Reputation: 0
Broken LVM Ubuntu Feisty. Recovery Possible?


Hi There,

I previously posted my question
here but gave up too easily.. I've done some reading and want to tackle this again, there is 10 years of data there that I have to get back :/ All help gratefully received!

Basically, I had 2 mirror LVMs, one called 'ivor' and one called 'engine' (two 3 x 500gb SATA arrays) which backed up to each-other overnight. I had 2 disks fail simultaneously (both drive 3 of each array). After much poking about and futile attempts to get at the data in the meantime I find the following;

Code:
root@bernards-server:~# vgdisplay
  Couldn't find device with uuid 'McsMZm-0flm-g7Fx-0hBU-8hl8-K6GK-cyJDs5'.
  Couldn't find all physical volumes for volume group engine.
  Couldn't find device with uuid 'McsMZm-0flm-g7Fx-0hBU-8hl8-K6GK-cyJDs5'.
  Couldn't find all physical volumes for volume group engine.
  Volume group "engine" not found
  --- Volume group ---
  VG Name               ivor
  System ID             
  Format                lvm2
  Metadata Areas        2
  Metadata Sequence No  8
  VG Access             read/write
  VG Status             resizable
  MAX LV                0
  Cur LV                0
  Open LV               0
  Max PV                0
  Cur PV                2
  Act PV                2
  VG Size               931.52 GB
  PE Size               4.00 MB
  Total PE              238468
  Alloc PE / Size       0 / 0   
  Free  PE / Size       238468 / 931.52 GB
  VG UUID               TRGfWh-u5AE-xH7B-n8ko-gij5-1DEQ-QrfauN
but if I run lvdisplay I get;

Code:
root@bernards-server:~# lvdisplay
  Couldn't find device with uuid 'McsMZm-0flm-g7Fx-0hBU-8hl8-K6GK-cyJDs5'.
  Couldn't find all physical volumes for volume group engine.
  Couldn't find device with uuid 'McsMZm-0flm-g7Fx-0hBU-8hl8-K6GK-cyJDs5'.
  Couldn't find all physical volumes for volume group engine.
  Volume group "engine" not found
I didn't set up the arrays but I REALLY need to get the data back as the guy that did is liable to loose a bunch of data. I'm an LVM noob so please be gentle I'm scared that I'm gonna lose the data at the next keystroke so I'd be grateful of some good advice.

The ivor volume group is the right size for an array that lost a disk (i.e. 1gb instead of 1.5gb) so do I just need to recreate the ivor local volume & I should be able to get at the data ? If so, how do I do that ?

Recovering either 'engine' or 'ivor' should be feasible as long as I can copy the data off either LVM minus 1 disk..

Last edited by neuralnet; 01-03-2008 at 09:51 AM.
 
Old 01-05-2008, 10:19 PM   #2
Caballero del norte
Member
 
Registered: Apr 2007
Location: Sonoran Desert, USA
Distribution: Ubuntu 8.04
Posts: 30

Rep: Reputation: 16
LVM messed up

First... condolences.

Second, since you describe yourself as a noobie you may have one door open to you that you haven't tried: fsck

fsck must be run on unmounted media.

Get your Feisty 7.04 "Live CD" disk, insert it into your CD drive and boot up. At some point you will be given an opportunity to get to a command line. On the command line, type

fsck -N

[That -N is very important: it keeps it all a dry run!]

Answer Y to everything... this will take some time, so be patient.

This will "dry run" fsck on your file systems. You will see stuff jumping up on your screen and at the very end there ought to be a message telling you what fsck "would have" done.

If you approve of what it would have done (and this can be dicey, do nothing unless you are sure) type on the command line

fsck

and reanswer all those questions with Y.

The file systems will be repaired (we hope). If you have ANY doubts, ask another Linux user (as in a local Linux User Group) to guide you through.

I have repaired file systems using fsck and I have been pleased with the results. Of course, at the end of all this you will possibly find a corrupt file in the midst of your file system - the culprit that started this whole descent into file system hell. See if you can match it up with what it should be... maybe you can repair it (or delete it).

I hope this helps you.
 
Old 01-07-2008, 01:30 PM   #3
neuralnet
LQ Newbie
 
Registered: Aug 2007
Distribution: Ubuntu 7.04 (Feisty)
Posts: 9

Original Poster
Rep: Reputation: 0
Thanks !

Thanks for the reply I was starting to lose hope !

I'll give your suggestion a go & report back. As I said in my 1st post I have 2 broken LVMs, so I do at least get 2 goes at it

Cheers.
 
Old 01-07-2008, 05:07 PM   #4
neuralnet
LQ Newbie
 
Registered: Aug 2007
Distribution: Ubuntu 7.04 (Feisty)
Posts: 9

Original Poster
Rep: Reputation: 0
Hmmmm

Well I gave it a go. Not much happening to be honest. I tried;
Code:
fsck -N
but all I get back is;

Code:
root@bernards-server:~# fsck -N
fsck 1.40-WIP (14-Nov-2006)
[/sbin/fsck.ext3 (1) -- /] fsck.ext3 /dev/hda2
If I specify the device in the path, e.g.

Code:
fsck -N /dev/sda1
I get..

Code:
root@bernards-server:~# fsck -N /dev/sda
fsck 1.40-WIP (14-Nov-2006)
[/sbin/fsck.ext2 (1) -- /dev/sda] fsck.ext2 /dev/sda 
root@bernards-server:~# fsck -N /dev/sda1
fsck 1.40-WIP (14-Nov-2006)
[/sbin/fsck.ext2 (1) -- /dev/sda1] fsck.ext2 /dev/sda1
same for all drives.. there are no entries for them in /etc/fstab and they're not mounted.

All drives come up in gparted as /dev/sda, /dev/sdb, /dev/sdc etc but show as an unknown filesystem but with 'flags' set to lvm. Any ideas why fsck can't see them ?
 
Old 01-08-2008, 08:15 AM   #5
Caballero del norte
Member
 
Registered: Apr 2007
Location: Sonoran Desert, USA
Distribution: Ubuntu 8.04
Posts: 30

Rep: Reputation: 16
Look into this?

Here is some of the documentation for reiserfsck (you can find it running a search for "fsck" if you click "System > Help > System documentation". You may wish to do steps 1 and 2, changing "/dev/hda1" to "/dev/sda" or "/dev/sda1" to see if you get some usable information.

EXAMPLE OF USING
1. You think something may be wrong with a reiserfs partition on /dev/hda1 or you would just like to perform a periodic disk check.
2. Run reiserfsck --check --logfile check.log /dev/hda1. If reiserfsck --check exits with status 0 it means no errors were discovered.
3. If reiserfsck --check exits with status 1 (and reports about fixable corruptions) it means that you should run reiserfsck --fix-fixable --logfile fixable.log /dev/hda1.
4. If reiserfsck --check exits with status 2 (and reports about fatal corruptions) it means that you need to run reiserfsck --rebuild-tree. If reiserfsck --check fails in some way you should also run reiserfsck --rebuild-tree, but we also encourage you to submit this as a bug report.
5. Before running reiserfsck --rebuild-tree, please make a backup of the whole partition before proceeding. Then run reiserfsck --rebuild-tree --logfile rebuild.log /dev/hda1.
6. If the --rebuild-tree step fails or does not recover what you expected, please submit this as a bug report. Try to provide as much information as possible and we will try to help solve the problem. SH EXIT CODES eiserfsck uses the following exit codes:
0 - No errors.
1 - Errors found, esierfsck --fix-fixable needs to be launched.
2 - Errors found, esierfsck --rebuild-tree needs to be launched.
8 - Operational error.
16 - Usage or syntax error.

Good luck.
 
Old 08-20-2008, 07:21 AM   #6
varj
LQ Newbie
 
Registered: Aug 2008
Posts: 1

Rep: Reputation: 0
run fsck against the filesystems, not the device drives.

with lvm, this means /dev/vgname/lvname

first, you need to fix the lvm errors tho, replace the faulty disk and give it the same uuid with pvcreate. or just force remove it.
 
  


Reply

Tags
feisty fawn, filesystems, fsck, lvm, partition, ubuntu


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
Broken LVM - recovery ? Please Help ! neuralnet Linux - Desktop 3 01-08-2008 02:20 PM
Recovery of full LVM snapshot drmouse Linux - Software 0 12-11-2007 08:21 AM
LVM Recovery enabler Linux - Newbie 8 02-23-2005 02:09 PM
Oh no!! LVM broke, need help with recovery. kleptophobiac Linux - General 5 12-31-2004 11:22 PM
Hard drive recovery, LVM Fonce Linux - Hardware 3 12-30-2004 09:47 PM


All times are GMT -5. The time now is 10:30 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
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration