Skip to contentSkip to conversation

getting pe_start right

linux-lvm Phillip Susi 4 participants 5 messages May 6, 2011 – May 10, 2011

lore
Share & tools
lore
#0 lore raw

While trying to convert my mdadm raid5 array from metadata format 0.9 to 1.0, I forgot to specify the version and it defaulted to 1.2, which damaged the lvm metadata. After correcting mdadm to 1.0, I decided to try to recreate the LVM after managing to locate the volume descriptions in the metadata after manually dumping it.

The problem I now have is that pvcreate will not use the same pe_start as before. It was 384 and it is now 3072. I tried using --metadatasize 192k --dataalignmentsize 0 and it did not help. What gives?

#1 lore raw

Try "--metadatasize 288k

-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Phillip Susi
Sent: Friday, May 06, 2011 10:56 AM
To: [email protected]
Subject: [linux-lvm] getting pe_start right

While trying to convert my mdadm raid5 array from metadata format 0.9 to

1.0, I forgot to specify the version and it defaulted to 1.2, which damaged the lvm metadata. After correcting mdadm to 1.0, I decided to try to recreate the LVM after managing to locate the volume descriptions

in the metadata after manually dumping it.

The problem I now have is that pvcreate will not use the same pe_start as before. It was 384 and it is now 3072. I tried using --metadatasize

192k --dataalignmentsize 0 and it did not help. What gives?

_______________________________________________
linux-lvm mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/linux-lvm
read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/

#2 lore raw
In reply to Phillip Susi
Quoted 9 lines · Phillip Susi

While trying to convert my mdadm raid5 array from metadata format 0.9 to 1.0, I forgot to specify the version and it defaulted to 1.2, which damaged the lvm metadata. After correcting mdadm to 1.0, I decided to try to recreate the LVM after managing to locate the volume descriptions in the metadata after manually dumping it.

The problem I now have is that pvcreate will not use the same pe_start as before. It was 384 and it is now 3072. I tried using --metadatasize 192k --dataalignmentsize 0 and it did not help. What gives?

Try to set
default_data_alignment = 0

from lvm.conf:
# Default alignment of the start of a data area in MB. If set to 0,

# a value of 64KB will be used.  Set to 1 for 1MiB, 2 for 2MiB, etc.

Also, if you use

	pvcreate --uuid <pv uuid from metadata> --restorefile <old VG backup>

it should create PV exacltly as needed for olf VG (with --restorefile it uses offset from metadata backup, overriding default)

Then vgcfgrestore and you should have exactly the same cfg.

Milan

#3 lore raw
In reply to Phillip Susi
Quoted 10 lines · Phillip Susi

While trying to convert my mdadm raid5 array from metadata format 0.9 to 1.0, I forgot to specify the version and it defaulted to 1.2, which damaged the lvm metadata. After correcting mdadm to 1.0, I decided to try to recreate the LVM after managing to locate the volume descriptions in the metadata after manually dumping it.

The problem I now have is that pvcreate will not use the same pe_start as before. It was 384 and it is now 3072. I tried using --metadatasize 192k --dataalignmentsize 0 and it did not help. What gives?

Would be quite helpful if you shared kernel and lvm2 version info...

chances are lvm2's data_alignment_detection will shift the data start to the start of the next full stripe of the raid5.

You should be able to specify the old start with:

--dataalignment 192k --dataalignmentoffset 0

(--dataalignmentoffset 0 likely isn't needed, but it just overrides lvm2's data_alignment_offset detection if it just so happens that raid5 has alignment_offset!=0)

#4 lore raw
Quoted 2 lines · Mike Snitzer

chances are lvm2's data_alignment_detection will shift the data start to the start of the next full stripe of the raid5.

That appears to be what was going on. I found entries in lvm.conf to enable/disable autodetection of the raid stripe width and turned it off.

Quoted 7 lines

You should be able to specify the old start with:

--dataalignment 192k --dataalignmentoffset 0

(--dataalignmentoffset 0 likely isn't needed, but it just overrides lvm2's data_alignment_offset detection if it just so happens that raid5 has alignment_offset!=0)

The command line switches did not appear to override the autodetection; I had to shut it off in the conf file. Is this a bug?