http://en.wikipedia.org/wiki/Logical_Volume_Manager_(Linux)

Logical Volume Manager (Linux)

From Wikipedia, the free encyclopedia
 
 
"Logical Volume Manager" redirects here. It is not to be confused with logical volume manager.
Linux Logical Volume Manager
Original author(s) Heinz Mauelshagen
Stable release 3.12.4 (8 December 2013; 1 day ago)[±][1]
Preview release 3.13-rc3(6 December 2013; 3 days ago) [±][2]
Written in C
Operating system Linux
License GNU GPL
Website kernel.org

 

LVM is a logical volume manager for the Linux kernel; it manages disk drives and similar mass-storage devices. The term "volume" refers to a disk drive or partition thereof. It was originally written in 1998 by Heinz Mauelshagen, who based its design on that of the LVM in HP-UX.

The installers for the Arch LinuxCrunchBangCentOSDebianFedoraGentooMandrivaMontaVista LinuxopenSUSE,PardusRed Hat Enterprise LinuxSlackwareSLEDSLESLinux Mint, and Ubuntu distributions are LVM-aware and can install a bootable system with a root filesystem on a logical volume.

Common uses[edit]

LVM is commonly used for the following purposes:

  • Managing large hard disk farms by allowing disks to be added and replaced without downtimes and services disruption, in combination with hot swapping.
  • On small systems (like a desktop at home), instead of having to estimate at installation time how big a partition might need to be in the future, LVM allows file systems to be easily resized later as needed.
  • Performing consistent backups by taking snapshots of the logical volumes.
  • Creating single logical volumes of multiple physical volumes or entire hard disks (somewhat similar to RAID 0, but more similar to JBOD), allowing for dynamic volume resizing.
  • the Ganeti solution stack relies on the Linux Logical Volume Manager

LVM can be considered as a thin software layer on top of the hard disks and partitions, which creates an abstraction of continuity and ease-of-use for managing hard drive replacement, re-partitioning, and backup.

Features[edit]

The LVM can:

  • Resize volume groups online by absorbing new physical volumes (PV) or ejecting existing ones.
  • Resize logical volumes (LV) online by concatenating extents onto them or truncating extents from them.
  • Create read-only snapshots of logical volumes (LVM1).
  • Create read-write snapshots of logical volumes (LVM2).
  • Create RAID logical volumes (since recent LVM implementations, such as Red Hat Enterprise Linux v6 [1]): RAID1, RAID5, RAID6, etc.
  • Stripe whole or parts of logical volumes across multiple PVs, in a fashion similar to RAID 0.
  • Mirror whole or parts of logical volumes, in a fashion similar to RAID 1.
  • Allocate thin-provisioned logical volumes from a pool [2]
  • Move online logical volumes between PVs.
  • Split or merge volume groups in situ (as long as no logical volumes span the split). This can be useful when migrating whole logical volumes to or from offline storage.

The LVM will also work in a shared-storage cluster (where disks holding the PVs are shared between multiple host computers), but requires an additional daemon to propagate state changes between cluster nodes.

Implementation[edit]

Inner workings of the version 1 of LVM. In this diagram, PE stands for a Physical Extent.

Relationship between various elements of the LVM.

LVM keeps a metadata header at the start of every physical volume, each of which is uniquely identified by a UUID. Each PV's header is a complete copy of the entire volume group's layout, including the UUIDs of all other PVs, the UUIDs of all logical volumes and an allocation map of PEsto LEs. This simplifies data recovery in the event of PV loss.

In the 2.6-series of the Linux Kernel, the LVM is implemented in terms of the device mapper, a simple block-level scheme for creating virtual block devices and mapping their contents onto other block devices. This minimizes the amount of relatively hard-to-debug kernel code needed to implement the LVM. It also allows its I/O redirection services to be shared with other volume managers (such as EVMS). Any LVM-specific code is pushed out into its user-space tools, which merely manipulate these mappings and reconstruct their state from on-disk metadata upon each invocation.

To bring a volume group online, the "vgchange" tool:

  1. Searches for PVs in all available block devices.
  2. Parses the metadata header in each PV found.
  3. Computes the layouts of all visible volume groups.
  4. Loops over each logical volume in the volume group to be brought online and:
    1. Checks if the logical volume to be brought online has all its PVs visible.
    2. Creates a new, empty device mapping.
    3. Maps it (with the "linear" target) onto the data areas of the PVs the logical volume belongs to.

To move an online logical volume between PVs on the same Volume Group, use the "pvmove" tool:

  1. Creates a new, empty device mapping for the destination.
  2. Applies the "mirror" target to the original and destination maps. The kernel will start the mirror in "degraded" mode and begin copying data from the original to the destination to bring it into sync.
  3. Replaces the original mapping with the destination when the mirror comes into sync, then destroys the original.

These device mapper operations take place transparently, without applications or file systems being aware that their underlying storage is moving.

Caveats[edit]

Until Linux kernel 2.6.31,[3] write barriers were not supported (fully supported in 2.6.33). This means that the guarantee against filesystem corruption offered by journaled file systems like ext3and XFS was negated under some circumstances.[4]

See also[edit]

References[edit]

  1. Jump up^ Kroah-Hartman, Greg (8 December 2013). "Linux 3.12.4 released"Linux kernel mailing list. Retrieved 9 December 2013.
  2. Jump up^ Torvalds, Linus (6 December 2013). "Linux 3.13-rc3"Linux kernel mailing list. Retrieved 6 December 2013.
  3. Jump up^ "Bug 9554 - write barriers over device mapper are not supported". 2009-07-01. Retrieved 2010-01-24.
  4. Jump up^ "Barriers and journaling filesystems"LWN. 2008-05-22. Retrieved 2008-05-28.

Further reading[edit]

  1. Lewis, AJ (2006-11-27). "LVM HOWTO"Linux Documentation Project. Retrieved 2008-03-04..
  2. US patent 5129088, Auslander, et al., "Data Processing Method to Create Virtual Disks from Non-Contiguous Groups of Logically Contiguous Addressable Blocks of Direct Access Storage Device", issued 1992-7-7 (fundamental patent).
  3. "RedHat Linux: What is Logical Volume Manager or LVM?"techmagazinez.com. 6 August 2013. Retrieved 4 September 2013.
  4. "LVM2 Resource Page"sourceware.org. 8 June 2012. Retrieved 4 September 2013.
  5. "How-To: Install Ubuntu on LVM partitions"Debuntu.org. 28 July 2007. Retrieved 4 September 2013.
  6. "Logical Volume Manager"markus-gattol.name. 13 July 2013.
The Linux operating system family
 
 
Organization
 
Linux kernel
 
GNU
 
Distribution
 
Linux distribution
 
Other
 
Documentation
 
Developers
 
Users
 
Technical
 
Standards
 
Operation
 
Core components
 
C standard library
 
Init daemons
 
Sysutils
 
Linux kernel
components
 
Variants
 
Main line
 
High-performance
computing
 (HPC)
 
Real-time
computing
 (RTC)
 
MMU-less
 
Virtualization
 
Hypervisor
 
OS-level virtualization
 
Other
 
Malware
 
User interfaces
 
Graphical UI
 
Linux adoption
 
Linux range of use
 
Mobile
 
Adopters
 
Media
 
People

Logical Volume Manager (Linux)的更多相关文章

  1. Linux 系统 LVM(Logical Volume Manager)逻辑卷管理

    一.前言 每个Linux使用者在安装Linux时都会遇到这样的困境:在为系统分区时,如何精确评估和分配各个硬盘分区的容量,因为系统管理员不但要考虑到 当前某个分区需要的容量,还要预见该分区以后可能需要 ...

  2. Linux学习-逻辑滚动条管理员 (Logical Volume Manager)

    LVM 可以整合多个实体 partition 在一起, 让这些 partitions 看起来就像是一个磁盘一样!而且,还可以在未来新增或移除其他的实 体 partition 到这个 LVM 管理的磁盘 ...

  3. 逻辑卷管理LVM (Logical Volume Manager)

    什么是LVM? LVM(Logical Volume Manager)逻辑卷管理,是一种将一个或多个硬盘的分区在逻辑上集合,相当于一个大硬盘来使用,当硬盘的空间不够使用的时候,可以继续将其它的硬盘的 ...

  4. Logical Volume Manager (LVM)

    LVM 是一种可用在Linux内核的逻辑分卷管理器:可用于管理磁盘驱动器或其他类似的大容量存储设备. 本文提供如何在 Arch Linux 中配置和使用 Logical Volume Manager ...

  5. 逻辑卷管理-LVM(Logical Volume Manager)

    一. 概念与由来 LVM:逻辑卷管理(Logical Volume Manager) 普通的磁盘分区管理方式在逻辑分区划分好之后就无法改变其大小,当一个逻辑分区存放不下某文件时,这个文件因为受上层文件 ...

  6. LVM(Logical Volume Manager)逻辑卷管理

    本文实验部分,完全由本人亲自动手实践得来 文章中有部分的内容是我个人通过实验测试出来的,虽以目前本人的能力还没发现不通之处,但错误难免,所以若各位朋友发现什么错误,或有疑惑.更好的建议等,盼请各位能在 ...

  7. 【原理】LVM(Logical Volume Manager)动态卷管理

    一张图让你学会LVM   导读 随着科技的进步,人们不知不觉的就进入了大数据的时代,数据的不断增加我们发现我们的磁盘越来越不够用了,接下来就是令人头疼的事情--加硬盘,数据的备份与还原.LVM就是Li ...

  8. 逻辑卷管理LVM(logical volume manager)

    LVM的全名是logical volume manager,中文翻译逻辑卷管理器.之所以称为卷是因为可以将文件系统像卷一样伸长和缩短,LVM的做法是将几个物理的分区(或磁盘)通过软件组合成为一块独立的 ...

  9. 学习OpenStack之 (4): Linux 磁盘、分区、挂载、逻辑卷管理 (Logical Volume Manager)

    0. 背景: inux用户安装Linux操作系统时遇到的一个常见的难以决定的问题就是如何正确地评估各分区大小,以分配合适的硬盘空间.普通的磁盘分区管理方式在逻辑分区划分好之后就无法改变其大小,当一个逻 ...

随机推荐

  1. 【Luogu】P2155沙拉公主的困惑(数论)

    题目链接 数论果然是硬伤qwq 还是智商上的硬伤 我们来讲两个道理 No.1 求1~i!中与i!互质的数的个数 实际上就是求i!的欧拉函数 有如下递推式: f[1]=1 if(i为合数) f[i]=f ...

  2. php-超全局变量

    下表列出了您能够在 $_SERVER 中访问的最重要的元素: 元素/代码 描述 $_SERVER[' PHP_SELF '] 返回当前执行脚本的文件名. $_SERVER[' GATEWAY_INTE ...

  3. nvm、node、npm安装以及pycharm配置eslint

    nvm.node.npm之间的区别 1. nvm的官方叫法:nodejs版本管理工具. nvm相当于是家长,一个家长可以管理多个孩子. 也就是说:一个nvm可以管理很多node版本和npm版本. 2. ...

  4. hdu 1558 线段相交+并查集路径压缩

    Segment set Time Limit: 3000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total ...

  5. 共享内存之——mmap内存映射

    共享内存允许两个或多个进程共享一给定的存储区,因为数据不需要来回复制,所以是最快的一种进程间通信机制.共享内存可以通过mmap()映射普通文件 (特殊情况下还可以采用匿名映射)机制实现,也可以通过sy ...

  6. Django 博客首页视图

    Django 处理 HTTP 请求 Web 应用的交互过程其实就是 HTTP 请求与响应的过程.无论是在 PC 端还是移动端,我们通常使用浏览器来上网,上网流程大致来说是这样的: 我们打开浏览器,在地 ...

  7. C/C++程序编译运行过程分析(转载)

    为了减轻使用机器语言编程的痛苦,人们进行了一种有益的改进:用一些简洁的英文字母.符号串来替代一个特定的指令的二进制串,比如,用“A D D”代表加法,“M O V”代表数据传递等等,这样一来,人们很容 ...

  8. Linux命令文件查看过滤

    Linux命令篇 1.查看一个文件的后100行的命令: tail -n 100 Linux下查看文件前几行一般用head -n xx,查看后面几行用tail -n xx.除此之外,还有: tail - ...

  9. interesting-exploit

    http://whereisk0shl.top/cve-2017-7269-iis6-interesting-exploit.html

  10. Android Base64转图片

    最近做一个项目里面有关于图片展示的需求,但是任性的后台跟我说没有图片服务器,只能给我base64让我自己转成图片,好吧,我忍,转就转吧.. 首先第一步咱还是谦虚点上百度查查别人咋转的,结果似乎各位码友 ...