LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices

Reply
 
LinkBack Search this Thread
Old 08-03-2007, 07:48 AM   #1
MythN00b
LQ Newbie
 
Registered: Nov 2005
Location: Brisbane, Australia
Distribution: FC6
Posts: 20

Rep: Reputation: 0
Red face LVM Nightmare! Have I lost my data?


My home server was running out of disk space...

I had a spare 250Gb drive - so decided to add it into my LVG on my FC6 machine and see how it all went....

STUPIDLY I didnt back up the important data first (months of photos of my kids... If I dont get that back I'm DEAD!)

Anyway - I added a new partition on the new drive, created a physical volume, added it all into the existing LVG, resized the logical volume...

All looked sweet - FC6 told me I had a new volume mounted in the right place of 250Gb more than I used to ....

Then I rebooted...

System didnt boot up - it told me it couldnt find all the physical volumes in the group.... Thats when I started sweating...

I had tried unplugging the disk and seeing if teh box would boot - but same message (which made sense since it couldnt find teh disk I'd just unplugged)...

I then googled around and found the "lvm" command line - that I can run from "Linux rescue" mode of the FC6 DVD.

I found the "lvremove" command in the hope of removing the reference to the new volume - but after running it (2nd STUPID mistake of the evening), it looks like its deleted the OLD lv too.

Now the system still doesnt boot... but I'm seriously afriad that I've lost my data and need to get a good divorce lawyer now!

Can anyone tell me if theres a way to get my data back?
ANY help would be extremely appreciated! I've got a 3yr old daughter who will go NUTS when she discovers she cant watch her "Dora explorer" videos on the MythTv box and a wife who'll put me in hospital!!


HELP ME OBI-WAN - YOURE MY ONLY HOPE!!!
 
Old 08-03-2007, 08:06 AM   #2
theYinYeti
Senior Member
 
Registered: Jul 2004
Location: France
Distribution: Arch Linux
Posts: 1,897

Rep: Reputation: 61
I think I remember a tool that scans a hard disk for known filesystems to recover data.
As you know, LVM acts as a layer above the hard disks, but the whole thing is still formatted using a standard filesystem. If I understand well, all your data is currently on a single hard disk, the other (latest PV added to the LVM) being empty for now. So there may be a recognizable filesystem on the used hard disk...

I'll try and find again what this tool was.

Yves.
 
Old 08-03-2007, 08:23 AM   #3
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 11,803

Rep: Reputation: 923Reputation: 923Reputation: 923Reputation: 923Reputation: 923Reputation: 923Reputation: 923Reputation: 923
I was going to offer you the name of my legal eagle, but I don't think he does divorces. But he is on Melbourne Street, so it's handy to the city ... ;-)

As for your other problem; presumably FC does all the vgscan/pvscan needed on boot. Might be worth trying Knoppix and see if you can get it to scan for the vg's.
 
Old 08-03-2007, 08:27 AM   #4
theYinYeti
Senior Member
 
Registered: Jul 2004
Location: France
Distribution: Arch Linux
Posts: 1,897

Rep: Reputation: 61
This is what I was thinking of:
http://www.cgsecurity.org/wiki/TestDisk

It is included in this good rescue LiveCD:
http://www.sysresccd.org/

Check also:
http://www.cgsecurity.org/wiki/PhotoRec

Good luck!

Yves.

Last edited by theYinYeti; 08-03-2007 at 08:31 AM.
 
Old 08-03-2007, 08:49 AM   #5
monsm
Member
 
Registered: Feb 2005
Location: London, UK
Distribution: Gentoo
Posts: 568

Rep: Reputation: 37
If you combine the advice above. Get a live CD and try to mount the hard drive partitions directly without using LVM. I am no expert on this but I would think its possible as long as you are not running something like raid-0 like me...

When you know the data is intact you can search for a way fix the boot. Good luck.
 
Old 08-03-2007, 09:06 AM   #6
theYinYeti
Senior Member
 
Registered: Jul 2004
Location: France
Distribution: Arch Linux
Posts: 1,897

Rep: Reputation: 61
IF you attempt to mount partitions, then whenever you do it, do it read-only! (mount -o ro /dev/xxx /mount/point)

Yves.
 
Old 08-03-2007, 05:17 PM   #7
MythN00b
LQ Newbie
 
Registered: Nov 2005
Location: Brisbane, Australia
Distribution: FC6
Posts: 20

Original Poster
Rep: Reputation: 0
All attemtps to mount drive manullay and read the data tell me its a completely empty directory.. ( I *think* and *hope* this is not true!)

I tried the live CD - but couldnt make head nor tail of wht it was supposed to be doing...

I also found an "LVM recovery" tool here: http://www.linuxdiskrecovery.com/linux-data-recovery
which does run on my windows box - BUT I cant get my windows box to boot when the linux drive is plugged into an IDE cable

If it wasnt the weekedn I'd be on the phone to a pro 'data recovery' person by now and handing over vast quantityies of cash to get my data back!!
 
Old 08-03-2007, 06:17 PM   #8
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 11,803

Rep: Reputation: 923Reputation: 923Reputation: 923Reputation: 923Reputation: 923Reputation: 923Reputation: 923Reputation: 923
I still think Knoppix is worth a shot. Have a look at this thread f'instance.
Searching for other posts by haertig (on LVM) would be productive.
 
Old 08-03-2007, 08:01 PM   #9
jay73
Guru
 
Registered: Nov 2006
Location: Belgium
Distribution: Ubuntu 11.04, Debian testing
Posts: 5,019

Rep: Reputation: 129Reputation: 129
Don't panic. No matter what you did, the data were NOT erased. At worst you simply screwed up their meta-data so that they have become invisible to the operating system. Can the drive be accessed from a liveCD such as Knoppix?
 
Old 08-04-2007, 06:17 PM   #10
MythN00b
LQ Newbie
 
Registered: Nov 2005
Location: Brisbane, Australia
Distribution: FC6
Posts: 20

Original Poster
Rep: Reputation: 0
Cant get knoppix to work sensibly - The screen resolution on my crappy old tv is not good enough to see whats going on - and when I plug a monitor in the display drivers get confused and everything just shimmers 'cos the scan/refresh rate is obviously wrong....

I've resigned myself to handing the disk over to a recovery servce. It will cost me an arm and a leg - but at least I will get the data back. If I try and get too clever I risk doing further damage!...
 
Old 08-05-2007, 02:56 AM   #11
jay73
Guru
 
Registered: Nov 2006
Location: Belgium
Distribution: Ubuntu 11.04, Debian testing
Posts: 5,019

Rep: Reputation: 129Reputation: 129
Can you run fdisk -l? I wouldn't be surprised it is device type was changed as a consequence of including it in the lvm group. If it really was, then you should be able to recover be reverting to the original type. I did something similar on one occasion when I had accidentally wiped my partition table. It only took a few seconds.
 
Old 09-19-2007, 04:22 PM   #12
alabamaman
Member
 
Registered: Jul 2007
Location: linux-noobville.d/dfw texas
Distribution: grub multi-booter
Posts: 102

Rep: Reputation: 16
Quote:
Originally Posted by jay73 View Post
Can you run fdisk -l? I wouldn't be surprised it is device type was changed as a consequence of including it in the lvm group. If it really was, then you should be able to recover be reverting to the original type. I did something similar on one occasion when I had accidentally wiped my partition table. It only took a few seconds.
i'm pretty much having this same problem, and i have a FC7 livecd in now. here's my fdisk results...

Code:
[root@localhost ~]# fdisk -l

Disk /dev/sda: 200.0 GB, 200049647616 bytes
255 heads, 63 sectors/track, 24321 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1          13      104391   83  Linux
/dev/sda2              14       24321   195254010   8e  Linux LVM

Disk /dev/dm-0: 4294 MB, 4294967296 bytes
255 heads, 63 sectors/track, 522 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Disk /dev/dm-0 doesn't contain a valid partition table
i'm assuming since they're now "dev/sda" instead of "dev/hda" the device type was changed like you mentioned? or are those just the dummy mounts for the livecd and my drive is toast? i too have about 200GB of valuable data on this drive i'd rather not have to recover later on so i'm trying to avoid it. i'm just looking for some hope that the drive isn't dead.
 
Old 09-19-2007, 06:48 PM   #13
jay73
Guru
 
Registered: Nov 2006
Location: Belgium
Distribution: Ubuntu 11.04, Debian testing
Posts: 5,019

Rep: Reputation: 129Reputation: 129
The disk being referenced as sda instead of hda is an unrelated phenomenon. Fedora 7 designates both PATA and SATA disks as sd rather than hd (pata) versus sd (sata). So if you check from a Fedora 7 livecd, it will find only sds.

I think it would be helpful if you could be more precise about what went wrong. Did you add storage? Did you try to resize a partition? What were you trying to achieve and what did you end up with?
 
Old 09-20-2007, 10:01 AM   #14
alabamaman
Member
 
Registered: Jul 2007
Location: linux-noobville.d/dfw texas
Distribution: grub multi-booter
Posts: 102

Rep: Reputation: 16
Quote:
Originally Posted by jay73 View Post
The disk being referenced as sda instead of hda is an unrelated phenomenon. Fedora 7 designates both PATA and SATA disks as sd rather than hd (pata) versus sd (sata). So if you check from a Fedora 7 livecd, it will find only sds.

I think it would be helpful if you could be more precise about what went wrong. Did you add storage? Did you try to resize a partition? What were you trying to achieve and what did you end up with?
sorry about that, i did add storage and created another logical volume with that drive which was evidently a really stupid idea because when i rebooted i just got a grub> screen. i don't care about having the other drive in there, i just want my os back without having to reinstall. everytime i try to do anything from the grub screen i get "cannot mount volume" etc. i have another post going about it over here...

http://www.linuxquestions.org/questi...d.php?t=585860
 
Old 09-20-2007, 09:42 PM   #15
MythN00b
LQ Newbie
 
Registered: Nov 2005
Location: Brisbane, Australia
Distribution: FC6
Posts: 20

Original Poster
Rep: Reputation: 0
Well heres my update:

I gave my disks to a data recovery place - they charged me a small amount to "report" on what data could be recovered. Of course they did find everything... - but said it was much harder than they expected and wanted to charge me AU$1000 to recover it.

Fortunately for me I discovered I *DID* have an inadvertent back-up of all the important stuff on various windows boxes around the house - so I got my disks back and started playing.

I used the LVM command line tool to remove all volumes, removed any nasty looking volume references from fstab and rebooted. It worked!!!
next step was to recreate the LogicalVolume - which I did using the GUI tools in FC6 and it all worked beautifully.

I now have a system with all my data restored (took a while to copy it from various different locations desktops, laptops etc) and with double the disk space I had before!

Consider the lesson learnt though! Before playing with ANY configuration make SURE theres a good backup of everything - and if you cant do a backup for some reason then DONT touch it!!! lol
 
  


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
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
LVM without losing data daihard Linux - Software 12 05-28-2007 01:27 AM
HDD partition lost. xandros DVD + me = lost data lein Linux - General 18 05-22-2007 05:47 AM
Lost my lvm partition timonvo Linux - Software 1 05-15-2007 10:30 AM
Howto recover lost and formatted data on lost partitions. Sören Schneider LinuxQuestions.org Member Success Stories 2 04-05-2006 06:38 AM
I lost my LVM and 11 databases Basher52 Fedora 1 03-25-2004 01:10 AM


All times are GMT -5. The time now is 10:48 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