Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > Linux Forums > Technical

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 7th June 2012, 20:45
Bitsofme Bitsofme is offline
Junior Member
 
Join Date: Jun 2012
Posts: 4
Thanks: 0
Thanked 1 Time in 1 Post
Default Restore lvm after destroying boot disk

Hi All,

I need to restore my lvm after destroying my boot disk during an upgrade.

I have used the information on this http://www.howtoforge.com/recover_da...lvm_partitions
as a starting point and have got so far but got stuck.

I do not have a raid just three disks linked into a volume group so I skipped the first part and started at the Recovering The LVM Setup section.

I used the dd command (also piped the output into strings to clean it up) and created this config file
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_big {
	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
				]
			}
		}
	}
}
In the stripes part it lists only two pv's PV0 and PV2 is this correct?

I tried vgconfigrestore with the -t for test and got

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.

I am guessing that I need to assign uuids to the disks to match the old config?

Any ideas?

Thanks

I have attached the output from the dd command after it has been cleaned with strings
Attached Files
File Type: gz sdctext.txt.gz (1.8 KB, 110 views)
Reply With Quote
Sponsored Links
  #2  
Old 9th June 2012, 19:20
Bitsofme Bitsofme is offline
Junior Member
 
Join Date: Jun 2012
Posts: 4
Thanks: 0
Thanked 1 Time in 1 Post
 
Default More info

Just some more info about the problem

lvmdiskscan
/dev/sda [ 1.82 TiB]
/dev/vg_main/lv_swap [ 13.72 GiB]
/dev/vg_main/lv_root [ 50.00 GiB]
/dev/vg_main/lv_home [ 84.81 GiB]
/dev/sdb [ 1.82 TiB]
/dev/sdc [ 1.82 TiB] LVM physical volume
/dev/sdd1 [ 500.00 MiB]
/dev/sdd2 [ 148.56 GiB] LVM physical volume
5 disks
1 partition
1 LVM physical volume whole disk
1 LVM physical volume



[root@main uuid_fixer]# fdisk -l

Disk /dev/sda: 2000.4 GB, 2000398934016 bytes
255 heads, 63 sectors/track, 243201 cylinders, total 3907029168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/sdb: 2000.4 GB, 2000398934016 bytes
255 heads, 63 sectors/track, 243201 cylinders, total 3907029168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/sdc: 2000.4 GB, 2000398934016 bytes
255 heads, 63 sectors/track, 243201 cylinders, total 3907029168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x2c33c642

Device Boot Start End Blocks Id System

Disk /dev/sdd: 160.0 GB, 160040803840 bytes
255 heads, 63 sectors/track, 19457 cylinders, total 312579695 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000dd6fd

Device Boot Start End Blocks Id System
/dev/sdd1 * 2048 1026047 512000 83 Linux
/dev/sdd2 1026048 312578047 155776000 8e Linux LVM

Disk /dev/mapper/vg_main-lv_swap: 14.7 GB, 14730395648 bytes
255 heads, 63 sectors/track, 1790 cylinders, total 28770304 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/mapper/vg_main-lv_root: 53.7 GB, 53687091200 bytes
255 heads, 63 sectors/track, 6527 cylinders, total 104857600 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/mapper/vg_main-lv_home: 91.1 GB, 91066728448 bytes
255 heads, 63 sectors/track, 11071 cylinders, total 177864704 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Reply With Quote
Reply

Bookmarks

Thread Tools
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
Ubuntu install on software RAID 10 gone wrong lord bucket HOWTO-Related Questions 2 10th May 2010 11:03
Ubuntu 9.10 with KVM and copying KVM disk image to LVM yowzator HOWTO-Related Questions 3 8th March 2010 14:29
Adding non-RAID backup disk to system with RAID 1... BorderAmigos Installation/Configuration 1 20th February 2010 21:50
ISPConfig 2.2.14 released till General 48 20th July 2007 00:46
Problem with the apache (I can't start ist) M.Behrens Installation/Configuration 11 31st March 2006 11:48


All times are GMT +2. The time now is 08:56.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.