打开APP
userphoto
未登录

开通VIP,畅享免费电子书等14项超值服

开通VIP
Logical Volume Manager (Linux) - Wikipedia, t...
Logical Volume Manager (Linux)
From Wikipedia, the free encyclopedia
Jump to:navigation,search
This article needs additionalcitations forverification.
Please helpimprove this article by addingreliable references. Unsourced material may bechallenged andremoved. (June 2010)
Linux Logical Volume Manager (LVM) v1
LVM is alogical volume manager for theLinux kernel; it manages disk drives and similar mass-storage devices, in particular large ones. The term "volume" refers to a disk drive or partition thereof. It was originally written in 1998 byHeinz Mauelshagen, who based its design on that of the LVM inHP-UX.
The abbreviation "LVM" can also refer to theLogical Volume Management available inHP-UX,IBM AIX andOS/2 operating systems.
The installers for theArch Linux,Debian,Fedora,Gentoo,Mandriva,MontaVista Linux,openSUSE,SLED,Slackware,SLES, andUbuntu distributions are LVM-aware and can install a bootable system with aroot filesystem on alogical volume.
Contents
[hide]
1 Common uses
2 Features
3 Implementation3.1 Caveats
4 See also
5 References
6 External links
[edit] Common uses
LVM is suitable for:
Managing large hard disk farms by letting you add disks, replace disks, copy and share contents from one disk to another without disrupting service.
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 you to resize your disk partitions easily as needed.
Making backups by taking "snapshots."
Creating singlelogical volumes of multiple physical volumes or entire hard disks (somewhat similar toRAID 0, but more similar toJBOD), allowing for dynamic volume resizing.
One can think of LVM as a thin software layer on top of the hard disks and partitions, which creates an illusion of continuity and ease-of-use for managing hard-drive replacement, repartitioning, and backups.
[edit] Features
The LVM can:
Resizevolume groups online by absorbing newphysical volumes (PV) or ejecting existing ones.
Resize logical volumes (LV) online by concatenatingextents onto them or truncating extents from them.
Create read-onlysnapshots of logical volumes (LVM1).
Create read-writesnapshots of logical volumes (LVM2).
Stripe whole or parts of logical volumes across multiple PVs, in a fashion similar toRAID 0.
Mirror whole or parts of logical volumes, in a fashion similar toRAID 1.
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-storagecluster (where disks holding the PVs are shared between multiple host computers), but requires an additional daemon to propagate state changes between cluster nodes.
LVM does not:
Provideparity-based redundancy across LVs, as withRAID levels 3 through 6. This functionality is instead provided by the Linuxmultiple disk subsystem, which can be used as LVM physical volumes.
[edit] Implementation
LVM keeps a metadata header at the start of everyphysical volume, each of which is uniquely identified by aUUID. Each PV's header is a complete copy of the entire volume group's layout, including the UUIDs of all other PV, the UUIDs of all logical volumes and an allocation map ofPEs toLEs. 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 thedevice 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 asEVMS). 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:
Searches for PVs in all available block devices.
Parses the metadata header in each PV found.
Computes the layouts of all visible volume groups.
Loops over each logical volume in the volume group to be brought online and: Checks if the logical volume to be brought online has all its PVs visible.
Creates a new, empty device mapping.
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:
Creates a new, empty device mapping for the destination.
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.
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 filesystems being aware that their underlying storage is moving.
[edit] Caveats
Until Linux kernel 2.6.31[1],write barriers were not supported (fully supported in 2.6.33). This means that the guarantee against filesystem corruption offered byjournaled file systems likeext3 andXFS was negated under some circumstances.[2] Many Linux distributions, with the notable exception ofSUSE andFedora, turn off protective barriers by default anyway, to prevent performance degradation.
[edit] See also
Logical volume management
Snapshot (computer storage)
Hot copy
[edit] References
^"Bug 9554 - write barriers over device mapper are not supported". 2009-07-01.http://bugzilla.kernel.org/show_bug.cgi?id=9554. Retrieved 2010-01-24.
^"Barriers and journaling filesystems".LWN. 2008-05-22.http://lwn.net/Articles/283161. Retrieved 2008-05-28.
Lewis, AJ (2006-11-27)."LVM HOWTO".Linux Documentation Project.http://tldp.org/HOWTO/LVM-HOWTO. Retrieved 2008-03-04. .
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).
[edit] External links
LVM2 Resource Page
How to install Ubuntu over LVM Filesystem - debuntu.org
All about LVM on one page - a page covering LVM, starting with theory and ending with many practical examples about its usage.
Ext2read A windows application to read/copy ext2/ext3/ext4 files residing in LVM partition.
本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请点击举报
打开APP,阅读全文并永久保存 查看更多类似文章
猜你喜欢
类似文章
【热】打开小程序,算一算2024你的财运
Linux中什么是LVM?
LVM(logical volume manager) 逻辑卷管理器
Migrating the contents of a physical volume - AIX and pSeries Information Center for V5.3
AIX Interview Questions and Answers
Linux逻辑盘卷管理LVM详解 - ELM\‘s Blog
CentOS 5.2 LVM 新增加一块硬盘的方法 - linux bsd - 好想好好爱...
更多类似文章 >>
生活服务
热点新闻
分享 收藏 导长图 关注 下载文章
绑定账号成功
后续可登录账号畅享VIP特权!
如果VIP功能使用有故障,
可点击这里联系客服!

联系客服