[CentOS] LVM hatred, was Re: /boot on a separate partition?

Wed Jun 24 13:45:43 UTC 2015
Robert Heller <heller at deepsoft.com>

At Wed, 24 Jun 2015 04:10:35 +0100 CentOS mailing list <centos at centos.org> wrote:

> 
> On Tue, 23 Jun 2015 18:42:13 -0700
> Gordon Messmer <gordon.messmer at gmail.com> wrote:
> > 
> > I wondered the same thing, especially in the context of someone who 
> > prefers virtual machines.  LV-backed VMs have *dramatically* better
> > disk performance than file-backed VMs.
> 
> Ok, you made me curious. Just how dramatic can it be? From where I'm
> sitting, a read/write to a disk takes the amount of time it takes, the
> hardware has a certain physical speed, regardless of the presence of
> LVM. What am I missing?
> 
> For concreteness, let's say I have a guest machine, with a
> dedicated physical partition for it, on a single drive. Or, I have the
> same thing, only the dedicated partition is inside LVM. Why is there a
> performance difference, and how dramatic is it?
> 
> If you convince me, I might just change my opinion about LVM. :-)

Well if you are comparing direct partitions to LVM there is no real
difference. OTOH, if you have more than a few VMs (eg more than the limits
imposed by the partitioning system) and/or want to create [temporary] ones
'on-the-fly', using LVM makes that trivially possible. Otherwise, you have to
repartition the disk and reboot the host. This puts you 'back' in the
old-school reality of a multi-boot system. And partitioning a RAID array is
tricky and combersome. Resizing physical partitions is also non-trivial.  
Bascally, LVM gives you on-the-fly 'partitioning', without rebooting.  It is 
just not possible (AFAIK) to always update partition tables of a running 
system (never if the disk is the system disk).  Most partitioning tools are 
not really designed for dynamic re-sizing of partitions and it is a highly 
error-prone process.  Most partitioning tools are designed for dealing with a 
'virgin' disk (or a re-virgined disk) with the idea that the partitioning 
won't be revisited once the O/S has been installed.  LVM is all about creating 
and managing *dynamic* 'partitions' (which is what Logical Volumes effectively 
are).  And no, there is little advantage in using multiple PVs.  To get 
performance gains (and/or redundency, etc.), one uses real RAID (eg kernel 
software RAID -- md or hardware RAID), then layers LVM on top of that.

The 'other' *alternitive* is to use virtual container disks (eg image files as
disks), which have horrible performance (compared to LVM or hard partitions)
and are hard to backup.

The *additional* feature: with LVM you can take a snapshot of the VM's disk 
and back it up safely.  Otherwise you *have* to shutdown the VM and remount 
the VM's disk to back it up OR you have to install backup software (eg 
amanda-client or the like) on the VM and back it up over the virtual network. 
It some cases (many cases!) it is not possible to either shutdown the VM 
and/or install backup software on it (eg the VM is running a 'foreign' or 
otherwise imcompatible O/S).

> 
> Oh, and just please don't tell me that the load can be spread accross
> two or more harddrives, cutting the file access by a factor of two (or
> more). I can do that with raid, no need for LVM. Stick to a single
> harddrive scenario, please.
> 
> Best, :-)
> Marko
> 
> _______________________________________________
> CentOS mailing list
> CentOS at centos.org
> http://lists.centos.org/mailman/listinfo/centos
> 
>                           

-- 
Robert Heller             -- 978-544-6933
Deepwoods Software        -- Custom Software Services
http://www.deepsoft.com/  -- Linux Administration Services
heller at deepsoft.com       -- Webhosting Services