LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
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 10-06-2008, 06:19 PM   #1
Andersonian
LQ Newbie
 
Registered: Oct 2006
Location: California / Moldova
Distribution: bunch of Ubuntu flavors
Posts: 29

Rep: Reputation: 15
Question Physical Volume Metadata recovery


Hello,

I would really appreciate help on recovering some data.

I have a RAID1 array under /dev/md0 composed of devices /dev/sdb and /dev/sdc. I had lvm on the raid with 3 lv, the last of which was a snapshot partition.

My / is on /dev/sda. Recently, I reinstalled the system (Debian lenny) and reconfigured /dev/sda with lvm.
When I booted, the system correctly determined the presence of the RAID array and even activated it. All I had to do is import /dev/md0 back into the system.

However, out of stupidity, I ran
Code:
sudo pvcreate -v /dev/md0
    Set up physical volume for "/dev/md0" with 488396928 available sectors
    Zeroing start of device /dev/md0
  Physical volume "/dev/md0" successfully created
As it says, it overwrote the start of the device, the data is has not been affected. Now I don't know how to access the LVs on /dev/md0.

Does anyone have any suggestions on how to recover the Physical Volume Metadata of /dev/md0 ?

I do not have the backup file of the volume group on the raid, as I just reinstalled the system over it. Otherwise I would have just followed the instructions here.

Thank you in advance.
 
Old 10-09-2008, 02:27 PM   #2
juanbobo
Member
 
Registered: Mar 2005
Location: Chicago
Distribution: Gentoo AMD64
Posts: 365

Rep: Reputation: 30
You might be able to restore the data with the testdisk utility.
 
Old 10-20-2008, 11:53 PM   #3
Andersonian
LQ Newbie
 
Registered: Oct 2006
Location: California / Moldova
Distribution: bunch of Ubuntu flavors
Posts: 29

Original Poster
Rep: Reputation: 15
I've made some progress. Here's a summary of my steps so far:

# Searched for lvm config
Code:
sudo dd if=/dev/sdb bs=512 count=255 skip=1 of=/temp.txt
# Filtered the output, saved the file to /etc/lvm/backup/data-raid
# Extracted the UID of pv0 (/dev/md0) and ran
Code:
pvcreate -ff -v -u JgOakP-gVVs-SfhX-lEXi-x4fQ-3gXz-3d17FN /dev/md0
# Restored lvm w/
Code:
vgcfgrestore -f /etc/lvm/backup/data-raid data-raid
# Imported the volume group with
Code:
vgimport data-raid
# Brought it up
Code:
vgchange -ay data-raid
Code:
# ls -l /dev/mapper
total 0
crw-rw---- 1 root root  10, 60 2008-10-11 20:16 control
brw-rw---- 1 root disk 253,  7 2008-10-19 10:12 data--raid-user
brw-rw---- 1 root disk 253,  4 2008-10-19 10:12 data--raid-media
brw-rw---- 1 root disk 253,  3 2008-10-19 10:12 data--raid-media-real
brw-rw---- 1 root disk 253,  6 2008-10-19 10:12 data--raid-snap--media
brw-rw---- 1 root disk 253,  5 2008-10-19 10:12 data--raid-snap--media-cow

# Tried mounting w/ following fstab conf
Code:
/dev/mapper/data--raid-media	/media/Pictures	reiserfs	defaults,noatime	0	0
it failed with
Code:
[630884.179103] ReiserFS: dm-3: warning: sh-2021: reiserfs_fill_super: can not find reiserfs on dm-3
There are supposed to be 2 volumes with data, data--raid-media a ReiserFS partition, and data--raid-user a LUKS encrypted one and a snapshot volume of the media partition.

Any ideas what could have gone wrong?
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
Cannot allocate Physical Volume adscombi Linux - Newbie 1 09-30-2008 09:07 AM
Fedora LVM volume group & Physical Volume resize problem gabeyg Fedora 1 05-14-2008 11:26 AM
LVM -creating physical volume satimis Linux - General 2 08-10-2006 01:44 AM
resizing lvm2 physical volume fakie_flip Linux - Software 3 08-07-2006 12:18 PM
LVM Physical Volume Lucky_Sevin Linux - Software 2 01-10-2006 10:44 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 09:43 AM.

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