[lug] lvm and physical volume worries

Hugh Brown hugh at math.byu.edu
Wed Jan 31 09:22:55 MST 2007



On Tue, 30 Jan 2007, karl horlen wrote:

> I keep seeing an occasional warning in LVM posts and
> documentation that you should NOT span LVM across
> multiple physical volumes because if one PV goes down
> you lose the whole LVM.
>
> I just want to make sure I understand this.
>
> Are they talking about SPANNING the entire VG (volume
> group) or just an individual LV (logical volume) in a
> VG over multiple PVs?
>
> ** BTW, when I use PV here and other spots below, I
> mean a PV that is an entire disk partition and not
> just a smaller partition of a disk.  This implies that
> multiple PVs live across MULTIPLE PHYSICAL disks and
> not just multiple partitions on ONE physical disk.  I
> hope that's clear.
>
> And
>
> Are they talking about LOSING the entire VG (volume
> group) or just an individual LV (logical volume) in a
> VG spread over multiple PVs?
>
> The reason I ask is because assuming a VG consists of
> multiple PVs, there is no way that I know of that you
> can tell the LV which PV[s] to actually use.  And
> without that ability, it would seem that even if your
> LV was smaller than the smallest PV, there would not
> be any guarantee that the LV filesystem would be
> written entirely on one PV versus spread across
> multiple PVs.  Or that multiple LVs live on a single
> PV.
>
> So the way I'm reading this is that the minute you
> lose any PV in a VG you lose the entire VG.  Can
> someone confirm this?
>
> If that's the case, then LVM is severely limited in
> multi PV configurations.  Or at least it means that
> your VG should never consist of more than one PV (or
> all your PVs should be partitions on one disk) if you
> care about the integrity of your data in multi PV
> setup.  Would that be a pretty good rule of thumb?
>
> I imagine you can create  backups of your VG that
> consists of multiple PVs in the event it goes down.
> But the restore is probably going to be a lot of work
> and at that point the extra complexity of a multi PV
> VG probably isn't worth it.
>
> In this case, the best bet might be to  mirror the VG
> (never greater than one PV) on a RAID1.
>
> Does this sound like a good plan?
> Does anybody have any better recommendations?
>
> thanks
>


The volume group will span all the PVs you throw at it.  The LVs then get
allocated according to the allocation policy and the command line
paramaters when you do an lvcreate or an lvextend.  You can specify which
PV you create or extend on (assuming you have free physical extents on the
PV and the PV is associated with the VG).  Search on the word physical in
the man page for lvcreate/lvextend to see how.

So if the PE that an LV depends
on disappears (because the PV that it lived on disappears) then something
isn't going to work right.  Ultimately, the question is does LVM fail
spectacularly or does it hobble along.  I haven't had to deal with a VG
that lost a PV, so I'm not much help there.

Ultimately, if you are going to have a VG that spans multiple PVs on
multiple devices, make sure the PVs are actually  RAID1 or RAID5.

Hugh



More information about the LUG mailing list