[linux-lvm] shift PV from disk to raid device?

Doug Ledford dledford at redhat.com
Tue Dec 9 20:56:16 UTC 2008

On Tue, 2008-12-09 at 21:49 +0100, Kai Schaetzl wrote:
> Doug Ledford wrote on Tue, 09 Dec 2008 14:56:24 -0500:
> > One thing that might be happening here (and I'm not sure since I'm not
> > an LVM expert) is that when the lvm stack finds the pv on /dev/sdb3
> > or /dev/sda3, it sees a full size partition (meaning it can access all
> > the way to the end of the device).
> But this couldn't normally happen if I just created LVM on top of the md 
> device, correct? However, as I created a PV on /dev/sda3, did not remove 
> it and then create the md array on it and then the PV on the md device 
> there might be something going on ... especially in case the array broke.

Correct.  If you created the PV on sda3, then the lvm stack would think
it could write all the way to the end of the partition, including
overwriting the raid superblock you later created by making the raid
array.  If you create the pv on the raid device itself, then it should
be sized to exactly fit within the limits of the md raid device and
never overwrite the raid superblock.

> > The solution to this problem is to create the raid device with a
> > superblock format of 1.1 or 1.2 (aka, -e 1.1 or -e 1.2).
> man mdadm gives the difference between 1.1 and 1.2 as 1.2 putting the RAID 
> superblock 4k after the beginning. Is this another measure against 
> accidental overwrites? Would you recommend 1.2 if I were to use a newer 
> superblock version?

The only reason for 1.2 to exist is in the case a future boot loader
(like extlinux) is modified to know about filesystem offsets and boot
from these arrays, then you generally will need a version 1.2 superblock
so that the first 512 bytes of the partition can be used by the boot
loader.  With a version 1.1 superblock, the boot loader sector and the
superblock would both want to occupy that first sector.  However, as we
don't ship extlinux yet, and as it doesn't yet support version 1.1 or
1.2 superblocks (although I was told by HPA, the author of extlinux,
that it would be very easy to do), a version 1.1 superblock is just as
good as a version 1.2 superblock.

Doug Ledford <dledford at redhat.com>
              GPG KeyID: CFBFF194

Infiniband specific RPMs available at

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part
URL: <http://listman.redhat.com/archives/linux-lvm/attachments/20081209/456d8277/attachment.sig>

More information about the linux-lvm mailing list