PDA

View Full Version : [ubuntu] Broken LVM array and I need the data off 2 disks



themac
February 28th, 2010, 10:59 PM
Hi
I am new to ‘fiddling’ with Ubuntu (and definately no IT expert) having previously had a FC5 server setup to use Samba services to store photos and camcorder files. My problem is that a friend set up my FC5 system and all I had to do was set up the file shares in Samba.

My machine had an 80GB HDD which contianed the base FC5 installation, with 2 nr 320GB HDD’s for photos and videos. The problem occurred when I decided to upgrade to Ubuntu server and being a novice I never realised that I would not be able to read the data from my two 320GB drives as they have previously been setup in an LVM. I thought that like windows disks I would be able to just plug them back in to a Linux system and ‘away we go’, sadly not to be.

I have searched the forum for help on my subject and found a couple of useful threads (http://ubuntuforums.org/archive/index.php/t-642329.html) but none that has successfully helped me to recover the data on them. I am confident that the data is till there, it's just that I can't get at it.

In my previous system I had have found out that I had one logical volume group - VolGroup00, with 3 physical volumes - PV0(80GB), PV1(320GB0, and PV2(320GB), and three Logical Volumes, - LogVol00, LogVol01, and LogVol03.

The new Ubuntu server is currently installed on the old PV0 and the problem is that I do not know how to link the two 320GB disks up to the new Ubuntu server to view and backup the data.

When I use the pvscan –u PV3 is listed as an ‘unknown device’ and the UUId for PV0 is now not correct for the LVM as I have reformatted this drive as part of the Ubuntu setup.

sudo dd if=/dev/sda2 bs=512 count=255 skip=1 of=/temp.txt yields the following text
status = ["RESIZEABLE", "READ", "WRITE"]
extent_size = 65536
max_lv = 0
max_pv = 0
physical_volumes {
pv0 {
id = "fufRff-6ldT-MB6t-FbrK-bAmF-0FtW-1CEEmB"
device = "/dev/sda2"
status = ["ALLOCATABLE"]
pe_start = 384
pe_count = 2380}
pv1 {
id = "oh5gWw-0jK1-aXq1-A0Ev-bHFJ-QfRk-iJXG0Q"
device = "/dev/sdb1"
status = ["ALLOCATABLE"]
pe_start = 384
pe_count = 9538}
pv2 {
id = "lKTd4H-mauQ-jvTv-tuNY-DH03-dO1E-4N0uf0"
device = "/dev/sdc1"
status = ["ALLOCATABLE"]
pe_start = 384
pe_count = 9538}}
logical_volumes {
LogVol00 {
id = "wUJ4IB-6i0W-6CxV-f7sv-BWof-yWoq-3zpENi"
status = ["READ", "WRITE", "VISIBLE"]
segment_count = 1
segment1 {start_extent = 0
extent_count = 2363
type = "striped"
stripe_count = 1
# linear
stripes = ["pv0", 0]}}
LogVol01 {
id = "U8tj9z-hI1M-mBzL-VoWw-onAB-3d3s-k0xsVD"
status = ["READ", "WRITE", "VISIBLE"]
segment_count = 1
segment1 {
start_extent = 0
extent_count = 16
type = "striped"
stripe_count = 1
# linear
stripes = ["pv0", 2363]}}
LogVol03 {
id = "oYRtwo-H5wp-xL0X-LOfz-V3pR-FGrB-a8kHgR"
status = ["READ", "WRITE", "VISIBLE"]
segment_count = 2
segment1 {
start_extent = 0
extent_count = 9538
type = "striped"
stripe_count = 1
# linear
stripes = ["pv1", 0]}
segment2 {
start_extent = 9538
extent_count = 1
type = "striped"
stripe_count = 1
# linear
stripes = ["pv0", 2379]}}}}
# Generated by LVM2: Sun Feb 8 13:48:48 2009
contents = "Text Format Volume Group"
version = 1
description = ""
creation_host = "mcinnesonline.com"
# Linux mcinnesonline.com 2.6.18-1.2200.fc5
#1 Sat Oct 14 16:59:26 EDT 2006 i686
creation_time = 1234100928
# Sun Feb 8 13:48:48 2009

Pvscan –u has the following output

Couldn’t find device with UUID ‘fufRff-6ldT-MB6t-FbrK-bAmF-0FtW-1CEEmB’.
Couldn’t find device with UUID ‘lKTd4H-mauQ-jvTv-tuNY-DH03-dO1E-4N0uf0’.
Couldn’t find device with UUID ‘fufRff-6ldT-MB6t-FbrK-bAmF-0FtW-1CEEmB’.
Couldn’t find device with UUID ‘lKTd4H-mauQ-jvTv-tuNY-DH03-dO1E-4N0uf0’.
PV unknown device with device with UUID ‘fufRff-6ldT-MB6t-FbrK-bAmF-0FtW-
1CEEmB’ VG VolGroup00 lvm2 [74.38GB /0 free]
PV /dev/sdb1 with device with UUID ‘oh5gWw-0jK1-aXq1-A0Ev-bHFJ-QfRK-
iJXGC0Q’ VG VolGroup00 lvm2 [298.06GB /0 free]
PV unknown device with device with UUID ‘lKTd4H-mauQ-jvTv-tuNY-DH03-dO1E-
4N0uf0’ VG VolGroup00 lvm2 [298.06GB /0 free]

As you can imagine my ‘other’ half is none too pleased and any help I can get to ‘connect’ the disk back into a useable array in Ubuntu where I can see the files again would help my marriage no end.

Thanks in advance for your help.
Chrs.

stlsaint
February 28th, 2010, 11:14 PM
Yes this sucks. You can try and plug the two drives back into the system and boot to the ubuntu livecd. Open the synapic repository (System>Admin>Synaptic)
and do a search for lvm, you will see lvm2 and kvpm...try those and a few other apps to try and recover the data.

darkod
February 28th, 2010, 11:19 PM
Read here if this can help:
http://www.linuxjournal.com/article/8874?page=0,0

especially on page 3 they talk about restore of the LVM. Be careful, I haven't tried this myself, I don't know whether it can mess up the disks further. Just read for a start.

Sorry I can't help more. :(

Also, for you and anyone else reading this, if you had LVM you should have installed ubuntu using the alternate install cd which has RAID/LVM support. Not the standard desktop live cd.

The installation wasn't as you thought, the 80GB and then separately two 320GB disks. If all three disks were set as physical volumes for a single VolumeGroup, the data was spread all over the three disks, not just the two.

And since you overwrote the 80GB disk, not sure how far can you go in retrieving the data. I don't want to put you off, that's just my humble opinion and my understanding of things. Note that I am by no means LVM expert.

themac
March 1st, 2010, 10:52 PM
The installation wasn't as you thought, the 80GB and then separately two 320GB disks. If all three disks were set as physical volumes for a single VolumeGroup, the data was spread all over the three disks, not just the two.

And since you overwrote the 80GB disk, not sure how far can you go in retrieving the data. I don't want to put you off, that's just my humble opinion and my understanding of things. Note that I am by no means LVM expert.

Thanks Guys

A Little nrevous about the thougts from Darkod, but will give things a go.

Thanks for the help.