Logical volume management
From Wikipedia, the free encyclopedia
In computer storage, logical volume management or LVM is a method of allocating space on mass storage devices that is more flexible than conventional partitioning schemes. In particular, a volume manager can concatenate, stripe together or otherwise combine partitions into larger virtual ones that can be resized or moved, possibly while it is being used.
Volume management is one of many forms of storage virtualization, the one implemented as a layer in the OS disk driver stack.
Contents |
[edit] Design
Most volume manager implementations share the same basic design and start with physical volumes (PVs), which can be hard disk partitions, RAID devices or a SAN. PVs are split into chunks called physical extents (PEs). Some volume managers (such as that in HP-UX and Linux) will have PEs of a uniform size; others (such as that in Veritas) will have variably-sized PEs that can be split and merged at will.
Normally, PEs are simply mapped one-to-one to logical extents (LEs). With mirroring, multiple PEs are mapped onto each LE. These PEs are drawn from a physical volume group (PVG), a set of same-sized PVs which act as would hard disks in a RAID1 array. PVGs are usually laid out so that they reside on different disks and/or data buses for maximum redundancy.
The LEs are pooled into a volume group (VG). The pooled LEs can then be concatenated together into virtual disk partitions called logical volumes or LVs. LVs are usable as raw block devices just as disk partitions are: mountable file systems can be created on them, or they can be used as swap storage.
On striped LVs, each successive LE is allocated from a different PV; depending on the size of the LE, this can improve performance on large sequential reads by bringing to bear the combined read throughput of multiple PVs.
The LVs can be grown or shrunken by concatenating more LEs from or returning them to the pool. The concatenated LEs do not have to be contiguous. This allows LVs to be grown without having to move already-allocated LEs. Some volume managers allow LVs to be resized in either direction while online. Changing the size of the LV does not necessarily change the size of a filesystem on it; it merely changes the size of its containing space. A file system that can be resized online is recommended because it allows the system to adjust its storage on-the-fly without interrupting applications.
PVs and LVs cannot be shared between or span different VGs (although some volume managers may allow them to be moved at will between VGs on the same host). This allows VGs to be conveniently brought online, taken offline or moved between host systems as a single administrative unit.
VGs can grow their storage pool by absorbing new PVs or shrink by retracting from PVs. This may involve moving already-allocated LEs out of the PV. Most volume managers can perform this movement online; this allows storage (if the underlying hardware is hot-pluggable) to be upgraded or replaced without system downtime.
Some volume managers also implement snapshots by applying copy-on-write to each LE. In this scheme, the volume manager will copy the LE to a copy-on-write table just before it is written to. This preserves an old version of the LV—the snapshot—which can later be reconstructed by overlaying the copy-on-write table atop the current LV. Snapshots which are read-write are branching snapshots because they implicitly allow diverging versions of an LV.
Snapshots can be useful for backing up self-consistent versions of volatile data like table files from a busy database, or for rolling back large changes in one swoop, such as an operating system upgrade. Some Linux-based Live CD systems also use snapshots to simulate read-write access on a read-only compact disc.
[edit] Implementations
Vendor | Introduced in | Volume manager | Allocate anywhere[1] | Snapshots | RAID0 | RAID1 | RAID5 | |
---|---|---|---|---|---|---|---|---|
IBM | AIX | Logical Volume Manager | Yes | No[2] | Yes | Yes | No | [3] |
Hewlett-Packard | HP-UX 9.0 | HP Logical Volume Manager | Yes | Yes | Yes | Yes | No | |
FreeBSD | Vinum Volume Manager | Yes | No | Yes | Yes | Yes | ||
Linux 2.2 | Logical Volume Manager | Yes | Yes | Yes | Yes | No | ||
Linux 2.4 | Enterprise Volume Management System | Yes | Yes | Yes | Yes | Yes | ||
Silicon Graphics | Irix or Linux | XVM Volume Manager | Yes | Yes | Yes | Yes | Yes | |
Sun Microsystems | Solaris 8 | Solaris Volume Manager (was Solstice DiskSuite). | No | No | Yes | Yes | Yes | [4] |
Veritas[5] | Cross-OS | Veritas Volume Manager (VxVM) | Yes | Yes | Yes | Yes | Yes | [6] |
Microsoft | Windows 2000 and later NT-based operating systems | Logical Disk Manager | No | Yes [7] | Yes | Yes | Yes | [8] |
[edit] Disadvantages
- The levels of indirection that volume managers introduce can complicate the boot process and make disaster recovery difficult, especially when the base operating system and other essential tools are themselves on an LV.
- Logical volumes can suffer from internal fragmentation when their PEs are not allocated contiguously on underlying storage. This can reduce I/O performance on slow-seeking media (such as magnetic disks), which have to seek over the gaps between extents during large sequential reads or writes. Volume managers which use fixed-size PEs, however, typically make PEs relatively large (a default of 4MB on the Linux LVM, for example) in order to amortize the cost of these seeks.
[edit] Notes
- ^ Denotes whether the volume manager allows LVs to grow and span onto any PV in the VG.
- ^ Does not have a copy-on-write snapshot mechanism; snapshots are created by freezing one volume of a mirror pair.
- ^ Refers to PVs as PPs (physical partitions), and to LVs as LPs (logical partitions).
- ^ Refers to PVs as volumes (which can be combined with RAID0, RAID1 or RAID5 primitives into larger volumes), LVs as soft partitions (which are contiguous extents placeable anywhere on volumes, but which cannot span multiple volumes) and VGs as disk sets.
- ^ Third-party product; available for Windows and many Unix-like OSes.
- ^ Refers to LVs as volumes, VGs as disk groups, has variably-sized PEs called subdisks and LEs called plexes.
- ^ Windows Server 2003 and later
- ^ Does not have a concept of PEs or LEs; can only RAID0, RAID1, RAID5 or concatenate disk partitions into larger volumes; file systems must span whole volumes.
[edit] References
- Lewis, AJ, Logical Volume Manager HOWTO, <http://tldp.org/HOWTO/LVM-HOWTO>.
- HP-UX 11: lvm(7) manual page, Hewlett-Packard, 1996, <http://docs.hp.com/en/B2355-90684/lvm.7.html>.
- Vanel, Laurent & van der Knaap, Ronald (2000), AIX Logical Volume Manager from A to Z: Introduction and Concepts, IBM Redbooks, <http://www.redbooks.ibm.com/redbooks.nsf/0/1f80d43a7a4e475d862568200078bb54?OpenDocument>.
- Veritas Volume Manager 3.1 Administrator's Guide, Hewlett-Packard, 2001, <http://docs.hp.com/en/B7961-90018/B7961-90018.pdf>.
- XVM Volume Manager Administration Guide, Silicon Graphics, 1999, <http://techpubs.sgi.com/library/tpl/cgi-bin/getdoc.cgi?coll=linux&db=bks&fname=/SGI_Admin/XVM_AG>.
- Solaris Volume Manager Administration Guide, Sun Microsystems, 2003, <http://docsun.cites.uiuc.edu/sun_docs/C/solaris_9/SUNWaadm/LOGVOLMGRADMIN/toc.html>.
- Comparison matrix of Windows LDM and Veritas Volume Manager, Symantec Corporation, 2003, <http://eval.veritas.com/mktginfo/products/White_Papers/Storage_Server_Management/sfw41-ldm-comparison-matrix-paper.pdf>