Post stating point wise differences between LVM and LVM2 explained. This is one of the frequently asked question for Linux interview.
One of the frequently asked Linux interview question is ‘what is difference between LVM and LVM2?’ to which most of the candidates flanks. In this article we will be discussing about this question.
First of all what is LVM? LVM is logical volume manager. It is widely used volume manager in Linux and Unix like VxVM (Veritas volume manager). As a sysadmin you must be knowing all tasks which can be done in LVM but not theoretical question like difference between LVM and LVM2.
LVM and LVM2 are two different versions of LVM. Obviously LVM2 being latest. Their differences can be identified in terms of their functions, services offered, availability etc. Lets see one by one :
LVM is available in most of the famous distributions like HPUX, Redhat, Suse etc. LVM2 is available only kernel version 2.6.9 and above like RHEL4 and later. You can even build LVM modules as per your kernel (if its not available in your distributions). Setup information can be found here.
LVM2 has backward compatibility with LVM. It has same command modules and infrastructure like LVM with enhanced features. LVM being previous version dont have compatibility with LVM2 features.
Size limits :
Different size limits are increased in new LVM2. Maximum file system/device size was capped to 2TB in LVM whereas its 16TB(32-bit CPU) & 8EB (64 bit CPU) in LVM2.
Max LV and PV were 255 in LVM. In LVM2 it has no limit (snippet from vgcreate manpage below).
-l, --maxlogicalvolumes MaxLogicalVolumes
Sets the maximum number of logical volumes allowed in this vol-
ume group. The setting can be changed with vgchange. For vol-
ume groups with metadata in lvm1 format, the limit and default
value is 255. If the metadata uses lvm2 format, the default
-p, --maxphysicalvolumes MaxPhysicalVolumes
Sets the maximum number of physical volumes that can belong to
this volume group. The setting can be changed with vgchange.
For volume groups with metadata in lvm1 format, the limit and
default value is 255. If the metadata uses lvm2 format, the
Extra features :
LVM2 is bundled with below extra features over LVM :
- Volume mirroring support
- Shared volume support with GFS
- Transnational metadata for fast recovery
- Cluster suite failover supported
- Striped volume expansion
This sums up difference between LAM and LVM2 versions. Write us in comments if you have corrections/suggestions.