Logical volume management
||The English used in this article may not be easy for everybody to understand. (October 2011)|
Logical volume management is a method of allocating computer storage. It is about allocating space on mass storage devices, like hard drives. It is more flexible than the partitioning of the drive into static (unchangeable) volumes. With a logical volume manager it is possible to grow partitions, even beyond the size of one physical disk. It is also possible to use striping or to put partitions together and combine them while they are being used.
Logical volume management is a form of virtualisation. It makes it easier to adapt to the changing storage needs of computer users.
Design[change | change source]
Volume managers differ but some basic concepts exist across most versions. The volume manager starts with physical volumes or PVs, which can be hard disk partitions, RAID devices or SAN LUNs. PVs are split into small chunks of even size (a default of 4 MB on HP-UX) called physical extents or PEs. The PEs are then pooled into a volume group or VG.
The pooled PEs can then be concatenated together into virtual disk partitions called logical volumes or LVs. These LVs behave just like hard disk partitions: mountable file systems can be created on them, or they can be used as raw block devices for swap.
The LVs can be grown by concatenating more PEs from the pool. Some volume managers allow LV shrinking; some allow online resizing in either direction. 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 may also be organized into physical volume groups or PVGs. This allows LVs to be mirrored by pairing together its PEs with redundant ones on a different PVG, so that the failure of one PVG will still leave at least one complete copy of the LV online. In practice, PVGs are usually chosen so that their PVs reside on different sets of disks and/or data buses for maximum redundancy.
Some volume managers also implement snapshotting by applying copy-on-write (COW) to each PE. In this scheme, the volume manager will copy a PE to a COW table just before it is written to. This preserves an old version of the LE—the snapshot—which can later be reconstructed by overlaying the copy-on-write table on the current LE. Snapshots which are read-write are branching snapshots because they implicitly allow diverging versions of an LE.
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 LiveCD systems also use snapshots to simulate read-write access on a read-only compact disc.
Disadvantages[change | change source]
The levels of indirection that volume managers introduce can complicate disaster recovery, especially when the base operating system and other essential tools are themselves on an LE.
Implementations[change | change source]
Many operating systems ship with LVMs:
- AIX - Logical Volume Manager
- FreeBSD - Vinum
- HP-UX - HP Logical Volume Manager, since HP-UX Release 9.0 in July 1992.
- Linux - Logical Volume Manager (LVM) and Enterprise Volume Management System (EVMS). Both are front-ends to the Linux device mapper.
- Microsoft Windows - Logical Disk Manager (LDM), Windows 2000 or later NT based OSes.
- OS/2 - (LVM), from version 4.5, including eComStation.
- Solaris - Solaris Volume Manager (SVM) included in Solaris 9 and Solstice DiskSuite (SDS) up to Solaris 8.
- Veritas Volume Manager (VxVM), available on a variety of (unix like) OSes. Now included in Symantec's Storage Foundation Suite
References[change | change source]
- Laurent Vanel, Ronald van der Knaap, Dugald Foreman (2000). AIX Logical Volume Manager from A to Z: Introduction and Concepts. IBM Redbooks.
- Logical Volume Manager HOWTO