Fedora Linux Support Community & Resources Center

Go Back   FedoraForum.org > Fedora 17/18 > Using Fedora
FedoraForum Search

Forgot Password? Join Us!

Using Fedora General support for current versions. Ask questions about Fedora and it's software that do not belong in any other forum.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 6th June 2012, 09:50 PM
bitsofme Offline
Registered User
 
Join Date: Jul 2004
Location: Isle of Man
Age: 44
Posts: 75
linuxchrome
rebuild lvm after lost boot disk

Hi All,

I have a 4 HDD system.
The first disk (160G) is my boot system.
The three other disks make up a LVM each disk is 2TB. No striping just 3 disks as one big disk.

During my upgrade to F17 I cocked up my boot disk.

I found some information on using dd to help recreate a config file for the lvm disks. and assembled this
Code:
 # Generated by LVM2 version 2.02.95(2) (2012-03-06): Mon Jun  4 17:01:30 2012

contents = "Text Format Volume Group"
version = 1

description = ""

creation_host = "(none)"	# Linux (none) 3.3.4-5.fc17.x86_64 #1 SMP Mon May 7 17:29:34 UTC 2012 x86_64
creation_time = 1338829290	# Mon Jun  4 17:01:30 2012

vg_main2 {
	id = "OBZT6E-tzAO-v80A-kN38-R1Uo-3GRI-dXd4wj"
	seqno = 13
	format = "lvm2" # informational
	status = ["RESIZEABLE", "READ", "WRITE"]
	flags = []
	extent_size = 8192
	max_lv = 256
	max_pv = 256
	metadata_copies = 0

	physical_volumes {

		pv0 {
			id = "PCNHHY-LSvJ-jKbt-TXbN-tceZ-0GPe-tshRED"
			device = "/dev/sdb"

			status = ["ALLOCATABLE"]
			flags = []
			dev_size = 3907029168
			pe_start = 384
			pe_count = 476932
		}

		pv1 {
			id = "h8j1UC-Uckf-Ob3w-UTea-nUfT-JPWc-sVdjeF"
			device = "/dev/sdc"

			status = ["ALLOCATABLE"]
			flags = []
			dev_size = 3907029168
			pe_start = 384
			pe_count = 476932
		}

		pv2 {
			id = "Ixsun3-rGKx-0xWB-tqFK-RDYq-OuNR-qIj5sO"
			device = "/dev/sda"

			status = ["ALLOCATABLE"]
			flags = []
			dev_size = 3907029168
			pe_start = 2048
			pe_count = 476932
		}
	}

	logical_volumes {

		big	{
			id = "ptLLIA-nQhQ-JsBQ-wur0-fejd-wV4E-Xj1PyR"
			status = ["READ", "WRITE", "VISIBLE"]
			flags = []
			segment_count = 1

			segment1 {
				start_extent = 0
				extent_count = 953864

				type = "striped"
				stripe_count = 1
				stripe_size = 8

				stripes = [
					"pv0", 0,
					"pv2", 0
				]
			}
		}
	}
}
how do I get fedora to see this configuration and use it?

---------- Post added at 09:50 PM ---------- Previous post was at 07:17 PM ----------

Just so all the information is available

blkid
/dev/sdc: UUID="h8j1UC-Uckf-Ob3w-UTea-nUfT-JPWc-sVdjeF" TYPE="LVM2_member"
/dev/mapper/vg_main-lv_swap: UUID="576e853f-1064-4b22-aaf1-89eca9111913" TYPE="swap"
/dev/mapper/vg_main-lv_root: LABEL="_Fedora-17-x86_6" UUID="61736f39-b25a-49a4-85cd-8eda8e8e9e64" TYPE="ext4"
/dev/mapper/vg_main-lv_home: UUID="baef8ad2-deda-4f0c-974c-a92638c2eeb9" TYPE="ext4"
/dev/sdd1: UUID="86f1da31-0a91-40c1-b151-8650e0d2a497" TYPE="ext4"
/dev/sdd2: UUID="92UeWo-GcG7-CDbL-d2gz-Zeri-sA0j-1re3rQ" TYPE="LVM2_member"

sda,sdb,sdc = 2TB

sdd = 160G
sdd1 = /boot 524M
sdd2 = 160G lvm2 pv


pvscan
PV /dev/sdd2 VG vg_main lvm2 [148.53 GiB / 0 free]
PV /dev/sdc lvm2 [1.82 TiB]
Total: 2 [1.96 TiB] / in use: 1 [148.53 GiB] / in no VG: 1 [1.82 TiB]

Last edited by bitsofme; 9th June 2012 at 07:53 PM.
Reply With Quote
  #2  
Old 7th June 2012, 10:51 AM
george_toolan Offline
Registered User
 
Join Date: Dec 2006
Posts: 1,755
linuxfirefox
Re: rebuild lvm after lost boot disk

I don't have a clue, but these are only two of your three drives:

Code:
stripes = [
"pv0", 0,
"pv2", 0
]
Reply With Quote
  #3  
Old 7th June 2012, 04:29 PM
bitsofme Offline
Registered User
 
Join Date: Jul 2004
Location: Isle of Man
Age: 44
Posts: 75
linuxchrome
Re: rebuild lvm after lost boot disk

Thanks for that I am not sure what all the options in the lvm config file mean guess I will have to hit the books and learn more about lvm.

Just as I typed this I found a blog that mentioned the command vgcfgrestore and looked at the man page and ran it with the -t switch for test and got the following

Test mode: Metadata will NOT be updated and volumes will not be (de)activated.
Couldn't find device with uuid PCNHHY-LSvJ-jKbt-TXbN-tceZ-0GPe-tshRED.
Couldn't find device with uuid Ixsun3-rGKx-0xWB-tqFK-RDYq-OuNR-qIj5sO.
Segment with extent 953864 in PV unknown device not found
Couldn't read all logical volumes for volume group vg_big.
Restore failed.

so looks like I need to assign uuids to the disks to match the config file

Thanks
Reply With Quote
  #4  
Old 9th June 2012, 04:50 PM
bitsofme Offline
Registered User
 
Join Date: Jul 2004
Location: Isle of Man
Age: 44
Posts: 75
linuxchrome
Re: rebuild lvm after lost boot disk

Anyone any idea on how I set the uuid without damaging the partition?
Reply With Quote
Reply

Tags
boot, disk, lost, lvm, rebuild

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
unable to boot into raid had to rebuild knutjorgen Using Fedora 0 1st February 2012 11:16 PM
Lost mdadm superblock but not drives - can I rebuild the software RAID5? Syncro Using Fedora 9 16th August 2011 09:05 AM
Rebuild the boot partition astern Using Fedora 14 12th December 2010 08:41 PM
Disk space lost? devspain Using Fedora 13 10th November 2007 09:02 AM
How to rebuild Raid 1 After one disk die leoleMCH Using Fedora 9 23rd June 2005 03:22 PM


Current GMT-time: 19:25 (Wednesday, 19-06-2013)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat