LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 06-21-2010, 01:35 PM   #1
sysslack
Member
 
Registered: Feb 2006
Posts: 69

Rep: Reputation: 15
LVM2, Is it possible recover LV_BACKUP


Hi
Yesterday I had a functioning system but needed to do an reinstall of ubuntu because of missing dependencies. Then I installed /dev/sda5 as normal (no lvm)
When I ran vgchange -ay after installation it did not find my missing logic volume. Instead got a whole bunch of error messages. I googled and followed the advice below vgreduce --removemissing UBUNTU. I did this vgreduce command because when running pvs I got /dev/sda5 unknown device.


ran vgs pvs lvs
Volme Group UBUNTU
Logic Volume LV_UBUNTU
but
LV_BACKUP is missing
vs
PV VG Fmt Attr PSize PFree
/dev/sda11 UBUNTU lvm2 a- 129.15G 129.15G
/dev/sda2 UBUNTU lvm2 a- 68.36G 48.36G
/dev/sda3 UBUNTU lvm2 a- 23.64G 23.64G
/dev/sda6 UBUNTU lvm2 a- 8.79G 8.79G
/dev/sda7 UBUNTU lvm2 a- 6.83G 6.83G
/dev/sda8 UBUNTU lvm2 a- 5.86G 5.86G
/dev/sda9 UBUNTU lvm2 a- 4.88G 4.88G

Read LVM HOWTO, but I dont understand this part . How can I know which pvs belongs to which LV
"Use pvcreate to restore the metadata: pvcreate --uuid "<some_long_string>" --restorefile /etc/lvm/archive/VolumeGroupName_XXXXX.vg <PhysicalVolume>"
below:
etc/lvm/archive/VolumeGroupName_XXXXX.vg

I
Code:
# Generated by LVM2 version 2.02.39 (2008-06-27): Mon Jun 21 19:07:54 2010

contents = "Text Format Volume Group"
version = 1

description = "Created *before* executing 'vgreduce --removemissing UBUNTU'"

creation_host = "j-desktop"	# Linux j-desktop 2.6.31-14-generic #48-Ubuntu SMP Fri Oct 16 14:04:26 UTC 2009 i686
creation_time = 1277140074	# Mon Jun 21 19:07:54 2010

UBUNTU {
	id = "CMOreA-Tm1m-q0CC-K0Dt-FWiW-bvIz-5KcoRM"
	seqno = 7
	status = ["RESIZEABLE", "PARTIAL", "READ"]
	extent_size = 8192		# 4 Megabytes
	max_lv = 0
	max_pv = 0

	physical_volumes {

		pv0 {
			id = "5q7iNU-5Ex3-OFGt-ehgM-Mj5k-gRGm-tGJDUm"
			device = "/dev/sda2"	# Hint only

			status = ["ALLOCATABLE"]
			dev_size = 143364060	# 68.3613 Gigabytes
			pe_start = 384
			pe_count = 17500	# 68.3594 Gigabytes
		}

		pv1 {
			id = "2uNw81-TK55-LY7O-vYZo-wo9f-CwGg-Se0ENi"
			device = "/dev/sda3"	# Hint only

			status = ["ALLOCATABLE"]
			dev_size = 49576590	# 23.64 Gigabytes
			pe_start = 384
			pe_count = 6051	# 23.6367 Gigabytes
		}

		pv2 {
			id = "O3j10h-bi48-DKf5-UFQf-TY41-aypS-ucurez"
			device = "unknown device"	# Hint only

			status = ["ALLOCATABLE"]
			dev_size = 43005942	# 20.5068 Gigabytes
			pe_start = 384
			pe_count = 5249	# 20.5039 Gigabytes
		}

		pv3 {
			id = "ebqJ9i-l9XG-OT0c-Zd2V-YXvN-z1jI-nmjjiX"
			device = "/dev/sda7"	# Hint only

			status = ["ALLOCATABLE"]
			dev_size = 14329917	# 6.83304 Gigabytes
			pe_start = 384
			pe_count = 1749	# 6.83203 Gigabytes
		}

		pv4 {
			id = "IpyObx-n765-XbGy-Btm3-GwBa-7pmi-V0ZBbe"
			device = "/dev/sda6"	# Hint only

			status = ["ALLOCATABLE"]
			dev_size = 18426492	# 8.78644 Gigabytes
			pe_start = 384
			pe_count = 2249	# 8.78516 Gigabytes
		}

		pv5 {
			id = "2OeHQF-Y28j-RUA1-lTM0-DYNW-ySOi-a6ofNe"
			device = "/dev/sda8"	# Hint only

			status = ["ALLOCATABLE"]
			dev_size = 12289662	# 5.86017 Gigabytes
			pe_start = 384
			pe_count = 1500	# 5.85938 Gigabytes
		}

		pv6 {
			id = "tHgncp-hADk-0N2n-jDXn-5NbU-AkR1-8m2etE"
			device = "/dev/sda9"	# Hint only

			status = ["ALLOCATABLE"]
			dev_size = 10233342	# 4.87964 Gigabytes
			pe_start = 384
			pe_count = 1249	# 4.87891 Gigabytes
		}

		pv7 {
			id = "bZen3p-EeHw-zRuZ-aFEq-3xf4-ZFmH-hEDlqR"
			device = "/dev/sda11"	# Hint only

			status = ["ALLOCATABLE"]
			dev_size = 270855837	# 129.154 Gigabytes
			pe_start = 384
			pe_count = 33063	# 129.152 Gigabytes
		}
	}

	logical_volumes {

		LV_UBUNTU {
			id = "PFYsIX-KmVK-O34I-LanO-4HO1-Mu1S-ZXxRB5"
			status = ["READ", "WRITE", "VISIBLE"]
			segment_count = 1

			segment1 {
				start_extent = 0
				extent_count = 5120	# 20 Gigabytes

				type = "striped"
				stripe_count = 1	# linear

				stripes = [
					"pv0", 0
				]
			}
		}

		LV_BACKUP {
			id = "0jBxGj-Fmkk-AkDl-3Q9n-sTFD-A8v7-Y3uIuJ"
			status = ["READ", "WRITE", "VISIBLE"]
			segment_count = 8

			segment1 {
				start_extent = 0
				extent_count = 33063	# 129.152 Gigabytes

				type = "striped"
				stripe_count = 1	# linear

				stripes = [
					"pv7", 0
				]
			}
			segment2 {
				start_extent = 33063
				extent_count = 12380	# 48.3594 Gigabytes

				type = "striped"
				stripe_count = 1	# linear

				stripes = [
					"pv0", 5120
				]
			}
			segment3 {
				start_extent = 45443
				extent_count = 6051	# 23.6367 Gigabytes

				type = "striped"
				stripe_count = 1	# linear

				stripes = [
					"pv1", 0
				]
			}
			segment4 {
				start_extent = 51494
				extent_count = 5249	# 20.5039 Gigabytes

				type = "striped"
				stripe_count = 1	# linear

				stripes = [
					"pv2", 0
				]
			}
			segment5 {
				start_extent = 56743
				extent_count = 2249	# 8.78516 Gigabytes

				type = "striped"
				stripe_count = 1	# linear

				stripes = [
					"pv4", 0
				]
			}
			segment6 {
				start_extent = 58992
				extent_count = 1749	# 6.83203 Gigabytes

				type = "striped"
				stripe_count = 1	# linear

				stripes = [
					"pv3", 0
				]
			}
			segment7 {
				start_extent = 60741
				extent_count = 1500	# 5.85938 Gigabytes

				type = "striped"
				stripe_count = 1	# linear

				stripes = [
					"pv5", 0
				]
			}
			segment8 {
				start_extent = 62241
				extent_count = 1249	# 4.87891 Gigabytes

				type = "striped"
				stripe_count = 1	# linear

				stripes = [
					"pv6", 0
				]
			}
		}
	}
}
 
Old 06-21-2010, 04:04 PM   #2
smoker
Senior Member
 
Registered: Oct 2004
Distribution: Fedora Core 4, 12, 13, 14, 15, 17
Posts: 2,279

Rep: Reputation: 248Reputation: 248Reputation: 248
Quote:
How can I know which pvs belongs to which LV ?
Well it tells you quite clearly :

Code:
LV_UBUNTU {
			id = "PFYsIX-KmVK-O34I-LanO-4HO1-Mu1S-ZXxRB5"
			status = ["READ", "WRITE", "VISIBLE"]
			segment_count = 1

			segment1 {
				start_extent = 0
				extent_count = 5120	# 20 Gigabytes

				type = "striped"
				stripe_count = 1	# linear

				stripes = [
					"pv0", 0
				]
			}
		}
and
Code:
LV_BACKUP {
			id = "0jBxGj-Fmkk-AkDl-3Q9n-sTFD-A8v7-Y3uIuJ"
			status = ["READ", "WRITE", "VISIBLE"]
			segment_count = 8

			segment1 {
				start_extent = 0
				extent_count = 33063	# 129.152 Gigabytes

				type = "striped"
				stripe_count = 1	# linear

				stripes = [
					"pv7", 0
				]
			}
			segment2 {
				start_extent = 33063
				extent_count = 12380	# 48.3594 Gigabytes

				type = "striped"
				stripe_count = 1	# linear

				stripes = [
					"pv0", 5120
				]
			}
			segment3 {
				start_extent = 45443
				extent_count = 6051	# 23.6367 Gigabytes

				type = "striped"
				stripe_count = 1	# linear

				stripes = [
					"pv1", 0
				]
			}
			segment4 {
				start_extent = 51494
				extent_count = 5249	# 20.5039 Gigabytes

				type = "striped"
				stripe_count = 1	# linear

				stripes = [
					"pv2", 0
				]
			}
			segment5 {
				start_extent = 56743
				extent_count = 2249	# 8.78516 Gigabytes

				type = "striped"
				stripe_count = 1	# linear

				stripes = [
					"pv4", 0
				]
			}
			segment6 {
				start_extent = 58992
				extent_count = 1749	# 6.83203 Gigabytes

				type = "striped"
				stripe_count = 1	# linear

				stripes = [
					"pv3", 0
				]
			}
			segment7 {
				start_extent = 60741
				extent_count = 1500	# 5.85938 Gigabytes

				type = "striped"
				stripe_count = 1	# linear

				stripes = [
					"pv5", 0
				]
			}
			segment8 {
				start_extent = 62241
				extent_count = 1249	# 4.87891 Gigabytes

				type = "striped"
				stripe_count = 1	# linear

				stripes = [
					"pv6", 0
				]
			}
		}
	}
}
Yes pv0 is part of both logical volumes.
 
Old 06-21-2010, 11:43 PM   #3
sysslack
Member
 
Registered: Feb 2006
Posts: 69

Original Poster
Rep: Reputation: 15
My misstake. I meant of course restore Logic Volume .Not restore the device
The Logic Volume I want to restore is
Logic Vplume =LV_BACKUP
from
Volume Group =UBUNTU

pvs -v
Scanning for physical volume names
PV VG Fmt Attr PSize PFree DevSize PV UUID
/dev/sda11 UBUNTU lvm2 a- 129.15G 129.15G 129.15G bZen3p-EeHw-zRuZ-aFEq-3xf4-ZFmH-hEDlqR
/dev/sda2 UBUNTU lvm2 a- 68.36G 48.36G 68.36G 5q7iNU-5Ex3-OFGt-ehgM-Mj5k-gRGm-tGJDUm
/dev/sda3 UBUNTU lvm2 a- 23.64G 23.64G 23.64G 2uNw81-TK55-LY7O-vYZo-wo9f-CwGg-Se0ENi
/dev/sda6 UBUNTU lvm2 a- 8.79G 8.79G 8.79G IpyObx-n765-XbGy-Btm3-GwBa-7pmi-V0ZBbe
/dev/sda7 UBUNTU lvm2 a- 6.83G 6.83G 6.83G ebqJ9i-l9XG-OT0c-Zd2V-YXvN-z1jI-nmjjiX
/dev/sda8 UBUNTU lvm2 a- 5.86G 5.86G 5.86G 2OeHQF-Y28j-RUA1-lTM0-DYNW-ySOi-a6ofNe
/dev/sda9 UBUNTU lvm2 a- 4.88G 4.88G 4.88G tHgncp-hADk-0N2n-jDXn-5NbU-AkR1-8m2etE

Last edited by sysslack; 06-24-2010 at 01:17 PM. Reason: CLAIRIFICATION!
 
Old 06-23-2010, 04:03 PM   #4
sysslack
Member
 
Registered: Feb 2006
Posts: 69

Original Poster
Rep: Reputation: 15
Restore logic volume! Lv_backup

Last edited by sysslack; 06-24-2010 at 01:19 PM. Reason: RESTORE LOGIC VOLUME!
 
  


Reply

Tags
logic, lvm2, recover, volume


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
Recover LVM2 with Data? bodaduk Linux - General 5 09-27-2010 12:16 PM
Recover raid 5 array + LVM2 circle69 Linux - Server 3 02-19-2010 04:00 PM
Recover data from a reallocated(?) LVM2 drive set? swan-1 Linux - General 2 07-14-2009 08:56 PM
proper way to use testdisk to recover missing logical volumes on a raid 5 w/ LVM2 markley268 Ubuntu 1 06-21-2009 12:02 PM
Using testdisk to recover deleted lvm2 partition sstendal Linux - General 2 04-02-2008 09:30 AM


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