Red Hat Training

A Red Hat training course is available for Red Hat Enterprise Linux

管​理​逻​辑​卷​管​理​器​​​​​​​​

Red Hat Enterprise Linux 5

LVM 管​理​员​指​南​

版 3

Logo

摘要

本​​​​​​​书​​​​​​​介​​​​​​​绍​​​​​​​了​​​​​​​ LVM 逻​​​​​​​辑​​​​​​​卷​​​​​​​管​​​​​​​理​​​​​​​器​​​​​​​(logical volume manager),其​​​​​​​中​​​​​​​包​​​​​​​括​​​​​​​在​​​​​​​群​​​​​​​集​​​​​​​环​​​​​​​境​​​​​​​中​​​​​​​运​​​​​​​行​​​​​​​ LVM 的​​​​​​​资​​​​​​​料​​​​​​​。​​​​​​​本​​​​​​​文​​​​​​​档​​​​​​​的​​​​​​​内​​​​​​​容​​​​​​​只​​​​​​​适​​​​​​​用​​​​​​​于​​​​​​​ LVM2 发​​​​​​​行​​​​​​​版​​​​​​​本​​​​​​​。​​​​​​​

简​​​​​​​介​​​​​​​

1. 关​​​​​​​于​​​​​​​此​​​​​​​手​​​​​​​册​​​​​​​

本​​​​​​​书​​​​​​​介​​​​​​​绍​​​​​​​了​​​​​​​ LVM 逻​​​​​​​辑​​​​​​​卷​​​​​​​管​​​​​​​理​​​​​​​器​​​​​​​(LVM),其​​​​​​​中​​​​​​​包​​​​​​​括​​​​​​​在​​​​​​​群​​​​​​​集​​​​​​​环​​​​​​​境​​​​​​​中​​​​​​​运​​​​​​​行​​​​​​​ LVM 的​​​​​​​资​​​​​​​料​​​​​​​。​​​​​​​本​​​​​​​文​​​​​​​档​​​​​​​的​​​​​​​内​​​​​​​容​​​​​​​只​​​​​​​适​​​​​​​用​​​​​​​于​​​​​​​ LVM2 发​​​​​​​行​​​​​​​版​​​​​​​本​​​​​​​。​​​​​​​

2. 读​​​​​​​者​​​​​​​

本​​​​​​​书​​​​​​​面​​​​​​​向​​​​​​​的​​​​​​​是​​​​​​​那​​​​​​​些​​​​​​​管​​​​​​​理​​​​​​​运​​​​​​​行​​​​​​​ Linux 操​​​​​​​作​​​​​​​系​​​​​​​统​​​​​​​的​​​​​​​系​​​​​​​统​​​​​​​管​​​​​​​理​​​​​​​员​​​​​​​。​​​​​​​要​​​​​​​求​​​​​​​熟​​​​​​​悉​​​​​​​红​​​​​​​帽​​​​​​​企​​​​​​​业​​​​​​​版​​​​​​​ Linux 5 和​​​​​​​ GFS 文​​​​​​​件​​​​​​​系​​​​​​​统​​​​​​​管​​​​​​​理​​​​​​​。​​​​​​​

3. 软​​​​​​​件​​​​​​​版​​​​​​​本​​​​​​​

表 1. 软​​​​​​​件​​​​​​​版​​​​​​​本​​​​​​​

软​​​​​​​件​​​​​​​ 描​​​​​​​述​​​​​​​
RHEL5
请​​​​​​​参​​​​​​​考​​​​​​​ RHEL5 或​​​​​​​者​​​​​​​更​​​​​​​高​​​​​​​版​​​​​​​本​​​​​​​
GFS
请​​​​​​​参​​​​​​​考​​​​​​​ RHEL5 的​​​​​​​ GFS 或​​​​​​​者​​​​​​​更​​​​​​​高​​​​​​​版​​​​​​​本​​​​​​​

5. 反​​​​​​​馈​​​​​​​

我​​​​​​​们​​​​​​​很​​​​​​​乐​​​​​​​于​​​​​​​了​​​​​​​解​​​​​​​您​​​​​​​有​​​​​​​关​​​​​​​打​​​​​​​印​​​​​​​错​​​​​​​误​​​​​​​或​​​​​​​者​​​​​​​可​​​​​​​使​​​​​​​本​​​​​​​手​​​​​​​册​​​​​​​更​​​​​​​好​​​​​​​工​​​​​​​作​​​​​​​的​​​​​​​想​​​​​​​法​​​​​​​。​​​​​​​请​​​​​​​在​​​​​​​ Bugzilla(http://bugzilla.redhat.com/bugzilla/)中​​​​​​​使​​​​​​​用​​​​​​​ rh-cs 提​​​​​​​交​​​​​​​您​​​​​​​的​​​​​​​报​​​​​​​告​​​​​​​。​​​​​​​
Be sure to mention the manual's identifier:
Bugzilla component: Documentation-cluster
Book identifier: Cluster_Logical_Volume_Manager(EN)-5 (2009-01-05T15:20)
By mentioning this manual's identifier, we know exactly which version of the guide you have.
如​​​​​​​果​​​​​​​您​​​​​​​有​​​​​​​任​​​​​​​何​​​​​​​可​​​​​​​改​​​​​​​进​​​​​​​此​​​​​​​文​​​​​​​档​​​​​​​的​​​​​​​建​​​​​​​议​​​​​​​,请​​​​​​​尽​​​​​​​量​​​​​​​说​​​​​​​得​​​​​​​具​​​​​​​体​​​​​​​一​​​​​​​些​​​​​​​。​​​​​​​如​​​​​​​果​​​​​​​您​​​​​​​发​​​​​​​现​​​​​​​任​​​​​​​何​​​​​​​错​​​​​​​误​​​​​​​,请​​​​​​​将​​​​​​​错​​​​​​​误​​​​​​​所​​​​​​​在​​​​​​​部​​​​​​​分​​​​​​​号​​​​​​​码​​​​​​​以​​​​​​​及​​​​​​​上​​​​​​​下​​​​​​​文​​​​​​​包​​​​​​​括​​​​​​​在​​​​​​​内​​​​​​​,以​​​​​​​便​​​​​​​我​​​​​​​们​​​​​​​比​​​​​​​较​​​​​​​容​​​​​​​易​​​​​​​找​​​​​​​到​​​​​​​这​​​​​​​些​​​​​​​错​​​​​​​误​​​​​​​之​​​​​​​处​​​​​​​。​​​​​​​

第 1 章 LVM 逻​​​​​​​辑​​​​​​​卷​​​​​​​管​​​​​​​理​​​​​​​器​​​​​​​

本​​​​​​​章​​​​​​​介​​​​​​​绍​​​​​​​了​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​管​​​​​​​理​​​​​​​器​​​​​​​(LVM)内​​​​​​​容​​​​​​​的​​​​​​​高​​​​​​​级​​​​​​​总​​​​​​​览​​​​​​​。​​​​​​​

1.1. 逻​​​​​​​辑​​​​​​​卷​​​​​​​

卷​​​​​​​管​​​​​​​理​​​​​​​生​​​​​​​成​​​​​​​了​​​​​​​物​​​​​​​理​​​​​​​存​​​​​​​储​​​​​​​的​​​​​​​摘​​​​​​​要​​​​​​​层​​​​​​​,它​​​​​​​可​​​​​​​允​​​​​​​许​​​​​​​您​​​​​​​创​​​​​​​建​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​存​​​​​​​储​​​​​​​卷​​​​​​​。​​​​​​​这​​​​​​​样​​​​​​​就​​​​​​​为​​​​​​​您​​​​​​​在​​​​​​​很​​​​​​​多​​​​​​​方​​​​​​​面​​​​​​​提​​​​​​​供​​​​​​​了​​​​​​​更​​​​​​​大​​​​​​​的​​​​​​​灵​​​​​​​活​​​​​​​性​​​​​​​,而​​​​​​​不​​​​​​​仅​​​​​​​仅​​​​​​​是​​​​​​​直​​​​​​​接​​​​​​​使​​​​​​​用​​​​​​​物​​​​​​​理​​​​​​​存​​​​​​​储​​​​​​​。​​​​​​​
逻​​​​​​​辑​​​​​​​卷​​​​​​​提​​​​​​​供​​​​​​​存​​​​​​​储​​​​​​​虚​​​​​​​拟​​​​​​​化​​​​​​​。​​​​​​​在​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​中​​​​​​​您​​​​​​​不​​​​​​​受​​​​​​​物​​​​​​​理​​​​​​​磁​​​​​​​盘​​​​​​​大​​​​​​​小​​​​​​​限​​​​​​​制​​​​​​​。​​​​​​​另​​​​​​​外​​​​​​​,软​​​​​​​件​​​​​​​并​​​​​​​不​​​​​​​了​​​​​​​解​​​​​​​硬​​​​​​​盘​​​​​​​存​​​​​​​储​​​​​​​配​​​​​​​置​​​​​​​,因​​​​​​​此​​​​​​​可​​​​​​​以​​​​​​​在​​​​​​​不​​​​​​​停​​​​​​​止​​​​​​​应​​​​​​​用​​​​​​​程​​​​​​​序​​​​​​​或​​​​​​​者​​​​​​​未​​​​​​​挂​​​​​​​载​​​​​​​文​​​​​​​件​​​​​​​系​​​​​​​统​​​​​​​的​​​​​​​情​​​​​​​况​​​​​​​下​​​​​​​重​​​​​​​新​​​​​​​设​​​​​​​定​​​​​​​大​​​​​​​小​​​​​​​或​​​​​​​者​​​​​​​移​​​​​​​动​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​。​​​​​​​这​​​​​​​样​​​​​​​可​​​​​​​以​​​​​​​降​​​​​​​低​​​​​​​操​​​​​​​作​​​​​​​消​​​​​​​耗​​​​​​​。​​​​​​​
逻​​​​​​​辑​​​​​​​卷​​​​​​​在​​​​​​​直​​​​​​​接​​​​​​​使​​​​​​​用​​​​​​​物​​​​​​​理​​​​​​​存​​​​​​​储​​​​​​​时​​​​​​​有​​​​​​​以​​​​​​​下​​​​​​​优​​​​​​​势​​​​​​​:
  • 灵​​​​​​​活​​​​​​​的​​​​​​​容​​​​​​​量​​​​​​​
    当​​​​​​​使​​​​​​​用​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​时​​​​​​​,可​​​​​​​在​​​​​​​多​​​​​​​个​​​​​​​磁​​​​​​​盘​​​​​​​间​​​​​​​扩​​​​​​​展​​​​​​​文​​​​​​​件​​​​​​​系​​​​​​​统​​​​​​​,因​​​​​​​为​​​​​​​您​​​​​​​可​​​​​​​以​​​​​​​将​​​​​​​磁​​​​​​​盘​​​​​​​和​​​​​​​分​​​​​​​区​​​​​​​集​​​​​​​合​​​​​​​成​​​​​​​一​​​​​​​个​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​。​​​​​​​
  • 重​​​​​​​新​​​​​​​设​​​​​​​定​​​​​​​存​​​​​​​储​​​​​​​池​​​​​​​大​​​​​​​小​​​​​​​
    您​​​​​​​可​​​​​​​以​​​​​​​使​​​​​​​用​​​​​​​检​​​​​​​单​​​​​​​的​​​​​​​软​​​​​​​件​​​​​​​命​​​​​​​令​​​​​​​增​​​​​​​大​​​​​​​或​​​​​​​者​​​​​​​减​​​​​​​小​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​的​​​​​​​大​​​​​​​小​​​​​​​,而​​​​​​​无​​​​​​​需​​​​​​​对​​​​​​​所​​​​​​​在​​​​​​​磁​​​​​​​盘​​​​​​​设​​​​​​​备​​​​​​​重​​​​​​​新​​​​​​​格​​​​​​​式​​​​​​​化​​​​​​​或​​​​​​​者​​​​​​​重​​​​​​​新​​​​​​​分​​​​​​​区​​​​​​​。​​​​​​​
  • 在​​​​​​​线​​​​​​​数​​​​​​​据​​​​​​​重​​​​​​​新​​​​​​​定​​​​​​​位​​​​​​​
    要​​​​​​​部​​​​​​​署​​​​​​​更​​​​​​​新​​​​​​​、​​​​​​​更​​​​​​​快​​​​​​​或​​​​​​​者​​​​​​​更​​​​​​​有​​​​​​​弹​​​​​​​性​​​​​​​的​​​​​​​存​​​​​​​储​​​​​​​子​​​​​​​系​​​​​​​统​​​​​​​,以​​​​​​​便​​​​​​​您​​​​​​​可​​​​​​​以​​​​​​​在​​​​​​​系​​​​​​​统​​​​​​​活​​​​​​​跃​​​​​​​时​​​​​​​移​​​​​​​动​​​​​​​数​​​​​​​据​​​​​​​。​​​​​​​数​​​​​​​据​​​​​​​可​​​​​​​以​​​​​​​在​​​​​​​磁​​​​​​​盘​​​​​​​正​​​​​​​在​​​​​​​使​​​​​​​用​​​​​​​时​​​​​​​进​​​​​​​行​​​​​​​重​​​​​​​新​​​​​​​分​​​​​​​配​​​​​​​。​​​​​​​例​​​​​​​如​​​​​​​,您​​​​​​​可​​​​​​​以​​​​​​​在​​​​​​​删​​​​​​​除​​​​​​​一​​​​​​​个​​​​​​​热​​​​​​​交​​​​​​​换​​​​​​​磁​​​​​​​盘​​​​​​​之​​​​​​​前​​​​​​​将​​​​​​​其​​​​​​​清​​​​​​​空​​​​​​​。​​​​​​​
  • 方​​​​​​​便​​​​​​​设​​​​​​​备​​​​​​​命​​​​​​​名​​​​​​​
    逻​​​​​​​辑​​​​​​​存​​​​​​​储​​​​​​​卷​​​​​​​可​​​​​​​在​​​​​​​用​​​​​​​户​​​​​​​定​​​​​​​义​​​​​​​的​​​​​​​组​​​​​​​群​​​​​​​中​​​​​​​进​​​​​​​行​​​​​​​管​​​​​​​理​​​​​​​,这​​​​​​​些​​​​​​​组​​​​​​​群​​​​​​​可​​​​​​​按​​​​​​​您​​​​​​​的​​​​​​​要​​​​​​​求​​​​​​​进​​​​​​​行​​​​​​​命​​​​​​​名​​​​​​​。​​​​​​​
  • 磁​​​​​​​盘​​​​​​​条​​​​​​​带​​​​​​​
    您​​​​​​​可​​​​​​​以​​​​​​​创​​​​​​​建​​​​​​​一​​​​​​​个​​​​​​​可​​​​​​​在​​​​​​​两​​​​​​​个​​​​​​​或​​​​​​​者​​​​​​​更​​​​​​​多​​​​​​​磁​​​​​​​盘​​​​​​​间​​​​​​​条​​​​​​​状​​​​​​​分​​​​​​​布​​​​​​​数​​​​​​​据​​​​​​​的​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​。​​​​​​​这​​​​​​​可​​​​​​​大​​​​​​​幅​​​​​​​度​​​​​​​提​​​​​​​高​​​​​​​吞​​​​​​​吐​​​​​​​量​​​​​​​。​​​​​​​
  • 镜​​​​​​​像​​​​​​​卷​​​​​​​
    逻​​​​​​​辑​​​​​​​卷​​​​​​​为​​​​​​​您​​​​​​​提​​​​​​​供​​​​​​​了​​​​​​​一​​​​​​​个​​​​​​​方​​​​​​​便​​​​​​​配​​​​​​​置​​​​​​​数​​​​​​​据​​​​​​​镜​​​​​​​像​​​​​​​的​​​​​​​方​​​​​​​法​​​​​​​。​​​​​​​
  • 卷​​​​​​​快​​​​​​​照​​​​​​​
    使​​​​​​​用​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​,您​​​​​​​可​​​​​​​以​​​​​​​提​​​​​​​取​​​​​​​设​​​​​​​备​​​​​​​快​​​​​​​照​​​​​​​,这​​​​​​​样​​​​​​​可​​​​​​​在​​​​​​​持​​​​​​​续​​​​​​​备​​​​​​​份​​​​​​​或​​​​​​​者​​​​​​​在​​​​​​​不​​​​​​​影​​​​​​​响​​​​​​​真​​​​​​​实​​​​​​​数​​​​​​​据​​​​​​​的​​​​​​​情​​​​​​​况​​​​​​​下​​​​​​​测​​​​​​​试​​​​​​​修​​​​​​​改​​​​​​​效​​​​​​​果​​​​​​​。​​​​​​​
本​​​​​​​文​​​​​​​档​​​​​​​的​​​​​​​以​​​​​​​下​​​​​​​内​​​​​​​容​​​​​​​对​​​​​​​在​​​​​​​ LVM 中​​​​​​​实​​​​​​​施​​​​​​​这​​​​​​​些​​​​​​​特​​​​​​​性​​​​​​​进​​​​​​​行​​​​​​​了​​​​​​​论​​​​​​​述​​​​​​​。​​​​​​​

1.2. LVM 构​​​​​​​架​​​​​​​总​​​​​​​览​​​​​​​

在​​​​​​​ Linux 操​​​​​​​作​​​​​​​系​​​​​​​统​​​​​​​的​​​​​​​ RHEL 4 中​​​​​​​,LVM2 替​​​​​​​换​​​​​​​了​​​​​​​原​​​​​​​来​​​​​​​的​​​​​​​ LVM1 逻​​​​​​​辑​​​​​​​卷​​​​​​​管​​​​​​​理​​​​​​​器​​​​​​​,LVM2 比​​​​​​​ LVM1 内​​​​​​​核​​​​​​​架​​​​​​​构​​​​​​​更​​​​​​​具​​​​​​​普​​​​​​​遍​​​​​​​性​​​​​​​。​​​​​​​它​​​​​​​相​​​​​​​对​​​​​​​ LVM1 来​​​​​​​说​​​​​​​有​​​​​​​如​​​​​​​下​​​​​​​改​​​​​​​进​​​​​​​:
  • 灵​​​​​​​活​​​​​​​的​​​​​​​容​​​​​​​量​​​​​​​
  • 更​​​​​​​有​​​​​​​效​​​​​​​的​​​​​​​元​​​​​​​数​​​​​​​据​​​​​​​存​​​​​​​储​​​​​​​
  • 更​​​​​​​好​​​​​​​的​​​​​​​修​​​​​​​复​​​​​​​格​​​​​​​式​​​​​​​
  • 新​​​​​​​的​​​​​​​ ASCII 元​​​​​​​数​​​​​​​据​​​​​​​格​​​​​​​式​​​​​​​
  • 元​​​​​​​数​​​​​​​据​​​​​​​微​​​​​​​调​​​​​​​
  • 元​​​​​​​数​​​​​​​据​​​​​​​冗​​​​​​​余​​​​​​​副​​​​​​​本​​​​​​​
LVM2 可​​​​​​​向​​​​​​​下​​​​​​​兼​​​​​​​容​​​​​​​ LVM1,但​​​​​​​不​​​​​​​支​​​​​​​持​​​​​​​ LVM1 的​​​​​​​快​​​​​​​照​​​​​​​和​​​​​​​群​​​​​​​集​​​​​​​。​​​​​​​您​​​​​​​可​​​​​​​以​​​​​​​使​​​​​​​用​​​​​​​ vgconvert 命​​​​​​​令​​​​​​​将​​​​​​​卷​​​​​​​组​​​​​​​从​​​​​​​ LVM1 格​​​​​​​式​​​​​​​转​​​​​​​换​​​​​​​成​​​​​​​ LVM2 格​​​​​​​式​​​​​​​。​​​​​​​有​​​​​​​关​​​​​​​转​​​​​​​换​​​​​​​ LVM 元​​​​​​​数​​​​​​​据​​​​​​​格​​​​​​​式​​​​​​​的​​​​​​​详​​​​​​​情​​​​​​​请​​​​​​​参​​​​​​​考​​​​​​​ vgconvert(8) man page。​​​​​​​
LVM 逻​​​​​​​辑​​​​​​​卷​​​​​​​的​​​​​​​基​​​​​​​本​​​​​​​物​​​​​​​理​​​​​​​存​​​​​​​储​​​​​​​单​​​​​​​元​​​​​​​是​​​​​​​块​​​​​​​设​​​​​​​备​​​​​​​,比​​​​​​​如​​​​​​​分​​​​​​​区​​​​​​​或​​​​​​​者​​​​​​​整​​​​​​​个​​​​​​​磁​​​​​​​盘​​​​​​​。​​​​​​​这​​​​​​​个​​​​​​​设​​​​​​​备​​​​​​​是​​​​​​​作​​​​​​​为​​​​​​​ LVM 物​​​​​​​理​​​​​​​卷​​​​​​​(PV)进​​​​​​​行​​​​​​​初​​​​​​​始​​​​​​​化​​​​​​​的​​​​​​​。​​​​​​​
要​​​​​​​创​​​​​​​建​​​​​​​一​​​​​​​个​​​​​​​ LVM 逻​​​​​​​辑​​​​​​​卷​​​​​​​,就​​​​​​​要​​​​​​​将​​​​​​​物​​​​​​​理​​​​​​​卷​​​​​​​合​​​​​​​并​​​​​​​到​​​​​​​卷​​​​​​​组​​​​​​​(VG)中​​​​​​​。​​​​​​​这​​​​​​​就​​​​​​​生​​​​​​​成​​​​​​​了​​​​​​​磁​​​​​​​盘​​​​​​​空​​​​​​​间​​​​​​​池​​​​​​​,用​​​​​​​它​​​​​​​可​​​​​​​分​​​​​​​配​​​​​​​ LVM 逻​​​​​​​辑​​​​​​​卷​​​​​​​(LV)。​​​​​​​这​​​​​​​个​​​​​​​过​​​​​​​程​​​​​​​和​​​​​​​将​​​​​​​磁​​​​​​​盘​​​​​​​分​​​​​​​区​​​​​​​的​​​​​​​过​​​​​​​程​​​​​​​类​​​​​​​似​​​​​​​。​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​由​​​​​​​文​​​​​​​件​​​​​​​系​​​​​​​统​​​​​​​和​​​​​​​应​​​​​​​用​​​​​​​程​​​​​​​序​​​​​​​(比​​​​​​​如​​​​​​​数​​​​​​​据​​​​​​​库​​​​​​​)使​​​​​​​用​​​​​​​。​​​​​​​
图 1.1 “LVM Logical Volume Components” shows the components of a simple LVM logical volume:
LVM Logical Volume Components

图 1.1. LVM Logical Volume Components

For detailed information on the components of an LVM logical volume, see 第 2 章 LVM 组​​​​​​​成​​​​​​​.

1.3. 群​​​​​​​集​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​管​​​​​​​理​​​​​​​器​​​​​​​(CLVM)

群​​​​​​​集​​​​​​​的​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​过​​​​​​​滤​​​​​​​器​​​​​​​(CLVM)是​​​​​​​ LVM 的​​​​​​​一​​​​​​​组​​​​​​​群​​​​​​​集​​​​​​​的​​​​​​​扩​​​​​​​展​​​​​​​。​​​​​​​这​​​​​​​些​​​​​​​扩​​​​​​​展​​​​​​​允​​​​​​​许​​​​​​​计​​​​​​​算​​​​​​​机​​​​​​​群​​​​​​​集​​​​​​​使​​​​​​​用​​​​​​​ LVM 管​​​​​​​理​​​​​​​共​​​​​​​享​​​​​​​存​​​​​​​储​​​​​​​(例​​​​​​​如​​​​​​​:在​​​​​​​ SAN 中​​​​​​​)。​​​​​​​
您​​​​​​​是​​​​​​​否​​​​​​​应​​​​​​​该​​​​​​​使​​​​​​​用​​​​​​​ CLVM 取​​​​​​​决​​​​​​​于​​​​​​​您​​​​​​​的​​​​​​​系​​​​​​​统​​​​​​​要​​​​​​​求​​​​​​​:
  • 如​​​​​​​果​​​​​​​您​​​​​​​的​​​​​​​系​​​​​​​统​​​​​​​中​​​​​​​只​​​​​​​有​​​​​​​一​​​​​​​个​​​​​​​节​​​​​​​点​​​​​​​需​​​​​​​要​​​​​​​访​​​​​​​问​​​​​​​您​​​​​​​正​​​​​​​在​​​​​​​将​​​​​​​其​​​​​​​配​​​​​​​置​​​​​​​为​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​的​​​​​​​存​​​​​​​储​​​​​​​,那​​​​​​​么​​​​​​​您​​​​​​​可​​​​​​​以​​​​​​​使​​​​​​​用​​​​​​​ LVM 而​​​​​​​不​​​​​​​是​​​​​​​ LVM 扩​​​​​​​展​​​​​​​,且​​​​​​​在​​​​​​​该​​​​​​​节​​​​​​​点​​​​​​​中​​​​​​​生​​​​​​​成​​​​​​​的​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​对​​​​​​​该​​​​​​​节​​​​​​​点​​​​​​​来​​​​​​​说​​​​​​​都​​​​​​​是​​​​​​​本​​​​​​​地​​​​​​​的​​​​​​​。​​​​​​​
  • 如​​​​​​​果​​​​​​​您​​​​​​​正​​​​​​​在​​​​​​​使​​​​​​​用​​​​​​​群​​​​​​​集​​​​​​​的​​​​​​​系​​​​​​​统​​​​​​​进​​​​​​​行​​​​​​​故​​​​​​​障​​​​​​​切​​​​​​​换​​​​​​​,其​​​​​​​中​​​​​​​在​​​​​​​任​​​​​​​意​​​​​​​时​​​​​​​间​​​​​​​只​​​​​​​有​​​​​​​那​​​​​​​个​​​​​​​访​​​​​​​问​​​​​​​该​​​​​​​存​​​​​​​储​​​​​​​的​​​​​​​单​​​​​​​一​​​​​​​节​​​​​​​点​​​​​​​是​​​​​​​活​​​​​​​跃​​​​​​​的​​​​​​​,您​​​​​​​应​​​​​​​该​​​​​​​使​​​​​​​用​​​​​​​高​​​​​​​性​​​​​​​能​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​管​​​​​​​理​​​​​​​代​​​​​​​理​​​​​​​(HA-LVM)。​​​​​​​有​​​​​​​关​​​​​​​ HA-LVM 的​​​​​​​详​​​​​​​情​​​​​​​请​​​​​​​参​​​​​​​考​​​​​​​《​​​​​​​配​​​​​​​置​​​​​​​和​​​​​​​管​​​​​​​理​​​​​​​红​​​​​​​帽​​​​​​​群​​​​​​​集​​​​​​​》​​​​​​​。​​​​​​​
  • 如​​​​​​​果​​​​​​​您​​​​​​​的​​​​​​​群​​​​​​​集​​​​​​​中​​​​​​​有​​​​​​​一​​​​​​​个​​​​​​​以​​​​​​​上​​​​​​​的​​​​​​​节​​​​​​​点​​​​​​​需​​​​​​​要​​​​​​​访​​​​​​​问​​​​​​​您​​​​​​​的​​​​​​​存​​​​​​​储​​​​​​​,那​​​​​​​么​​​​​​​该​​​​​​​存​​​​​​​储​​​​​​​会​​​​​​​在​​​​​​​所​​​​​​​有​​​​​​​活​​​​​​​跃​​​​​​​的​​​​​​​节​​​​​​​点​​​​​​​间​​​​​​​共​​​​​​​享​​​​​​​,则​​​​​​​您​​​​​​​必​​​​​​​须​​​​​​​使​​​​​​​用​​​​​​​ CLVM。​​​​​​​CLVM 允​​​​​​​许​​​​​​​用​​​​​​​户​​​​​​​通​​​​​​​过​​​​​​​在​​​​​​​配​​​​​​​置​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​时​​​​​​​锁​​​​​​​定​​​​​​​对​​​​​​​物​​​​​​​理​​​​​​​存​​​​​​​储​​​​​​​的​​​​​​​访​​​​​​​问​​​​​​​来​​​​​​​在​​​​​​​共​​​​​​​享​​​​​​​存​​​​​​​储​​​​​​​中​​​​​​​配​​​​​​​置​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​,并​​​​​​​使​​​​​​​用​​​​​​​群​​​​​​​集​​​​​​​的​​​​​​​锁​​​​​​​定​​​​​​​服​​​​​​​务​​​​​​​管​​​​​​​理​​​​​​​共​​​​​​​享​​​​​​​存​​​​​​​储​​​​​​​。​​​​​​​
要​​​​​​​使​​​​​​​用​​​​​​​ CLVM,则​​​​​​​必​​​​​​​须​​​​​​​运​​​​​​​行​​​​​​​红​​​​​​​帽​​​​​​​群​​​​​​​集​​​​​​​套​​​​​​​件​​​​​​​软​​​​​​​件​​​​​​​,其​​​​​​​中​​​​​​​包​​​​​​​括​​​​​​​ clmvd 守​​​​​​​护​​​​​​​进​​​​​​​程​​​​​​​。​​​​​​​clvmd 守​​​​​​​护​​​​​​​进​​​​​​​程​​​​​​​是​​​​​​​ LVM 的​​​​​​​关​​​​​​​键​​​​​​​群​​​​​​​集​​​​​​​扩​​​​​​​展​​​​​​​。​​​​​​​clvmd 在​​​​​​​每​​​​​​​个​​​​​​​群​​​​​​​集​​​​​​​计​​​​​​​算​​​​​​​机​​​​​​​中​​​​​​​运​​​​​​​行​​​​​​​,并​​​​​​​在​​​​​​​群​​​​​​​集​​​​​​​中​​​​​​​发​​​​​​​布​​​​​​​ LVM 元​​​​​​​数​​​​​​​据​​​​​​​更​​​​​​​新​​​​​​​,用​​​​​​​相​​​​​​​同​​​​​​​的​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​视​​​​​​​图​​​​​​​来​​​​​​​显​​​​​​​示​​​​​​​每​​​​​​​个​​​​​​​群​​​​​​​集​​​​​​​计​​​​​​​算​​​​​​​机​​​​​​​。​​​​​​​有​​​​​​​关​​​​​​​安​​​​​​​装​​​​​​​和​​​​​​​管​​​​​​​理​​​​​​​红​​​​​​​帽​​​​​​​群​​​​​​​集​​​​​​​套​​​​​​​件​​​​​​​的​​​​​​​详​​​​​​​情​​​​​​​请​​​​​​​参​​​​​​​考​​​​​​​《​​​​​​​配​​​​​​​置​​​​​​​和​​​​​​​管​​​​​​​理​​​​​​​红​​​​​​​帽​​​​​​​群​​​​​​​集​​​​​​​》​​​​​​​。​​​​​​​
要​​​​​​​确​​​​​​​定​​​​​​​在​​​​​​​引​​​​​​​导​​​​​​​时​​​​​​​启​​​​​​​动​​​​​​​了​​​​​​​ clmvd,您​​​​​​​可​​​​​​​对​​​​​​​ clmvd 服​​​​​​​务​​​​​​​执​​​​​​​行​​​​​​​ chkconfig ... on 命​​​​​​​令​​​​​​​,如​​​​​​​下​​​​​​​:
# chkconfig clvmd on
如​​​​​​​果​​​​​​​还​​​​​​​没​​​​​​​有​​​​​​​启​​​​​​​动​​​​​​​ clvmd 守​​​​​​​护​​​​​​​进​​​​​​​程​​​​​​​,您​​​​​​​可​​​​​​​以​​​​​​​对​​​​​​​ clvmd 服​​​​​​​务​​​​​​​执​​​​​​​行​​​​​​​ service ... start 命​​​​​​​令​​​​​​​,如​​​​​​​下​​​​​​​:
# service clvmd start
Creating LVM logical volumes in a cluster environment is identical to creating LVM logical volumes on a single node. There is no difference in the LVM commands themselves, or in the LVM graphical user interface, as described in 第 4 章 用​​​​​​​ CLI 命​​​​​​​令​​​​​​​管​​​​​​​理​​​​​​​ LVM and 第 7 章 用​​​​​​​ LVM GUI 进​​​​​​​行​​​​​​​ LVM 管​​​​​​​理​​​​​​​. In order to enable the LVM volumes you are creating in a cluster, the cluster infrastructure must be running and the cluster must be quorate.
By default, logical volumes created with CLVM on shared storage are visible to all computers that have access to the shared storage. It is possible, however, to create logical volumes when the storage devices are visible to only one node in the cluster. It is also possible to change the status of a logical volume from a local volume to a clustered volume. For information, see 第 4.3.2 节 “在​​​​​​​群​​​​​​​集​​​​​​​中​​​​​​​创​​​​​​​建​​​​​​​卷​​​​​​​组​​​​​​​” and 第 4.3.7 节 “修​​​​​​​改​​​​​​​卷​​​​​​​组​​​​​​​参​​​​​​​数​​​​​​​”.
图 1.2 “CLVM 总​​​​​​​览​​​​​​​” shows a CLVM overview in a Red Hat cluster.
CLVM 总​​​​​​​览​​​​​​​

图 1.2. CLVM 总​​​​​​​览​​​​​​​

注意

在​​​​​​​红​​​​​​​帽​​​​​​​群​​​​​​​集​​​​​​​套​​​​​​​件​​​​​​​中​​​​​​​使​​​​​​​用​​​​​​​的​​​​​​​共​​​​​​​享​​​​​​​存​​​​​​​储​​​​​​​要​​​​​​​求​​​​​​​您​​​​​​​要​​​​​​​运​​​​​​​行​​​​​​​群​​​​​​​集​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​管​​​​​​​理​​​​​​​器​​​​​​​守​​​​​​​护​​​​​​​进​​​​​​​程​​​​​​​(clvmd)或​​​​​​​者​​​​​​​高​​​​​​​可​​​​​​​用​​​​​​​性​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​管​​​​​​​理​​​​​​​代​​​​​​​理​​​​​​​(HA-LVM)。​​​​​​​如​​​​​​​果​​​​​​​您​​​​​​​有​​​​​​​与​​​​​​​操​​​​​​​作​​​​​​​原​​​​​​​因​​​​​​​或​​​​​​​者​​​​​​​您​​​​​​​没​​​​​​​有​​​​​​​正​​​​​​​确​​​​​​​的​​​​​​​权​​​​​​​利​​​​​​​而​​​​​​​无​​​​​​​法​​​​​​​使​​​​​​​用​​​​​​​ clvmd 守​​​​​​​护​​​​​​​进​​​​​​​程​​​​​​​或​​​​​​​者​​​​​​​ HA-LVM,您​​​​​​​就​​​​​​​不​​​​​​​能​​​​​​​在​​​​​​​共​​​​​​​享​​​​​​​磁​​​​​​​盘​​​​​​​中​​​​​​​使​​​​​​​用​​​​​​​单​​​​​​​一​​​​​​​事​​​​​​​件​​​​​​​ LVM,因​​​​​​​为​​​​​​​这​​​​​​​将​​​​​​​导​​​​​​​致​​​​​​​数​​​​​​​据​​​​​​​崩​​​​​​​溃​​​​​​​。​​​​​​​如​​​​​​​果​​​​​​​您​​​​​​​有​​​​​​​任​​​​​​​何​​​​​​​疑​​​​​​​问​​​​​​​请​​​​​​​与​​​​​​​您​​​​​​​的​​​​​​​红​​​​​​​帽​​​​​​​服​​​​​​​务​​​​​​​代​​​​​​​表​​​​​​​联​​​​​​​络​​​​​​​。​​​​​​​

注意

CLVM requires changes to the lvm.conf file for cluster-wide locking. Information on configuring the lvm.conf file to support clustered locking is provided within the lvm.conf file itself. For information about the lvm.conf file, see 附录 B, LVM 配​​​​​​​置​​​​​​​文​​​​​​​件​​​​​​​.

1.4. 文​​​​​​​档​​​​​​​总​​​​​​​览​​​​​​​

本​​​​​​​文​​​​​​​档​​​​​​​还​​​​​​​包​​​​​​​含​​​​​​​以​​​​​​​下​​​​​​​章​​​​​​​节​​​​​​​:

第 2 章 LVM 组​​​​​​​成​​​​​​​

本​​​​​​​章​​​​​​​论​​​​​​​述​​​​​​​了​​​​​​​ LVM 逻​​​​​​​辑​​​​​​​卷​​​​​​​的​​​​​​​组​​​​​​​成​​​​​​​。​​​​​​​

2.1. 物​​​​​​​理​​​​​​​卷​​​​​​​

LVM 逻​​​​​​​辑​​​​​​​卷​​​​​​​的​​​​​​​基​​​​​​​本​​​​​​​物​​​​​​​理​​​​​​​存​​​​​​​储​​​​​​​单​​​​​​​元​​​​​​​是​​​​​​​块​​​​​​​设​​​​​​​备​​​​​​​,比​​​​​​​如​​​​​​​分​​​​​​​区​​​​​​​或​​​​​​​者​​​​​​​整​​​​​​​个​​​​​​​磁​​​​​​​盘​​​​​​​。​​​​​​​这​​​​​​​个​​​​​​​设​​​​​​​备​​​​​​​是​​​​​​​作​​​​​​​为​​​​​​​ LVM 物​​​​​​​理​​​​​​​卷​​​​​​​(PV)进​​​​​​​行​​​​​​​初​​​​​​​始​​​​​​​化​​​​​​​的​​​​​​​。​​​​​​​将​​​​​​​块​​​​​​​设​​​​​​​备​​​​​​​作​​​​​​​为​​​​​​​物​​​​​​​理​​​​​​​卷​​​​​​​进​​​​​​​行​​​​​​​初​​​​​​​始​​​​​​​化​​​​​​​会​​​​​​​在​​​​​​​接​​​​​​​近​​​​​​​设​​​​​​​备​​​​​​​起​​​​​​​始​​​​​​​处​​​​​​​放​​​​​​​置​​​​​​​一​​​​​​​个​​​​​​​标​​​​​​​签​​​​​​​。​​​​​​​
默​​​​​​​认​​​​​​​情​​​​​​​况​​​​​​​下​​​​​​​,LVM 标​​​​​​​签​​​​​​​是​​​​​​​放​​​​​​​在​​​​​​​第​​​​​​​二​​​​​​​个​​​​​​​ 512 字​​​​​​​节​​​​​​​扇​​​​​​​区​​​​​​​。​​​​​​​您​​​​​​​可​​​​​​​以​​​​​​​将​​​​​​​标​​​​​​​签​​​​​​​放​​​​​​​在​​​​​​​最​​​​​​​开​​​​​​​始​​​​​​​的​​​​​​​四​​​​​​​个​​​​​​​扇​​​​​​​区​​​​​​​之​​​​​​​一​​​​​​​来​​​​​​​覆​​​​​​​盖​​​​​​​这​​​​​​​个​​​​​​​默​​​​​​​认​​​​​​​设​​​​​​​置​​​​​​​。​​​​​​​这​​​​​​​样​​​​​​​就​​​​​​​允​​​​​​​许​​​​​​​在​​​​​​​必​​​​​​​要​​​​​​​时​​​​​​​ LVM 卷​​​​​​​可​​​​​​​与​​​​​​​其​​​​​​​它​​​​​​​使​​​​​​​用​​​​​​​这​​​​​​​些​​​​​​​扇​​​​​​​区​​​​​​​的​​​​​​​用​​​​​​​户​​​​​​​共​​​​​​​同​​​​​​​存​​​​​​​在​​​​​​​。​​​​​​​
LVM 标​​​​​​​签​​​​​​​可​​​​​​​为​​​​​​​物​​​​​​​理​​​​​​​设​​​​​​​备​​​​​​​提​​​​​​​供​​​​​​​正​​​​​​​确​​​​​​​的​​​​​​​识​​​​​​​别​​​​​​​和​​​​​​​设​​​​​​​备​​​​​​​排​​​​​​​序​​​​​​​,因​​​​​​​为​​​​​​​在​​​​​​​引​​​​​​​导​​​​​​​系​​​​​​​统​​​​​​​时​​​​​​​,设​​​​​​​备​​​​​​​可​​​​​​​以​​​​​​​任​​​​​​​何​​​​​​​顺​​​​​​​序​​​​​​​出​​​​​​​现​​​​​​​。​​​​​​​LVM 标​​​​​​​记​​​​​​​在​​​​​​​重​​​​​​​新​​​​​​​引​​​​​​​导​​​​​​​和​​​​​​​整​​​​​​​个​​​​​​​群​​​​​​​集​​​​​​​中​​​​​​​保​​​​​​​持​​​​​​​不​​​​​​​变​​​​​​​。​​​​​​​
LVM 标​​​​​​​记​​​​​​​可​​​​​​​识​​​​​​​别​​​​​​​作​​​​​​​为​​​​​​​ LVM 物​​​​​​​理​​​​​​​卷​​​​​​​的​​​​​​​设​​​​​​​备​​​​​​​。​​​​​​​它​​​​​​​为​​​​​​​物​​​​​​​理​​​​​​​卷​​​​​​​包​​​​​​​含​​​​​​​一​​​​​​​个​​​​​​​随​​​​​​​机​​​​​​​特​​​​​​​定​​​​​​​识​​​​​​​别​​​​​​​符​​​​​​​号​​​​​​​(UUID)。​​​​​​​它​​​​​​​还​​​​​​​用​​​​​​​字​​​​​​​节​​​​​​​记​​​​​​​录​​​​​​​块​​​​​​​设​​​​​​​备​​​​​​​的​​​​​​​大​​​​​​​小​​​​​​​,并​​​​​​​记​​​​​​​录​​​​​​​ LVM 元​​​​​​​数​​​​​​​据​​​​​​​在​​​​​​​设​​​​​​​备​​​​​​​中​​​​​​​的​​​​​​​存​​​​​​​储​​​​​​​位​​​​​​​置​​​​​​​。​​​​​​​
LVM 元​​​​​​​数​​​​​​​据​​​​​​​包​​​​​​​含​​​​​​​您​​​​​​​的​​​​​​​系​​​​​​​统​​​​​​​中​​​​​​​ LVM 卷​​​​​​​组​​​​​​​的​​​​​​​配​​​​​​​置​​​​​​​详​​​​​​​情​​​​​​​。​​​​​​​在​​​​​​​默​​​​​​​认​​​​​​​情​​​​​​​况​​​​​​​下​​​​​​​,在​​​​​​​卷​​​​​​​组​​​​​​​中​​​​​​​的​​​​​​​每​​​​​​​个​​​​​​​物​​​​​​​理​​​​​​​卷​​​​​​​中​​​​​​​都​​​​​​​会​​​​​​​在​​​​​​​其​​​​​​​元​​​​​​​数​​​​​​​据​​​​​​​区​​​​​​​域​​​​​​​保​​​​​​​留​​​​​​​一​​​​​​​个​​​​​​​一​​​​​​​样​​​​​​​的​​​​​​​副​​​​​​​本​​​​​​​。​​​​​​​LVM 元​​​​​​​数​​​​​​​据​​​​​​​很​​​​​​​小​​​​​​​,并​​​​​​​可​​​​​​​以​​​​​​​ ASCII 格​​​​​​​式​​​​​​​保​​​​​​​存​​​​​​​。​​​​​​​
现​​​​​​​在​​​​​​​,LVM 允​​​​​​​许​​​​​​​您​​​​​​​在​​​​​​​每​​​​​​​个​​​​​​​物​​​​​​​理​​​​​​​卷​​​​​​​中​​​​​​​保​​​​​​​存​​​​​​​ 0、​​​​​​​1 或​​​​​​​者​​​​​​​ 2 个​​​​​​​元​​​​​​​数​​​​​​​据​​​​​​​副​​​​​​​本​​​​​​​。​​​​​​​默​​​​​​​认​​​​​​​是​​​​​​​保​​​​​​​存​​​​​​​一​​​​​​​个​​​​​​​副​​​​​​​本​​​​​​​。​​​​​​​一​​​​​​​旦​​​​​​​您​​​​​​​设​​​​​​​置​​​​​​​了​​​​​​​在​​​​​​​物​​​​​​​理​​​​​​​卷​​​​​​​中​​​​​​​保​​​​​​​存​​​​​​​的​​​​​​​元​​​​​​​数​​​​​​​据​​​​​​​备​​​​​​​份​​​​​​​数​​​​​​​目​​​​​​​之​​​​​​​后​​​​​​​就​​​​​​​无​​​​​​​法​​​​​​​再​​​​​​​更​​​​​​​改​​​​​​​了​​​​​​​。​​​​​​​第​​​​​​​一​​​​​​​个​​​​​​​副​​​​​​​本​​​​​​​保​​​​​​​存​​​​​​​在​​​​​​​设​​​​​​​备​​​​​​​的​​​​​​​起​​​​​​​始​​​​​​​位​​​​​​​置​​​​​​​,紧​​​​​​​挨​​​​​​​着​​​​​​​标​​​​​​​签​​​​​​​。​​​​​​​如​​​​​​​果​​​​​​​有​​​​​​​第​​​​​​​二​​​​​​​个​​​​​​​副​​​​​​​本​​​​​​​,会​​​​​​​将​​​​​​​其​​​​​​​放​​​​​​​在​​​​​​​设​​​​​​​备​​​​​​​的​​​​​​​末​​​​​​​尾​​​​​​​。​​​​​​​如​​​​​​​果​​​​​​​您​​​​​​​不​​​​​​​小​​​​​​​心​​​​​​​写​​​​​​​入​​​​​​​了​​​​​​​不​​​​​​​同​​​​​​​于​​​​​​​您​​​​​​​想​​​​​​​要​​​​​​​写​​​​​​​入​​​​​​​的​​​​​​​磁​​​​​​​盘​​​​​​​从​​​​​​​而​​​​​​​覆​​​​​​​盖​​​​​​​了​​​​​​​磁​​​​​​​盘​​​​​​​的​​​​​​​起​​​​​​​始​​​​​​​部​​​​​​​分​​​​​​​,那​​​​​​​么​​​​​​​您​​​​​​​可​​​​​​​以​​​​​​​使​​​​​​​用​​​​​​​在​​​​​​​设​​​​​​​备​​​​​​​末​​​​​​​尾​​​​​​​的​​​​​​​元​​​​​​​数​​​​​​​据​​​​​​​第​​​​​​​二​​​​​​​个​​​​​​​副​​​​​​​本​​​​​​​可​​​​​​​让​​​​​​​进​​​​​​​行​​​​​​​恢​​​​​​​复​​​​​​​。​​​​​​​
For detailed information about the LVM metadata and changing the metadata parameters, see 附录 D, LVM 卷​​​​​​​组​​​​​​​元​​​​​​​数​​​​​​​据​​​​​​​.

2.1.1. LVM Physical Volume Layout

图 2.1 “物​​​​​​​理​​​​​​​卷​​​​​​​布​​​​​​​局​​​​​​​” shows the layout of an LVM physical volume. The LVM label is on the second sector, followed by the metadata area, followed by the usable space on the device.

注意

在​​​​​​​ Linux 内​​​​​​​核​​​​​​​(在​​​​​​​整​​​​​​​个​​​​​​​文​​​​​​​档​​​​​​​中​​​​​​​),每​​​​​​​个​​​​​​​扇​​​​​​​区​​​​​​​的​​​​​​​大​​​​​​​小​​​​​​​为​​​​​​​ 512K。​​​​​​​
物​​​​​​​理​​​​​​​卷​​​​​​​布​​​​​​​局​​​​​​​

图 2.1. 物​​​​​​​理​​​​​​​卷​​​​​​​布​​​​​​​局​​​​​​​

2.1.2. 一​​​​​​​个​​​​​​​磁​​​​​​​盘​​​​​​​中​​​​​​​有​​​​​​​多​​​​​​​个​​​​​​​分​​​​​​​区​​​​​​​

LVM 允​​​​​​​许​​​​​​​您​​​​​​​在​​​​​​​磁​​​​​​​盘​​​​​​​分​​​​​​​区​​​​​​​外​​​​​​​创​​​​​​​建​​​​​​​物​​​​​​​理​​​​​​​卷​​​​​​​。​​​​​​​通​​​​​​​常​​​​​​​建​​​​​​​议​​​​​​​您​​​​​​​创​​​​​​​建​​​​​​​可​​​​​​​覆​​​​​​​盖​​​​​​​整​​​​​​​个​​​​​​​磁​​​​​​​盘​​​​​​​的​​​​​​​单​​​​​​​一​​​​​​​分​​​​​​​区​​​​​​​,并​​​​​​​将​​​​​​​其​​​​​​​标​​​​​​​记​​​​​​​为​​​​​​​ LVM 物​​​​​​​理​​​​​​​卷​​​​​​​,理​​​​​​​由​​​​​​​如​​​​​​​下​​​​​​​:
  • 方​​​​​​​便​​​​​​​管​​​​​​​理​​​​​​​
    如​​​​​​​果​​​​​​​每​​​​​​​个​​​​​​​正​​​​​​​真​​​​​​​的​​​​​​​磁​​​​​​​盘​​​​​​​只​​​​​​​出​​​​​​​现​​​​​​​一​​​​​​​次​​​​​​​会​​​​​​​比​​​​​​​较​​​​​​​容​​​​​​​易​​​​​​​在​​​​​​​系​​​​​​​统​​​​​​​中​​​​​​​追​​​​​​​踪​​​​​​​硬​​​​​​​件​​​​​​​,这​​​​​​​在​​​​​​​磁​​​​​​​盘​​​​​​​失​​​​​​​败​​​​​​​时​​​​​​​尤​​​​​​​为​​​​​​​突​​​​​​​出​​​​​​​。​​​​​​​另​​​​​​​外​​​​​​​,单​​​​​​​一​​​​​​​磁​​​​​​​盘​​​​​​​中​​​​​​​有​​​​​​​多​​​​​​​个​​​​​​​物​​​​​​​理​​​​​​​卷​​​​​​​可​​​​​​​导​​​​​​​致​​​​​​​内​​​​​​​核​​​​​​​在​​​​​​​引​​​​​​​导​​​​​​​时​​​​​​​发​​​​​​​出​​​​​​​未​​​​​​​知​​​​​​​分​​​​​​​区​​​​​​​类​​​​​​​型​​​​​​​警​​​​​​​告​​​​​​​。​​​​​​​
  • 条​​​​​​​带​​​​​​​性​​​​​​​能​​​​​​​
    LVM 无​​​​​​​法​​​​​​​告​​​​​​​知​​​​​​​两​​​​​​​个​​​​​​​物​​​​​​​理​​​​​​​卷​​​​​​​在​​​​​​​同​​​​​​​一​​​​​​​个​​​​​​​物​​​​​​​理​​​​​​​磁​​​​​​​盘​​​​​​​中​​​​​​​。​​​​​​​如​​​​​​​果​​​​​​​您​​​​​​​在​​​​​​​两​​​​​​​个​​​​​​​物​​​​​​​理​​​​​​​卷​​​​​​​在​​​​​​​同​​​​​​​一​​​​​​​个​​​​​​​物​​​​​​​理​​​​​​​磁​​​​​​​盘​​​​​​​的​​​​​​​情​​​​​​​况​​​​​​​下​​​​​​​创​​​​​​​建​​​​​​​了​​​​​​​条​​​​​​​状​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​,那​​​​​​​么​​​​​​​条​​​​​​​带​​​​​​​就​​​​​​​可​​​​​​​能​​​​​​​在​​​​​​​同​​​​​​​一​​​​​​​磁​​​​​​​盘​​​​​​​的​​​​​​​不​​​​​​​同​​​​​​​分​​​​​​​区​​​​​​​中​​​​​​​。​​​​​​​这​​​​​​​可​​​​​​​能​​​​​​​会​​​​​​​降​​​​​​​低​​​​​​​它​​​​​​​的​​​​​​​性​​​​​​​能​​​​​​​而​​​​​​​不​​​​​​​是​​​​​​​提​​​​​​​高​​​​​​​其​​​​​​​性​​​​​​​能​​​​​​​。​​​​​​​
尽​​​​​​​管​​​​​​​不​​​​​​​建​​​​​​​议​​​​​​​您​​​​​​​这​​​​​​​样​​​​​​​做​​​​​​​,但​​​​​​​在​​​​​​​特​​​​​​​别​​​​​​​的​​​​​​​情​​​​​​​况​​​​​​​下​​​​​​​可​​​​​​​能​​​​​​​需​​​​​​​要​​​​​​​您​​​​​​​将​​​​​​​一​​​​​​​个​​​​​​​磁​​​​​​​盘​​​​​​​分​​​​​​​成​​​​​​​独​​​​​​​立​​​​​​​的​​​​​​​ LVM 物​​​​​​​理​​​​​​​卷​​​​​​​。​​​​​​​例​​​​​​​如​​​​​​​:在​​​​​​​有​​​​​​​多​​​​​​​个​​​​​​​磁​​​​​​​盘​​​​​​​的​​​​​​​系​​​​​​​统​​​​​​​中​​​​​​​,当​​​​​​​您​​​​​​​从​​​​​​​现​​​​​​​有​​​​​​​系​​​​​​​统​​​​​​​迁​​​​​​​移​​​​​​​到​​​​​​​ LVM 卷​​​​​​​的​​​​​​​时​​​​​​​候​​​​​​​,可​​​​​​​能​​​​​​​需​​​​​​​要​​​​​​​将​​​​​​​数​​​​​​​据​​​​​​​在​​​​​​​分​​​​​​​区​​​​​​​间​​​​​​​转​​​​​​​移​​​​​​​。​​​​​​​另​​​​​​​外​​​​​​​,如​​​​​​​果​​​​​​​您​​​​​​​有​​​​​​​一​​​​​​​个​​​​​​​很​​​​​​​大​​​​​​​的​​​​​​​磁​​​​​​​盘​​​​​​​,并​​​​​​​且​​​​​​​因​​​​​​​为​​​​​​​管​​​​​​​理​​​​​​​的​​​​​​​原​​​​​​​因​​​​​​​想​​​​​​​要​​​​​​​有​​​​​​​超​​​​​​​过​​​​​​​一​​​​​​​个​​​​​​​卷​​​​​​​组​​​​​​​,那​​​​​​​么​​​​​​​对​​​​​​​磁​​​​​​​盘​​​​​​​进​​​​​​​行​​​​​​​分​​​​​​​区​​​​​​​是​​​​​​​很​​​​​​​必​​​​​​​要​​​​​​​的​​​​​​​。​​​​​​​如​​​​​​​果​​​​​​​您​​​​​​​的​​​​​​​磁​​​​​​​盘​​​​​​​分​​​​​​​区​​​​​​​数​​​​​​​大​​​​​​​于​​​​​​​ 1,且​​​​​​​属​​​​​​​于​​​​​​​同​​​​​​​一​​​​​​​卷​​​​​​​组​​​​​​​,请​​​​​​​在​​​​​​​创​​​​​​​建​​​​​​​条​​​​​​​状​​​​​​​卷​​​​​​​的​​​​​​​时​​​​​​​候​​​​​​​小​​​​​​​心​​​​​​​指​​​​​​​定​​​​​​​哪​​​​​​​些​​​​​​​分​​​​​​​区​​​​​​​是​​​​​​​应​​​​​​​该​​​​​​​包​​​​​​​括​​​​​​​在​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​中​​​​​​​的​​​​​​​。​​​​​​​

2.2. 卷​​​​​​​组​​​​​​​

物​​​​​​​理​​​​​​​卷​​​​​​​合​​​​​​​并​​​​​​​为​​​​​​​卷​​​​​​​组​​​​​​​(VG)。​​​​​​​这​​​​​​​样​​​​​​​就​​​​​​​创​​​​​​​建​​​​​​​了​​​​​​​一​​​​​​​个​​​​​​​磁​​​​​​​盘​​​​​​​空​​​​​​​间​​​​​​​池​​​​​​​,在​​​​​​​它​​​​​​​之​​​​​​​外​​​​​​​可​​​​​​​分​​​​​​​配​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​。​​​​​​​
在​​​​​​​卷​​​​​​​组​​​​​​​中​​​​​​​,可​​​​​​​用​​​​​​​于​​​​​​​分​​​​​​​配​​​​​​​的​​​​​​​磁​​​​​​​盘​​​​​​​空​​​​​​​间​​​​​​​被​​​​​​​分​​​​​​​成​​​​​​​固​​​​​​​定​​​​​​​大​​​​​​​小​​​​​​​的​​​​​​​单​​​​​​​元​​​​​​​,我​​​​​​​们​​​​​​​称​​​​​​​之​​​​​​​为​​​​​​​扩​​​​​​​展​​​​​​​。​​​​​​​一​​​​​​​个​​​​​​​扩​​​​​​​展​​​​​​​就​​​​​​​是​​​​​​​可​​​​​​​被​​​​​​​分​​​​​​​配​​​​​​​的​​​​​​​最​​​​​​​小​​​​​​​单​​​​​​​位​​​​​​​。​​​​​​​在​​​​​​​物​​​​​​​理​​​​​​​卷​​​​​​​中​​​​​​​,扩​​​​​​​展​​​​​​​就​​​​​​​是​​​​​​​物​​​​​​​理​​​​​​​扩​​​​​​​展​​​​​​​。​​​​​​​
逻​​​​​​​辑​​​​​​​卷​​​​​​​会​​​​​​​被​​​​​​​分​​​​​​​配​​​​​​​成​​​​​​​与​​​​​​​物​​​​​​​理​​​​​​​卷​​​​​​​扩​​​​​​​展​​​​​​​相​​​​​​​同​​​​​​​大​​​​​​​小​​​​​​​的​​​​​​​逻​​​​​​​辑​​​​​​​扩​​​​​​​展​​​​​​​。​​​​​​​因​​​​​​​此​​​​​​​卷​​​​​​​组​​​​​​​中​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​的​​​​​​​扩​​​​​​​展​​​​​​​大​​​​​​​小​​​​​​​都​​​​​​​是​​​​​​​一​​​​​​​样​​​​​​​的​​​​​​​。​​​​​​​卷​​​​​​​组​​​​​​​将​​​​​​​逻​​​​​​​辑​​​​​​​扩​​​​​​​展​​​​​​​与​​​​​​​物​​​​​​​理​​​​​​​扩​​​​​​​展​​​​​​​匹​​​​​​​配​​​​​​​。​​​​​​​

2.3. LVM 逻​​​​​​​辑​​​​​​​卷​​​​​​​

在​​​​​​​ LVM 中​​​​​​​,卷​​​​​​​组​​​​​​​会​​​​​​​被​​​​​​​分​​​​​​​成​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​。​​​​​​​LVM 逻​​​​​​​辑​​​​​​​卷​​​​​​​有​​​​​​​三​​​​​​​种​​​​​​​类​​​​​​​型​​​​​​​:线​​​​​​​性​​​​​​​卷​​​​​​​、​​​​​​​条​​​​​​​状​​​​​​​卷​​​​​​​和​​​​​​​镜​​​​​​​像​​​​​​​卷​​​​​​​。​​​​​​​这​​​​​​​些​​​​​​​在​​​​​​​以​​​​​​​后​​​​​​​的​​​​​​​内​​​​​​​容​​​​​​​中​​​​​​​都​​​​​​​有​​​​​​​论​​​​​​​述​​​​​​​。​​​​​​​

2.3.1. 线​​​​​​​性​​​​​​​卷​​​​​​​

一​​​​​​​个​​​​​​​线​​​​​​​性​​​​​​​卷​​​​​​​可​​​​​​​将​​​​​​​多​​​​​​​个​​​​​​​物​​​​​​​理​​​​​​​卷​​​​​​​集​​​​​​​合​​​​​​​到​​​​​​​一​​​​​​​个​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​中​​​​​​​。​​​​​​​例​​​​​​​如​​​​​​​:如​​​​​​​果​​​​​​​您​​​​​​​有​​​​​​​两​​​​​​​个​​​​​​​ 60GB 的​​​​​​​磁​​​​​​​盘​​​​​​​,您​​​​​​​可​​​​​​​以​​​​​​​创​​​​​​​建​​​​​​​一​​​​​​​个​​​​​​​ 120GB 的​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​。​​​​​​​物​​​​​​​理​​​​​​​存​​​​​​​储​​​​​​​是​​​​​​​连​​​​​​​在​​​​​​​一​​​​​​​起​​​​​​​的​​​​​​​。​​​​​​​
Creating a linear volume assigns a range of physical extents to an area of a logical volume in order. For example, as shown in 图 2.2 “扩​​​​​​​展​​​​​​​映​​​​​​​射​​​​​​​” logical extents 1 to 99 could map to one physical volume and logical extents 100 to 198 could map to a second physical volume. From the point of view of the application, there is one device that is 198 extents in size.
扩​​​​​​​展​​​​​​​映​​​​​​​射​​​​​​​

图 2.2. 扩​​​​​​​展​​​​​​​映​​​​​​​射​​​​​​​

The physical volumes that make up a logical volume do not have to be the same size. 图 2.3 “物​​​​​​​理​​​​​​​卷​​​​​​​大​​​​​​​小​​​​​​​不​​​​​​​同​​​​​​​的​​​​​​​线​​​​​​​性​​​​​​​卷​​​​​​​” shows volume group VG1 with a physical extent size of 4MB. This volume group includes 2 physical volumes named PV1 and PV2. The physical volumes are divided into 4MB units, since that is the extent size. In this example, PV1 is 100 extents in size (400MB) and PV2 is 200 extents in size (800MB). You can create a linear volume any size between 1 and 300 extents (4MB to 1200MB). In this example, the linear volume named LV1 is 300 extents in size.
物​​​​​​​理​​​​​​​卷​​​​​​​大​​​​​​​小​​​​​​​不​​​​​​​同​​​​​​​的​​​​​​​线​​​​​​​性​​​​​​​卷​​​​​​​

图 2.3. 物​​​​​​​理​​​​​​​卷​​​​​​​大​​​​​​​小​​​​​​​不​​​​​​​同​​​​​​​的​​​​​​​线​​​​​​​性​​​​​​​卷​​​​​​​

You can configure more than one linear logical volume of whatever size you desire from the pool of physical extents. 图 2.4 “多​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​” shows the same volume group as in 图 2.3 “物​​​​​​​理​​​​​​​卷​​​​​​​大​​​​​​​小​​​​​​​不​​​​​​​同​​​​​​​的​​​​​​​线​​​​​​​性​​​​​​​卷​​​​​​​”, but in this case two logical volumes have been carved out of the volume group: LV1, which is 250 extents in size (1000MB) and LV2 which is 50 extents in size (200MB).
多​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​

图 2.4. 多​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​

2.3.2. 条​​​​​​​状​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​

当​​​​​​​您​​​​​​​向​​​​​​​ LVM 逻​​​​​​​辑​​​​​​​卷​​​​​​​写​​​​​​​入​​​​​​​数​​​​​​​据​​​​​​​时​​​​​​​,文​​​​​​​件​​​​​​​系​​​​​​​统​​​​​​​在​​​​​​​基​​​​​​​本​​​​​​​物​​​​​​​理​​​​​​​卷​​​​​​​之​​​​​​​间​​​​​​​部​​​​​​​署​​​​​​​数​​​​​​​据​​​​​​​。​​​​​​​您​​​​​​​可​​​​​​​以​​​​​​​通​​​​​​​过​​​​​​​创​​​​​​​建​​​​​​​条​​​​​​​状​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​控​​​​​​​制​​​​​​​数​​​​​​​据​​​​​​​向​​​​​​​物​​​​​​​理​​​​​​​卷​​​​​​​写​​​​​​​入​​​​​​​的​​​​​​​方​​​​​​​法​​​​​​​。​​​​​​​对​​​​​​​于​​​​​​​大​​​​​​​批​​​​​​​量​​​​​​​的​​​​​​​读​​​​​​​取​​​​​​​和​​​​​​​写​​​​​​​入​​​​​​​,这​​​​​​​样​​​​​​​可​​​​​​​以​​​​​​​提​​​​​​​高​​​​​​​数​​​​​​​据​​​​​​​输​​​​​​​入​​​​​​​/输​​​​​​​出​​​​​​​的​​​​​​​效​​​​​​​率​​​​​​​。​​​​​​​
条​​​​​​​带​​​​​​​化​​​​​​​数​​​​​​​据​​​​​​​可​​​​​​​通​​​​​​​过​​​​​​​以​​​​​​​ round-round 模​​​​​​​式​​​​​​​向​​​​​​​预​​​​​​​定​​​​​​​数​​​​​​​目​​​​​​​的​​​​​​​物​​​​​​​理​​​​​​​卷​​​​​​​写​​​​​​​入​​​​​​​数​​​​​​​据​​​​​​​来​​​​​​​提​​​​​​​高​​​​​​​性​​​​​​​能​​​​​​​。​​​​​​​使​​​​​​​用​​​​​​​条​​​​​​​带​​​​​​​模​​​​​​​式​​​​​​​,I/O 可​​​​​​​以​​​​​​​平​​​​​​​行​​​​​​​执​​​​​​​行​​​​​​​。​​​​​​​在​​​​​​​有​​​​​​​些​​​​​​​情​​​​​​​况​​​​​​​下​​​​​​​,这​​​​​​​样​​​​​​​可​​​​​​​以​​​​​​​使​​​​​​​条​​​​​​​带​​​​​​​中​​​​​​​每​​​​​​​个​​​​​​​附​​​​​​​加​​​​​​​的​​​​​​​物​​​​​​​理​​​​​​​卷​​​​​​​获​​​​​​​得​​​​​​​类​​​​​​​似​​​​​​​线​​​​​​​性​​​​​​​卷​​​​​​​的​​​​​​​性​​​​​​​能​​​​​​​。​​​​​​​
以​​​​​​​下​​​​​​​示​​​​​​​例​​​​​​​显​​​​​​​示​​​​​​​数​​​​​​​据​​​​​​​在​​​​​​​三​​​​​​​个​​​​​​​物​​​​​​​理​​​​​​​卷​​​​​​​之​​​​​​​间​​​​​​​进​​​​​​​行​​​​​​​条​​​​​​​状​​​​​​​分​​​​​​​布​​​​​​​。​​​​​​​在​​​​​​​这​​​​​​​个​​​​​​​图​​​​​​​表​​​​​​​中​​​​​​​:
  • 数​​​​​​​据​​​​​​​的​​​​​​​第​​​​​​​一​​​​​​​条​​​​​​​写​​​​​​​入​​​​​​​ PV1
  • 数​​​​​​​据​​​​​​​的​​​​​​​第​​​​​​​二​​​​​​​条​​​​​​​写​​​​​​​入​​​​​​​ PV2
  • 数​​​​​​​据​​​​​​​的​​​​​​​第​​​​​​​三​​​​​​​条​​​​​​​写​​​​​​​入​​​​​​​ PV3
  • 数​​​​​​​据​​​​​​​的​​​​​​​第​​​​​​​四​​​​​​​条​​​​​​​写​​​​​​​入​​​​​​​ PV1
在​​​​​​​条​​​​​​​状​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​中​​​​​​​,条​​​​​​​的​​​​​​​大​​​​​​​小​​​​​​​不​​​​​​​能​​​​​​​超​​​​​​​过​​​​​​​扩​​​​​​​展​​​​​​​的​​​​​​​大​​​​​​​小​​​​​​​。​​​​​​​
在​​​​​​​三​​​​​​​个​​​​​​​ PV 中​​​​​​​条​​​​​​​状​​​​​​​分​​​​​​​配​​​​​​​数​​​​​​​据​​​​​​​

图 2.5. 在​​​​​​​三​​​​​​​个​​​​​​​ PV 中​​​​​​​条​​​​​​​状​​​​​​​分​​​​​​​配​​​​​​​数​​​​​​​据​​​​​​​

Striped logical volumes can be extended by concatenating another set of devices onto the end of the first set. In order extend a striped logical volume, however, there must be enough free space on the underlying physical volumes that make up the volume group to support the stripe. For example, if you have a two-way stripe that uses up an entire volume group, adding a single physical volume to the volume group will not enable you to extend the stripe. Instead, you must add at least two physical volumes to the volume group. For more information on extending a striped volume, see 第 4.4.9 节 “扩​​​​​​​展​​​​​​​条​​​​​​​状​​​​​​​卷​​​​​​​”.

2.3.3. 镜​​​​​​​像​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​

镜​​​​​​​像​​​​​​​维​​​​​​​护​​​​​​​不​​​​​​​同​​​​​​​设​​​​​​​备​​​​​​​中​​​​​​​的​​​​​​​相​​​​​​​同​​​​​​​的​​​​​​​副​​​​​​​本​​​​​​​。​​​​​​​当​​​​​​​向​​​​​​​一​​​​​​​个​​​​​​​设​​​​​​​备​​​​​​​中​​​​​​​写​​​​​​​入​​​​​​​数​​​​​​​据​​​​​​​时​​​​​​​,也​​​​​​​会​​​​​​​向​​​​​​​第​​​​​​​二​​​​​​​个​​​​​​​设​​​​​​​备​​​​​​​中​​​​​​​写​​​​​​​入​​​​​​​,即​​​​​​​镜​​​​​​​像​​​​​​​保​​​​​​​存​​​​​​​数​​​​​​​据​​​​​​​。​​​​​​​这​​​​​​​提​​​​​​​供​​​​​​​了​​​​​​​在​​​​​​​设​​​​​​​备​​​​​​​失​​​​​​​败​​​​​​​时​​​​​​​的​​​​​​​数​​​​​​​据​​​​​​​保​​​​​​​护​​​​​​​。​​​​​​​当​​​​​​​镜​​​​​​​像​​​​​​​的​​​​​​​一​​​​​​​个​​​​​​​分​​​​​​​支​​​​​​​失​​​​​​​败​​​​​​​时​​​​​​​,逻​​​​​​​辑​​​​​​​卷​​​​​​​就​​​​​​​成​​​​​​​为​​​​​​​一​​​​​​​个​​​​​​​线​​​​​​​性​​​​​​​卷​​​​​​​,仍​​​​​​​然​​​​​​​可​​​​​​​访​​​​​​​问​​​​​​​。​​​​​​​
LVM 支​​​​​​​持​​​​​​​镜​​​​​​​像​​​​​​​卷​​​​​​​。​​​​​​​当​​​​​​​您​​​​​​​创​​​​​​​建​​​​​​​了​​​​​​​一​​​​​​​个​​​​​​​镜​​​​​​​像​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​时​​​​​​​,LVM 确​​​​​​​定​​​​​​​写​​​​​​​入​​​​​​​基​​​​​​​本​​​​​​​物​​​​​​​理​​​​​​​卷​​​​​​​的​​​​​​​数​​​​​​​据​​​​​​​被​​​​​​​镜​​​​​​​像​​​​​​​保​​​​​​​存​​​​​​​到​​​​​​​一​​​​​​​个​​​​​​​独​​​​​​​立​​​​​​​的​​​​​​​物​​​​​​​理​​​​​​​卷​​​​​​​中​​​​​​​。​​​​​​​使​​​​​​​用​​​​​​​ LVM,您​​​​​​​可​​​​​​​以​​​​​​​创​​​​​​​建​​​​​​​有​​​​​​​多​​​​​​​个​​​​​​​镜​​​​​​​像​​​​​​​的​​​​​​​镜​​​​​​​像​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​。​​​​​​​
LVM 镜​​​​​​​像​​​​​​​一​​​​​​​般​​​​​​​以​​​​​​​ 512KB 为​​​​​​​单​​​​​​​位​​​​​​​分​​​​​​​割​​​​​​​要​​​​​​​复​​​​​​​制​​​​​​​到​​​​​​​区​​​​​​​域​​​​​​​中​​​​​​​的​​​​​​​设​​​​​​​备​​​​​​​。​​​​​​​LVM 维​​​​​​​护​​​​​​​一​​​​​​​个​​​​​​​小​​​​​​​的​​​​​​​日​​​​​​​志​​​​​​​,可​​​​​​​用​​​​​​​来​​​​​​​追​​​​​​​踪​​​​​​​哪​​​​​​​些​​​​​​​区​​​​​​​域​​​​​​​是​​​​​​​和​​​​​​​镜​​​​​​​像​​​​​​​同​​​​​​​步​​​​​​​的​​​​​​​。​​​​​​​默​​​​​​​认​​​​​​​情​​​​​​​况​​​​​​​下​​​​​​​,该​​​​​​​日​​​​​​​志​​​​​​​是​​​​​​​保​​​​​​​存​​​​​​​在​​​​​​​磁​​​​​​​盘​​​​​​​中​​​​​​​的​​​​​​​,这​​​​​​​样​​​​​​​可​​​​​​​以​​​​​​​使​​​​​​​它​​​​​​​在​​​​​​​机​​​​​​​器​​​​​​​重​​​​​​​启​​​​​​​后​​​​​​​得​​​​​​​以​​​​​​​保​​​​​​​存​​​​​​​,也​​​​​​​可​​​​​​​在​​​​​​​内​​​​​​​存​​​​​​​中​​​​​​​维​​​​​​​护​​​​​​​此​​​​​​​日​​​​​​​志​​​​​​​。​​​​​​​
图 2.6 “Mirrored Logical Volume” shows a mirrored logical volume with one mirror. In this configuration, the log is maintained on disk.
Mirrored Logical Volume

图 2.6. Mirrored Logical Volume

注意

在​​​​​​​ RHEL 5.3 发​​​​​​​行​​​​​​​本​​​​​​​在​​​​​​​群​​​​​​​集​​​​​​​中​​​​​​​还​​​​​​​不​​​​​​​支​​​​​​​持​​​​​​​镜​​​​​​​像​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​。​​​​​​​

2.3.4. 快​​​​​​​照​​​​​​​卷​​​​​​​

LVM 的​​​​​​​快​​​​​​​照​​​​​​​性​​​​​​​能​​​​​​​为​​​​​​​您​​​​​​​提​​​​​​​供​​​​​​​了​​​​​​​在​​​​​​​某​​​​​​​个​​​​​​​特​​​​​​​定​​​​​​​时​​​​​​​刻​​​​​​​,在​​​​​​​不​​​​​​​导​​​​​​​致​​​​​​​服​​​​​​​务​​​​​​​中​​​​​​​断​​​​​​​的​​​​​​​情​​​​​​​况​​​​​​​下​​​​​​​创​​​​​​​建​​​​​​​设​​​​​​​备​​​​​​​的​​​​​​​虚​​​​​​​拟​​​​​​​映​​​​​​​射​​​​​​​可​​​​​​​能​​​​​​​性​​​​​​​。​​​​​​​在​​​​​​​提​​​​​​​取​​​​​​​快​​​​​​​照​​​​​​​后​​​​​​​,当​​​​​​​对​​​​​​​原​​​​​​​始​​​​​​​设​​​​​​​备​​​​​​​进​​​​​​​行​​​​​​​修​​​​​​​改​​​​​​​时​​​​​​​,快​​​​​​​照​​​​​​​特​​​​​​​性​​​​​​​会​​​​​​​和​​​​​​​在​​​​​​​修​​​​​​​改​​​​​​​前​​​​​​​提​​​​​​​取​​​​​​​快​​​​​​​照​​​​​​​一​​​​​​​样​​​​​​​提​​​​​​​供​​​​​​​一​​​​​​​个​​​​​​​修​​​​​​​改​​​​​​​了​​​​​​​的​​​​​​​数​​​​​​​据​​​​​​​区​​​​​​​域​​​​​​​的​​​​​​​副​​​​​​​本​​​​​​​,以​​​​​​​便​​​​​​​重​​​​​​​建​​​​​​​设​​​​​​​备​​​​​​​的​​​​​​​状​​​​​​​态​​​​​​​。​​​​​​​

注意

在​​​​​​​群​​​​​​​集​​​​​​​中​​​​​​​不​​​​​​​支​​​​​​​持​​​​​​​跨​​​​​​​节​​​​​​​点​​​​​​​的​​​​​​​ LVM 快​​​​​​​照​​​​​​​。​​​​​​​
Because a snapshot copies only the data areas that change after the snapshot is created, the snapshot feature requires a minimal amount of storage. For example, with a rarely updated origin, 3-5 % of the origin's capacity is sufficient to maintain the snapshot.

注意

文​​​​​​​件​​​​​​​系​​​​​​​统​​​​​​​的​​​​​​​快​​​​​​​照​​​​​​​副​​​​​​​本​​​​​​​是​​​​​​​虚​​​​​​​拟​​​​​​​副​​​​​​​本​​​​​​​,不​​​​​​​是​​​​​​​文​​​​​​​件​​​​​​​系​​​​​​​统​​​​​​​的​​​​​​​真​​​​​​​实​​​​​​​介​​​​​​​质​​​​​​​备​​​​​​​份​​​​​​​。​​​​​​​快​​​​​​​照​​​​​​​不​​​​​​​是​​​​​​​备​​​​​​​份​​​​​​​过​​​​​​​程​​​​​​​的​​​​​​​替​​​​​​​代​​​​​​​行​​​​​​​为​​​​​​​。​​​​​​​
如​​​​​​​果​​​​​​​快​​​​​​​照​​​​​​​已​​​​​​​满​​​​​​​,那​​​​​​​么​​​​​​​就​​​​​​​会​​​​​​​停​​​​​​​止​​​​​​​提​​​​​​​取​​​​​​​快​​​​​​​照​​​​​​​,因​​​​​​​此​​​​​​​需​​​​​​​要​​​​​​​确​​​​​​​定​​​​​​​源​​​​​​​文​​​​​​​件​​​​​​​系​​​​​​​统​​​​​​​有​​​​​​​足​​​​​​​够​​​​​​​的​​​​​​​空​​​​​​​间​​​​​​​。​​​​​​​您​​​​​​​可​​​​​​​以​​​​​​​常​​​​​​​规​​​​​​​监​​​​​​​控​​​​​​​快​​​​​​​照​​​​​​​的​​​​​​​大​​​​​​​小​​​​​​​。​​​​​​​快​​​​​​​照​​​​​​​是​​​​​​​可​​​​​​​以​​​​​​​重​​​​​​​新​​​​​​​设​​​​​​​定​​​​​​​大​​​​​​​小​​​​​​​的​​​​​​​,因​​​​​​​此​​​​​​​如​​​​​​​果​​​​​​​您​​​​​​​有​​​​​​​额​​​​​​​外​​​​​​​的​​​​​​​存​​​​​​​储​​​​​​​容​​​​​​​量​​​​​​​,您​​​​​​​可​​​​​​​以​​​​​​​增​​​​​​​大​​​​​​​快​​​​​​​照​​​​​​​卷​​​​​​​容​​​​​​​量​​​​​​​以​​​​​​​避​​​​​​​免​​​​​​​漏​​​​​​​掉​​​​​​​快​​​​​​​照​​​​​​​。​​​​​​​相​​​​​​​反​​​​​​​,如​​​​​​​果​​​​​​​您​​​​​​​发​​​​​​​现​​​​​​​快​​​​​​​照​​​​​​​卷​​​​​​​超​​​​​​​过​​​​​​​您​​​​​​​的​​​​​​​需​​​​​​​要​​​​​​​,您​​​​​​​可​​​​​​​以​​​​​​​减​​​​​​​小​​​​​​​它​​​​​​​来​​​​​​​为​​​​​​​其​​​​​​​它​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​最​​​​​​​大​​​​​​​限​​​​​​​度​​​​​​​释​​​​​​​放​​​​​​​空​​​​​​​间​​​​​​​。​​​​​​​
当​​​​​​​您​​​​​​​创​​​​​​​建​​​​​​​文​​​​​​​件​​​​​​​系​​​​​​​统​​​​​​​的​​​​​​​快​​​​​​​照​​​​​​​时​​​​​​​,仍​​​​​​​可​​​​​​​能​​​​​​​对​​​​​​​源​​​​​​​系​​​​​​​统​​​​​​​有​​​​​​​完​​​​​​​全​​​​​​​的​​​​​​​读​​​​​​​和​​​​​​​写​​​​​​​访​​​​​​​问​​​​​​​。​​​​​​​如​​​​​​​果​​​​​​​快​​​​​​​照​​​​​​​中​​​​​​​的​​​​​​​一​​​​​​​个​​​​​​​块​​​​​​​修​​​​​​​改​​​​​​​了​​​​​​​,那​​​​​​​么​​​​​​​就​​​​​​​会​​​​​​​标​​​​​​​记​​​​​​​出​​​​​​​那​​​​​​​个​​​​​​​块​​​​​​​,并​​​​​​​再​​​​​​​不​​​​​​​从​​​​​​​原​​​​​​​始​​​​​​​卷​​​​​​​中​​​​​​​复​​​​​​​制​​​​​​​这​​​​​​​个​​​​​​​块​​​​​​​。​​​​​​​
快​​​​​​​照​​​​​​​特​​​​​​​性​​​​​​​有​​​​​​​几​​​​​​​个​​​​​​​用​​​​​​​途​​​​​​​:
  • 最​​​​​​​典​​​​​​​型​​​​​​​的​​​​​​​就​​​​​​​是​​​​​​​,当​​​​​​​您​​​​​​​需​​​​​​​要​​​​​​​在​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​中​​​​​​​在​​​​​​​不​​​​​​​影​​​​​​​响​​​​​​​运​​​​​​​行​​​​​​​系​​​​​​​统​​​​​​​连​​​​​​​续​​​​​​​性​​​​​​​的​​​​​​​情​​​​​​​况​​​​​​​下​​​​​​​执​​​​​​​行​​​​​​​备​​​​​​​份​​​​​​​操​​​​​​​作​​​​​​​时​​​​​​​可​​​​​​​提​​​​​​​取​​​​​​​一​​​​​​​个​​​​​​​快​​​​​​​照​​​​​​​,这​​​​​​​样​​​​​​​可​​​​​​​以​​​​​​​持​​​​​​​续​​​​​​​地​​​​​​​更​​​​​​​新​​​​​​​数​​​​​​​据​​​​​​​。​​​​​​​
  • 您​​​​​​​可​​​​​​​以​​​​​​​在​​​​​​​快​​​​​​​照​​​​​​​文​​​​​​​件​​​​​​​系​​​​​​​统​​​​​​​中​​​​​​​执​​​​​​​行​​​​​​​ fsck 命​​​​​​​令​​​​​​​来​​​​​​​检​​​​​​​查​​​​​​​文​​​​​​​件​​​​​​​系​​​​​​​统​​​​​​​的​​​​​​​完​​​​​​​整​​​​​​​性​​​​​​​,并​​​​​​​确​​​​​​​定​​​​​​​源​​​​​​​文​​​​​​​件​​​​​​​系​​​​​​​统​​​​​​​是​​​​​​​否​​​​​​​需​​​​​​​要​​​​​​​修​​​​​​​复​​​​​​​。​​​​​​​
  • 因​​​​​​​为​​​​​​​快​​​​​​​照​​​​​​​是​​​​​​​可​​​​​​​读​​​​​​​/写​​​​​​​的​​​​​​​,您​​​​​​​可​​​​​​​以​​​​​​​通​​​​​​​过​​​​​​​获​​​​​​​取​​​​​​​快​​​​​​​照​​​​​​​并​​​​​​​根​​​​​​​据​​​​​​​快​​​​​​​照​​​​​​​进​​​​​​​行​​​​​​​测​​​​​​​试​​​​​​​,来​​​​​​​进​​​​​​​行​​​​​​​根​​​​​​​据​​​​​​​产​​​​​​​品​​​​​​​数​​​​​​​据​​​​​​​测​​​​​​​试​​​​​​​应​​​​​​​用​​​​​​​程​​​​​​​序​​​​​​​,而​​​​​​​不​​​​​​​会​​​​​​​影​​​​​​​响​​​​​​​真​​​​​​​实​​​​​​​数​​​​​​​据​​​​​​​。​​​​​​​
  • 您​​​​​​​可​​​​​​​以​​​​​​​使​​​​​​​用​​​​​​​ Xen 虚​​​​​​​拟​​​​​​​机​​​​​​​器​​​​​​​监​​​​​​​视​​​​​​​器​​​​​​​创​​​​​​​建​​​​​​​要​​​​​​​使​​​​​​​用​​​​​​​的​​​​​​​卷​​​​​​​。​​​​​​​您​​​​​​​可​​​​​​​以​​​​​​​使​​​​​​​用​​​​​​​快​​​​​​​照​​​​​​​特​​​​​​​性​​​​​​​创​​​​​​​建​​​​​​​磁​​​​​​​盘​​​​​​​映​​​​​​​射​​​​​​​并​​​​​​​提​​​​​​​取​​​​​​​快​​​​​​​照​​​​​​​,还​​​​​​​可​​​​​​​以​​​​​​​修​​​​​​​改​​​​​​​特​​​​​​​定​​​​​​​ domU 时​​​​​​​刻​​​​​​​的​​​​​​​快​​​​​​​照​​​​​​​。​​​​​​​然​​​​​​​后​​​​​​​您​​​​​​​可​​​​​​​以​​​​​​​为​​​​​​​另​​​​​​​一​​​​​​​个​​​​​​​ domU 时​​​​​​​刻​​​​​​​创​​​​​​​建​​​​​​​另​​​​​​​一​​​​​​​个​​​​​​​快​​​​​​​照​​​​​​​并​​​​​​​修​​​​​​​改​​​​​​​它​​​​​​​。​​​​​​​因​​​​​​​为​​​​​​​只​​​​​​​使​​​​​​​用​​​​​​​了​​​​​​​在​​​​​​​源​​​​​​​或​​​​​​​者​​​​​​​快​​​​​​​照​​​​​​​修​​​​​​​改​​​​​​​的​​​​​​​块​​​​​​​存​​​​​​​储​​​​​​​,所​​​​​​​以​​​​​​​卷​​​​​​​的​​​​​​​绝​​​​​​​大​​​​​​​部​​​​​​​分​​​​​​​是​​​​​​​共​​​​​​​享​​​​​​​的​​​​​​​。​​​​​​​

第 3 章 LVM 管​​​​​​​理​​​​​​​总​​​​​​​览​​​​​​​

This chapter provides an overview of the administrative procedures you use to configure LVM logical volumes. This chapter is intended to provide a general understanding of the steps involved. For specific step-by-step examples of common LVM configuration procedures, see 第 5 章 LVM 配​​​​​​​置​​​​​​​示​​​​​​​例​​​​​​​.

3.1. 在​​​​​​​群​​​​​​​集​​​​​​​中​​​​​​​创​​​​​​​建​​​​​​​ LVM 卷​​​​​​​

To create logical volumes in a cluster environment, you use the Clustered Logical Volume Manager (CLVM), which is a set of clustering extensions to LVM. These extensions allow a cluster of computers to manage shared storage (for example, on a SAN) using LVM. In order to use CLVM, the Red Hat Cluster Suite software, including the clmvd daemon, must be started at boot time, as described in 第 1.3 节 “群​​​​​​​集​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​管​​​​​​​理​​​​​​​器​​​​​​​(CLVM)”.
在​​​​​​​群​​​​​​​集​​​​​​​环​​​​​​​境​​​​​​​中​​​​​​​创​​​​​​​建​​​​​​​ LVM 逻​​​​​​​辑​​​​​​​卷​​​​​​​和​​​​​​​在​​​​​​​单​​​​​​​一​​​​​​​节​​​​​​​点​​​​​​​创​​​​​​​建​​​​​​​ LVM 逻​​​​​​​辑​​​​​​​卷​​​​​​​是​​​​​​​一​​​​​​​样​​​​​​​的​​​​​​​。​​​​​​​LVM 命​​​​​​​令​​​​​​​本​​​​​​​身​​​​​​​没​​​​​​​有​​​​​​​什​​​​​​​么​​​​​​​不​​​​​​​同​​​​​​​,LVM GUI 界​​​​​​​面​​​​​​​也​​​​​​​一​​​​​​​样​​​​​​​。​​​​​​​要​​​​​​​启​​​​​​​用​​​​​​​您​​​​​​​在​​​​​​​群​​​​​​​集​​​​​​​中​​​​​​​创​​​​​​​建​​​​​​​的​​​​​​​ LVM 卷​​​​​​​,群​​​​​​​集​​​​​​​构​​​​​​​架​​​​​​​必​​​​​​​须​​​​​​​正​​​​​​​在​​​​​​​运​​​​​​​行​​​​​​​且​​​​​​​群​​​​​​​集​​​​​​​必​​​​​​​须​​​​​​​有​​​​​​​足​​​​​​​够​​​​​​​节​​​​​​​点​​​​​​​。​​​​​​​
CLVM requires changes to the lvm.conf file for cluster-wide locking. Information on configuring the lvm.conf file to support clustered locking is provided within the lvm.conf file itself. For information about the lvm.conf file, see 附录 B, LVM 配​​​​​​​置​​​​​​​文​​​​​​​件​​​​​​​.
By default, logical volumes created with CLVM on shared storage are visible to all computers that have access to the shared storage. It is possible, however, to create logical volumes when the storage devices are visible to only one node in the cluster. It is also possible to change the status of a logical volume from a local volume to a clustered volume. For information, see 第 4.3.2 节 “在​​​​​​​群​​​​​​​集​​​​​​​中​​​​​​​创​​​​​​​建​​​​​​​卷​​​​​​​组​​​​​​​” and 第 4.3.7 节 “修​​​​​​​改​​​​​​​卷​​​​​​​组​​​​​​​参​​​​​​​数​​​​​​​”

注意

红​​​​​​​帽​​​​​​​群​​​​​​​集​​​​​​​套​​​​​​​件​​​​​​​中​​​​​​​使​​​​​​​用​​​​​​​的​​​​​​​共​​​​​​​享​​​​​​​存​​​​​​​储​​​​​​​要​​​​​​​求​​​​​​​您​​​​​​​正​​​​​​​在​​​​​​​运​​​​​​​行​​​​​​​群​​​​​​​集​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​管​​​​​​​理​​​​​​​器​​​​​​​守​​​​​​​护​​​​​​​进​​​​​​​程​​​​​​​(clvmd)或​​​​​​​者​​​​​​​高​​​​​​​度​​​​​​​可​​​​​​​用​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​管​​​​​​​理​​​​​​​代​​​​​​​理​​​​​​​(HA-LVM)。​​​​​​​如​​​​​​​果​​​​​​​由​​​​​​​于​​​​​​​操​​​​​​​作​​​​​​​原​​​​​​​因​​​​​​​您​​​​​​​无​​​​​​​法​​​​​​​使​​​​​​​用​​​​​​​ clvmd 守​​​​​​​护​​​​​​​进​​​​​​​程​​​​​​​或​​​​​​​者​​​​​​​ HA-LVM 之​​​​​​​一​​​​​​​,或​​​​​​​者​​​​​​​因​​​​​​​为​​​​​​​您​​​​​​​没​​​​​​​有​​​​​​​正​​​​​​​确​​​​​​​的​​​​​​​权​​​​​​​利​​​​​​​,您​​​​​​​就​​​​​​​不​​​​​​​能​​​​​​​在​​​​​​​共​​​​​​​享​​​​​​​磁​​​​​​​盘​​​​​​​中​​​​​​​使​​​​​​​用​​​​​​​单​​​​​​​一​​​​​​​事​​​​​​​件​​​​​​​ LVM,因​​​​​​​为​​​​​​​这​​​​​​​将​​​​​​​导​​​​​​​致​​​​​​​数​​​​​​​据​​​​​​​崩​​​​​​​溃​​​​​​​。​​​​​​​如​​​​​​​果​​​​​​​您​​​​​​​有​​​​​​​任​​​​​​​何​​​​​​​疑​​​​​​​问​​​​​​​请​​​​​​​联​​​​​​​络​​​​​​​您​​​​​​​的​​​​​​​红​​​​​​​帽​​​​​​​服​​​​​​​务​​​​​​​代​​​​​​​表​​​​​​​。​​​​​​​
有​​​​​​​关​​​​​​​如​​​​​​​何​​​​​​​安​​​​​​​装​​​​​​​红​​​​​​​帽​​​​​​​群​​​​​​​集​​​​​​​套​​​​​​​件​​​​​​​以​​​​​​​及​​​​​​​设​​​​​​​置​​​​​​​群​​​​​​​集​​​​​​​构​​​​​​​架​​​​​​​的​​​​​​​详​​​​​​​情​​​​​​​请​​​​​​​参​​​​​​​考​​​​​​​《​​​​​​​配​​​​​​​置​​​​​​​和​​​​​​​管​​​​​​​理​​​​​​​红​​​​​​​帽​​​​​​​群​​​​​​​集​​​​​​​》​​​​​​​。​​​​​​​

3.2. 创​​​​​​​建​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​总​​​​​​​览​​​​​​​

以​​​​​​​下​​​​​​​内​​​​​​​容​​​​​​​对​​​​​​​创​​​​​​​建​​​​​​​ LVM 逻​​​​​​​辑​​​​​​​卷​​​​​​​的​​​​​​​步​​​​​​​骤​​​​​​​进​​​​​​​行​​​​​​​了​​​​​​​总​​​​​​​结​​​​​​​。​​​​​​​
  1. 将​​​​​​​您​​​​​​​要​​​​​​​用​​​​​​​作​​​​​​​ LVM 卷​​​​​​​的​​​​​​​分​​​​​​​区​​​​​​​初​​​​​​​始​​​​​​​化​​​​​​​为​​​​​​​物​​​​​​​理​​​​​​​卷​​​​​​​(进​​​​​​​行​​​​​​​标​​​​​​​记​​​​​​​)。​​​​​​​
  2. 创​​​​​​​建​​​​​​​卷​​​​​​​组​​​​​​​。​​​​​​​
  3. 创​​​​​​​建​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​。​​​​​​​
创​​​​​​​建​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​后​​​​​​​,您​​​​​​​可​​​​​​​以​​​​​​​生​​​​​​​成​​​​​​​并​​​​​​​挂​​​​​​​载​​​​​​​文​​​​​​​件​​​​​​​系​​​​​​​统​​​​​​​。​​​​​​​本​​​​​​​文​​​​​​​档​​​​​​​示​​​​​​​例​​​​​​​中​​​​​​​使​​​​​​​用​​​​​​​的​​​​​​​是​​​​​​​ GFS 文​​​​​​​件​​​​​​​系​​​​​​​统​​​​​​​。​​​​​​​
  1. 在​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​中​​​​​​​用​​​​​​​ gfs_mkfs 创​​​​​​​建​​​​​​​ GFS 文​​​​​​​件​​​​​​​系​​​​​​​统​​​​​​​。​​​​​​​
  2. 用​​​​​​​ mkdir 命​​​​​​​令​​​​​​​创​​​​​​​建​​​​​​​一​​​​​​​个​​​​​​​新​​​​​​​的​​​​​​​挂​​​​​​​载​​​​​​​点​​​​​​​。​​​​​​​在​​​​​​​群​​​​​​​集​​​​​​​的​​​​​​​系​​​​​​​统​​​​​​​中​​​​​​​,在​​​​​​​群​​​​​​​集​​​​​​​的​​​​​​​所​​​​​​​有​​​​​​​节​​​​​​​点​​​​​​​中​​​​​​​创​​​​​​​建​​​​​​​挂​​​​​​​载​​​​​​​点​​​​​​​。​​​​​​​
  3. 挂​​​​​​​载​​​​​​​文​​​​​​​件​​​​​​​系​​​​​​​统​​​​​​​。​​​​​​​您​​​​​​​可​​​​​​​能​​​​​​​想​​​​​​​要​​​​​​​在​​​​​​​ fstab 为​​​​​​​系​​​​​​​统​​​​​​​中​​​​​​​的​​​​​​​每​​​​​​​个​​​​​​​节​​​​​​​点​​​​​​​添​​​​​​​加​​​​​​​一​​​​​​​行​​​​​​​。​​​​​​​
另​​​​​​​外​​​​​​​,您​​​​​​​可​​​​​​​以​​​​​​​使​​​​​​​用​​​​​​​ LVM GUI 创​​​​​​​建​​​​​​​并​​​​​​​挂​​​​​​​载​​​​​​​ GFS 文​​​​​​​件​​​​​​​系​​​​​​​统​​​​​​​。​​​​​​​
创​​​​​​​建​​​​​​​ LVM 卷​​​​​​​在​​​​​​​每​​​​​​​台​​​​​​​机​​​​​​​器​​​​​​​上​​​​​​​都​​​​​​​是​​​​​​​不​​​​​​​同​​​​​​​的​​​​​​​,因​​​​​​​为​​​​​​​保​​​​​​​存​​​​​​​ LVM 设​​​​​​​置​​​​​​​信​​​​​​​息​​​​​​​的​​​​​​​区​​​​​​​域​​​​​​​是​​​​​​​在​​​​​​​物​​​​​​​理​​​​​​​卷​​​​​​​中​​​​​​​,而​​​​​​​不​​​​​​​是​​​​​​​在​​​​​​​创​​​​​​​建​​​​​​​卷​​​​​​​的​​​​​​​机​​​​​​​器​​​​​​​中​​​​​​​。​​​​​​​用​​​​​​​于​​​​​​​存​​​​​​​储​​​​​​​的​​​​​​​服​​​​​​​务​​​​​​​器​​​​​​​有​​​​​​​本​​​​​​​地​​​​​​​副​​​​​​​本​​​​​​​,但​​​​​​​可​​​​​​​以​​​​​​​重​​​​​​​新​​​​​​​生​​​​​​​成​​​​​​​物​​​​​​​理​​​​​​​卷​​​​​​​中​​​​​​​的​​​​​​​内​​​​​​​容​​​​​​​。​​​​​​​如​​​​​​​果​​​​​​​ LVM 版​​​​​​​本​​​​​​​兼​​​​​​​容​​​​​​​,您​​​​​​​可​​​​​​​以​​​​​​​将​​​​​​​物​​​​​​​理​​​​​​​卷​​​​​​​附​​​​​​​加​​​​​​​到​​​​​​​不​​​​​​​同​​​​​​​服​​​​​​​务​​​​​​​器​​​​​​​上​​​​​​​。​​​​​​​

3.3. 在​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​中​​​​​​​增​​​​​​​大​​​​​​​文​​​​​​​件​​​​​​​系​​​​​​​统​​​​​​​

要​​​​​​​在​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​中​​​​​​​增​​​​​​​大​​​​​​​文​​​​​​​件​​​​​​​系​​​​​​​统​​​​​​​,请​​​​​​​按​​​​​​​以​​​​​​​下​​​​​​​步​​​​​​​骤​​​​​​​执​​​​​​​行​​​​​​​:
  1. 创​​​​​​​建​​​​​​​一​​​​​​​个​​​​​​​新​​​​​​​的​​​​​​​物​​​​​​​理​​​​​​​卷​​​​​​​。​​​​​​​
  2. 扩​​​​​​​展​​​​​​​带​​​​​​​有​​​​​​​您​​​​​​​想​​​​​​​要​​​​​​​增​​​​​​​大​​​​​​​的​​​​​​​文​​​​​​​件​​​​​​​系​​​​​​​统​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​的​​​​​​​卷​​​​​​​组​​​​​​​,使​​​​​​​其​​​​​​​包​​​​​​​含​​​​​​​新​​​​​​​的​​​​​​​物​​​​​​​理​​​​​​​卷​​​​​​​。​​​​​​​
  3. 扩​​​​​​​展​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​使​​​​​​​其​​​​​​​包​​​​​​​含​​​​​​​新​​​​​​​的​​​​​​​物​​​​​​​理​​​​​​​卷​​​​​​​。​​​​​​​
  4. 增​​​​​​​大​​​​​​​文​​​​​​​件​​​​​​​系​​​​​​​统​​​​​​​。​​​​​​​
如​​​​​​​果​​​​​​​您​​​​​​​的​​​​​​​卷​​​​​​​组​​​​​​​中​​​​​​​有​​​​​​​足​​​​​​​够​​​​​​​的​​​​​​​未​​​​​​​分​​​​​​​配​​​​​​​空​​​​​​​间​​​​​​​,您​​​​​​​可​​​​​​​以​​​​​​​使​​​​​​​用​​​​​​​那​​​​​​​些​​​​​​​空​​​​​​​间​​​​​​​来​​​​​​​扩​​​​​​​展​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​,而​​​​​​​不​​​​​​​执​​​​​​​行​​​​​​​步​​​​​​​骤​​​​​​​ 1 和​​​​​​​ 2。​​​​​​​

3.4. 逻​​​​​​​辑​​​​​​​卷​​​​​​​备​​​​​​​份​​​​​​​

元​​​​​​​数​​​​​​​据​​​​​​​备​​​​​​​份​​​​​​​和​​​​​​​归​​​​​​​档​​​​​​​会​​​​​​​在​​​​​​​每​​​​​​​次​​​​​​​修​​​​​​​改​​​​​​​卷​​​​​​​组​​​​​​​和​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​配​​​​​​​置​​​​​​​时​​​​​​​自​​​​​​​动​​​​​​​进​​​​​​​行​​​​​​​,除​​​​​​​非​​​​​​​您​​​​​​​在​​​​​​​ lvm.conf 文​​​​​​​件​​​​​​​中​​​​​​​禁​​​​​​​用​​​​​​​了​​​​​​​此​​​​​​​功​​​​​​​能​​​​​​​。​​​​​​​默​​​​​​​认​​​​​​​情​​​​​​​况​​​​​​​下​​​​​​​,元​​​​​​​数​​​​​​​据​​​​​​​备​​​​​​​份​​​​​​​保​​​​​​​存​​​​​​​在​​​​​​​ /etc/lvm/backup 中​​​​​​​,元​​​​​​​数​​​​​​​据​​​​​​​归​​​​​​​档​​​​​​​保​​​​​​​存​​​​​​​在​​​​​​​ /etc/lvm/archive 中​​​​​​​。​​​​​​​元​​​​​​​数​​​​​​​据​​​​​​​归​​​​​​​档​​​​​​​在​​​​​​​ /etc/lvm/archive 中​​​​​​​保​​​​​​​存​​​​​​​的​​​​​​​时​​​​​​​间​​​​​​​和​​​​​​​多​​​​​​​少​​​​​​​取​​​​​​​决​​​​​​​于​​​​​​​您​​​​​​​在​​​​​​​ lvm.conf 文​​​​​​​件​​​​​​​中​​​​​​​设​​​​​​​定​​​​​​​的​​​​​​​参​​​​​​​数​​​​​​​。​​​​​​​日​​​​​​​常​​​​​​​系​​​​​​​统​​​​​​​备​​​​​​​份​​​​​​​应​​​​​​​该​​​​​​​在​​​​​​​备​​​​​​​份​​​​​​​中​​​​​​​包​​​​​​​含​​​​​​​ /etc/lvm 目​​​​​​​录​​​​​​​的​​​​​​​内​​​​​​​容​​​​​​​。​​​​​​​
注​​​​​​​意​​​​​​​:元​​​​​​​数​​​​​​​据​​​​​​​备​​​​​​​份​​​​​​​并​​​​​​​不​​​​​​​包​​​​​​​含​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​中​​​​​​​的​​​​​​​用​​​​​​​户​​​​​​​和​​​​​​​系​​​​​​​统​​​​​​​数​​​​​​​据​​​​​​​。​​​​​​​
You can manually back up the metadata to the /etc/lvm/backup file with the vgcfgbackup command. You can restore metadata with the vgcfgrestore command. The vgcfgbackup and vgcfgrestore commands are described in 第 4.3.12 节 “备​​​​​​​份​​​​​​​卷​​​​​​​组​​​​​​​元​​​​​​​数​​​​​​​据​​​​​​​”.

3.5. 日​​​​​​​志​​​​​​​

所​​​​​​​有​​​​​​​信​​​​​​​息​​​​​​​输​​​​​​​出​​​​​​​都​​​​​​​是​​​​​​​通​​​​​​​过​​​​​​​日​​​​​​​志​​​​​​​模​​​​​​​块​​​​​​​传​​​​​​​递​​​​​​​,日​​​​​​​志​​​​​​​模​​​​​​​式​​​​​​​根​​​​​​​据​​​​​​​日​​​​​​​志​​​​​​​级​​​​​​​别​​​​​​​有​​​​​​​不​​​​​​​同​​​​​​​的​​​​​​​选​​​​​​​择​​​​​​​:
  • 标​​​​​​​准​​​​​​​输​​​​​​​出​​​​​​​/错​​​​​​​误​​​​​​​
  • 系​​​​​​​统​​​​​​​日​​​​​​​志​​​​​​​
  • 日​​​​​​​志​​​​​​​文​​​​​​​件​​​​​​​
  • 外​​​​​​​部​​​​​​​日​​​​​​​志​​​​​​​功​​​​​​​能​​​​​​​
The logging levels are set in the /etc/lvm/lvm.conf file, which is described in 附录 B, LVM 配​​​​​​​置​​​​​​​文​​​​​​​件​​​​​​​.

第 4 章 用​​​​​​​ CLI 命​​​​​​​令​​​​​​​管​​​​​​​理​​​​​​​ LVM

本​​​​​​​章​​​​​​​总​​​​​​​结​​​​​​​了​​​​​​​您​​​​​​​可​​​​​​​使​​​​​​​用​​​​​​​ LVM 命​​​​​​​令​​​​​​​行​​​​​​​界​​​​​​​面​​​​​​​(CLI)来​​​​​​​创​​​​​​​建​​​​​​​和​​​​​​​维​​​​​​​护​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​的​​​​​​​独​​​​​​​立​​​​​​​管​​​​​​​理​​​​​​​任​​​​​​​务​​​​​​​。​​​​​​​

注意

If you are creating or modifying an LVM volume for a clustered environment, you must ensure that you are running the clvmd daemon. For information, see see 第 3.1 节 “在​​​​​​​群​​​​​​​集​​​​​​​中​​​​​​​创​​​​​​​建​​​​​​​ LVM 卷​​​​​​​”.

4.1. 使​​​​​​​用​​​​​​​ CLI 命​​​​​​​令​​​​​​​

LVM CLI 命​​​​​​​令​​​​​​​有​​​​​​​一​​​​​​​些​​​​​​​通​​​​​​​用​​​​​​​的​​​​​​​特​​​​​​​性​​​​​​​。​​​​​​​
当​​​​​​​在​​​​​​​命​​​​​​​令​​​​​​​行​​​​​​​中​​​​​​​需​​​​​​​要​​​​​​​容​​​​​​​量​​​​​​​参​​​​​​​数​​​​​​​时​​​​​​​,可​​​​​​​以​​​​​​​明​​​​​​​确​​​​​​​指​​​​​​​定​​​​​​​单​​​​​​​位​​​​​​​。​​​​​​​如​​​​​​​果​​​​​​​您​​​​​​​不​​​​​​​指​​​​​​​定​​​​​​​单​​​​​​​位​​​​​​​,那​​​​​​​么​​​​​​​就​​​​​​​使​​​​​​​用​​​​​​​默​​​​​​​认​​​​​​​的​​​​​​​ KB 或​​​​​​​者​​​​​​​ MB。​​​​​​​LVM CLI 不​​​​​​​接​​​​​​​受​​​​​​​分​​​​​​​数​​​​​​​。​​​​​​​
在​​​​​​​命​​​​​​​令​​​​​​​行​​​​​​​参​​​​​​​数​​​​​​​中​​​​​​​为​​​​​​​ LVM 指​​​​​​​定​​​​​​​单​​​​​​​位​​​​​​​时​​​​​​​要​​​​​​​无​​​​​​​需​​​​​​​区​​​​​​​分​​​​​​​大​​​​​​​小​​​​​​​写​​​​​​​,比​​​​​​​如​​​​​​​ M 或​​​​​​​者​​​​​​​ m 的​​​​​​​效​​​​​​​果​​​​​​​是​​​​​​​一​​​​​​​样​​​​​​​的​​​​​​​,且​​​​​​​使​​​​​​​用​​​​​​​ 2 的​​​​​​​乘​​​​​​​方​​​​​​​(乘​​​​​​​ 1024)。​​​​​​​但​​​​​​​是​​​​​​​,在​​​​​​​某​​​​​​​个​​​​​​​命​​​​​​​令​​​​​​​中​​​​​​​指​​​​​​​定​​​​​​​ --units 参​​​​​​​数​​​​​​​时​​​​​​​,小​​​​​​​写​​​​​​​表​​​​​​​示​​​​​​​该​​​​​​​单​​​​​​​位​​​​​​​乘​​​​​​​ 1024,而​​​​​​​大​​​​​​​写​​​​​​​表​​​​​​​示​​​​​​​该​​​​​​​单​​​​​​​位​​​​​​​乘​​​​​​​ 1000。​​​​​​​
在​​​​​​​命​​​​​​​令​​​​​​​使​​​​​​​用​​​​​​​卷​​​​​​​组​​​​​​​或​​​​​​​者​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​名​​​​​​​称​​​​​​​作​​​​​​​为​​​​​​​参​​​​​​​数​​​​​​​时​​​​​​​,完​​​​​​​整​​​​​​​路​​​​​​​径​​​​​​​名​​​​​​​称​​​​​​​是​​​​​​​可​​​​​​​选​​​​​​​项​​​​​​​。​​​​​​​卷​​​​​​​组​​​​​​​ vg0 中​​​​​​​的​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​ lvol0 可​​​​​​​被​​​​​​​指​​​​​​​定​​​​​​​为​​​​​​​ vg0/lvol0。​​​​​​​如​​​​​​​果​​​​​​​空​​​​​​​置​​​​​​​需​​​​​​​要​​​​​​​指​​​​​​​定​​​​​​​卷​​​​​​​组​​​​​​​的​​​​​​​地​​​​​​​方​​​​​​​,就​​​​​​​会​​​​​​​代​​​​​​​入​​​​​​​所​​​​​​​有​​​​​​​列​​​​​​​出​​​​​​​的​​​​​​​卷​​​​​​​组​​​​​​​。​​​​​​​在​​​​​​​需​​​​​​​要​​​​​​​指​​​​​​​定​​​​​​​一​​​​​​​组​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​的​​​​​​​地​​​​​​​方​​​​​​​给​​​​​​​出​​​​​​​了​​​​​​​卷​​​​​​​组​​​​​​​,就​​​​​​​会​​​​​​​代​​​​​​​入​​​​​​​那​​​​​​​个​​​​​​​卷​​​​​​​组​​​​​​​中​​​​​​​的​​​​​​​列​​​​​​​出​​​​​​​的​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​。​​​​​​​例​​​​​​​如​​​​​​​:lvdisplay vg0 命​​​​​​​令​​​​​​​将​​​​​​​显​​​​​​​示​​​​​​​卷​​​​​​​组​​​​​​​ vg0 中​​​​​​​的​​​​​​​所​​​​​​​有​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​。​​​​​​​
所​​​​​​​有​​​​​​​ LVM 命​​​​​​​令​​​​​​​都​​​​​​​接​​​​​​​受​​​​​​​ -v 参​​​​​​​数​​​​​​​,它​​​​​​​可​​​​​​​多​​​​​​​次​​​​​​​输​​​​​​​入​​​​​​​来​​​​​​​提​​​​​​​高​​​​​​​输​​​​​​​出​​​​​​​的​​​​​​​详​​​​​​​细​​​​​​​程​​​​​​​度​​​​​​​。​​​​​​​例​​​​​​​如​​​​​​​:以​​​​​​​下​​​​​​​示​​​​​​​例​​​​​​​显​​​​​​​示​​​​​​​的​​​​​​​是​​​​​​​ lvcreate 命​​​​​​​令​​​​​​​的​​​​​​​默​​​​​​​认​​​​​​​输​​​​​​​出​​​​​​​。​​​​​​​
# lvcreate -L 50MB new_vg
  Rounding up size to full physical extent 52.00 MB
  Logical volume "lvol0" created
下​​​​​​​面​​​​​​​是​​​​​​​ lvcreate 命​​​​​​​令​​​​​​​带​​​​​​​ -v 参​​​​​​​数​​​​​​​的​​​​​​​输​​​​​​​出​​​​​​​。​​​​​​​
# lvcreate -v -L 50MB new_vg
    Finding volume group "new_vg"
  Rounding up size to full physical extent 52.00 MB
    Archiving volume group "new_vg" metadata (seqno 4).
    Creating logical volume lvol0
    Creating volume group backup "/etc/lvm/backup/new_vg" (seqno 5).
    Found volume group "new_vg"
    Creating new_vg-lvol0
    Loading new_vg-lvol0 table
    Resuming new_vg-lvol0 (253:2)
    Clearing start of logical volume "lvol0"
    Creating volume group backup "/etc/lvm/backup/new_vg" (seqno 5).
  Logical volume "lvol0" created
您​​​​​​​还​​​​​​​可​​​​​​​以​​​​​​​使​​​​​​​用​​​​​​​ -vv、​​​​​​​-vvv 或​​​​​​​者​​​​​​​ -vvvv 参​​​​​​​数​​​​​​​来​​​​​​​提​​​​​​​高​​​​​​​命​​​​​​​令​​​​​​​执​​​​​​​行​​​​​​​的​​​​​​​详​​​​​​​细​​​​​​​程​​​​​​​度​​​​​​​。​​​​​​​-vvvv 参​​​​​​​数​​​​​​​可​​​​​​​以​​​​​​​提​​​​​​​供​​​​​​​最​​​​​​​多​​​​​​​的​​​​​​​信​​​​​​​息​​​​​​​。​​​​​​​以​​​​​​​下​​​​​​​是​​​​​​​ lvcreate 命​​​​​​​令​​​​​​​带​​​​​​​ -vvvv 参​​​​​​​数​​​​​​​时​​​​​​​给​​​​​​​出​​​​​​​的​​​​​​​输​​​​​​​出​​​​​​​的​​​​​​​前​​​​​​​几​​​​​​​行​​​​​​​。​​​​​​​
# lvcreate -vvvv -L 50MB new_vg
#lvmcmdline.c:913         Processing: lvcreate -vvvv -L 50MB new_vg
#lvmcmdline.c:916         O_DIRECT will be used
#config/config.c:864       Setting global/locking_type to 1
#locking/locking.c:138       File-based locking selected.
#config/config.c:841       Setting global/locking_dir to /var/lock/lvm
#activate/activate.c:358       Getting target version for linear
#ioctl/libdm-iface.c:1569         dm version   OF   [16384]
#ioctl/libdm-iface.c:1569         dm versions   OF   [16384]
#activate/activate.c:358       Getting target version for striped
#ioctl/libdm-iface.c:1569         dm versions   OF   [16384]
#config/config.c:864       Setting activation/mirror_region_size to 512
...
您​​​​​​​可​​​​​​​以​​​​​​​用​​​​​​​命​​​​​​​令​​​​​​​的​​​​​​​ --help 参​​​​​​​数​​​​​​​来​​​​​​​显​​​​​​​示​​​​​​​任​​​​​​​意​​​​​​​ LVM CLI 命​​​​​​​令​​​​​​​的​​​​​​​帮​​​​​​​助​​​​​​​信​​​​​​​息​​​​​​​。​​​​​​​
commandname --help
要​​​​​​​显​​​​​​​示​​​​​​​某​​​​​​​个​​​​​​​命​​​​​​​令​​​​​​​的​​​​​​​ man page,请​​​​​​​执​​​​​​​行​​​​​​​ man 命​​​​​​​令​​​​​​​:
man commandname
man lvm 命​​​​​​​令​​​​​​​提​​​​​​​供​​​​​​​有​​​​​​​关​​​​​​​ LVM 的​​​​​​​常​​​​​​​规​​​​​​​在​​​​​​​线​​​​​​​信​​​​​​​息​​​​​​​。​​​​​​​
All LVM objects are referenced internally by a UUID, which is assigned when you create the object. This can be useful in a situation where you remove a physical volume called /dev/sdf which is part of a volume group and, when you plug it back in, you find that it is now /dev/sdk. LVM will still find the physical volume because it identifies the physical volume by its UUID and not its device name. For information on specifying the UUID of a physical volume when creating a physical volume, see see 第 6.4 节 “修​​​​​​​复​​​​​​​物​​​​​​​理​​​​​​​卷​​​​​​​元​​​​​​​数​​​​​​​据​​​​​​​”.

4.2. 物​​​​​​​理​​​​​​​卷​​​​​​​管​​​​​​​理​​​​​​​

这​​​​​​​部​​​​​​​分​​​​​​​论​​​​​​​述​​​​​​​了​​​​​​​对​​​​​​​物​​​​​​​理​​​​​​​卷​​​​​​​不​​​​​​​同​​​​​​​方​​​​​​​面​​​​​​​进​​​​​​​行​​​​​​​管​​​​​​​理​​​​​​​的​​​​​​​命​​​​​​​令​​​​​​​。​​​​​​​

4.2.1. 创​​​​​​​建​​​​​​​物​​​​​​​理​​​​​​​卷​​​​​​​

下​​​​​​​面​​​​​​​的​​​​​​​子​​​​​​​部​​​​​​​分​​​​​​​论​​​​​​​述​​​​​​​了​​​​​​​创​​​​​​​建​​​​​​​物​​​​​​​理​​​​​​​卷​​​​​​​的​​​​​​​命​​​​​​​令​​​​​​​。​​​​​​​

4.2.1.1. 设​​​​​​​定​​​​​​​分​​​​​​​区​​​​​​​类​​​​​​​型​​​​​​​

如​​​​​​​果​​​​​​​您​​​​​​​将​​​​​​​整​​​​​​​张​​​​​​​磁​​​​​​​盘​​​​​​​作​​​​​​​为​​​​​​​您​​​​​​​的​​​​​​​物​​​​​​​理​​​​​​​卷​​​​​​​使​​​​​​​用​​​​​​​,那​​​​​​​么​​​​​​​磁​​​​​​​盘​​​​​​​就​​​​​​​必​​​​​​​须​​​​​​​没​​​​​​​有​​​​​​​分​​​​​​​区​​​​​​​表​​​​​​​。​​​​​​​对​​​​​​​于​​​​​​​ DOS 磁​​​​​​​盘​​​​​​​分​​​​​​​区​​​​​​​,您​​​​​​​应​​​​​​​该​​​​​​​用​​​​​​​ fdisk 或​​​​​​​者​​​​​​​ cfdisk 或​​​​​​​者​​​​​​​等​​​​​​​同​​​​​​​的​​​​​​​命​​​​​​​令​​​​​​​将​​​​​​​分​​​​​​​区​​​​​​​ id 设​​​​​​​为​​​​​​​ 0x8e。​​​​​​​如​​​​​​​果​​​​​​​将​​​​​​​整​​​​​​​张​​​​​​​磁​​​​​​​盘​​​​​​​作​​​​​​​为​​​​​​​一​​​​​​​个​​​​​​​设​​​​​​​备​​​​​​​使​​​​​​​用​​​​​​​就​​​​​​​必​​​​​​​须​​​​​​​擦​​​​​​​除​​​​​​​分​​​​​​​区​​​​​​​表​​​​​​​,这​​​​​​​也​​​​​​​就​​​​​​​会​​​​​​​有​​​​​​​效​​​​​​​地​​​​​​​破​​​​​​​坏​​​​​​​磁​​​​​​​盘​​​​​​​中​​​​​​​的​​​​​​​数​​​​​​​据​​​​​​​。​​​​​​​您​​​​​​​可​​​​​​​以​​​​​​​用​​​​​​​以​​​​​​​下​​​​​​​命​​​​​​​令​​​​​​​将​​​​​​​现​​​​​​​有​​​​​​​分​​​​​​​区​​​​​​​表​​​​​​​的​​​​​​​第​​​​​​​一​​​​​​​个​​​​​​​扇​​​​​​​区​​​​​​​归​​​​​​​零​​​​​​​,从​​​​​​​而​​​​​​​删​​​​​​​除​​​​​​​分​​​​​​​区​​​​​​​表​​​​​​​:
dd if=/dev/zero of=PhysicalVolume bs=512 count=1

4.2.1.2. 初​​​​​​​始​​​​​​​化​​​​​​​物​​​​​​​理​​​​​​​卷​​​​​​​

使​​​​​​​用​​​​​​​ pvcreate 命​​​​​​​令​​​​​​​来​​​​​​​将​​​​​​​一​​​​​​​个​​​​​​​块​​​​​​​设​​​​​​​备​​​​​​​初​​​​​​​始​​​​​​​化​​​​​​​为​​​​​​​一​​​​​​​个​​​​​​​物​​​​​​​理​​​​​​​卷​​​​​​​。​​​​​​​初​​​​​​​始​​​​​​​化​​​​​​​和​​​​​​​格​​​​​​​式​​​​​​​化​​​​​​​文​​​​​​​件​​​​​​​系​​​​​​​统​​​​​​​类​​​​​​​似​​​​​​​。​​​​​​​
以​​​​​​​下​​​​​​​命​​​​​​​令​​​​​​​初​​​​​​​始​​​​​​​化​​​​​​​ /dev/sdd1、​​​​​​​/dev/sde1 和​​​​​​​ /dev/sdf1,将​​​​​​​其​​​​​​​作​​​​​​​为​​​​​​​ LVM 物​​​​​​​理​​​​​​​卷​​​​​​​使​​​​​​​用​​​​​​​。​​​​​​​
pvcreate /dev/sdd1 /dev/sde1 /dev/sdf1
要​​​​​​​初​​​​​​​始​​​​​​​化​​​​​​​分​​​​​​​区​​​​​​​而​​​​​​​不​​​​​​​是​​​​​​​整​​​​​​​张​​​​​​​磁​​​​​​​盘​​​​​​​,请​​​​​​​在​​​​​​​分​​​​​​​区​​​​​​​中​​​​​​​运​​​​​​​行​​​​​​​ pvcreate。​​​​​​​以​​​​​​​下​​​​​​​给​​​​​​​出​​​​​​​了​​​​​​​将​​​​​​​ /dev/hdb1 初​​​​​​​始​​​​​​​化​​​​​​​成​​​​​​​一​​​​​​​个​​​​​​​ LVM 物​​​​​​​理​​​​​​​卷​​​​​​​,以​​​​​​​便​​​​​​​以​​​​​​​后​​​​​​​成​​​​​​​为​​​​​​​ LVM 逻​​​​​​​辑​​​​​​​卷​​​​​​​的​​​​​​​一​​​​​​​部​​​​​​​分​​​​​​​的​​​​​​​示​​​​​​​例​​​​​​​。​​​​​​​
pvcreate /dev/hdb1

4.2.1.3. 扫​​​​​​​描​​​​​​​块​​​​​​​设​​​​​​​备​​​​​​​

您​​​​​​​可​​​​​​​以​​​​​​​使​​​​​​​用​​​​​​​ lvmdiskscan 命​​​​​​​令​​​​​​​来​​​​​​​扫​​​​​​​描​​​​​​​用​​​​​​​作​​​​​​​物​​​​​​​理​​​​​​​卷​​​​​​​的​​​​​​​块​​​​​​​设​​​​​​​备​​​​​​​,示​​​​​​​例​​​​​​​如​​​​​​​下​​​​​​​。​​​​​​​
# lvmdiskscan
/dev/ram0                    [       16.00 MB]
  /dev/sda                     [       17.15 GB]
  /dev/root                    [       13.69 GB]
  /dev/ram                     [       16.00 MB]
  /dev/sda1                    [       17.14 GB] LVM physical volume
  /dev/VolGroup00/LogVol01     [      512.00 MB]
  /dev/ram2                    [       16.00 MB]
  /dev/new_vg/lvol0            [       52.00 MB]
  /dev/ram3                    [       16.00 MB]
  /dev/pkl_new_vg/sparkie_lv   [        7.14 GB]
  /dev/ram4                    [       16.00 MB]
  /dev/ram5                    [       16.00 MB]
  /dev/ram6                    [       16.00 MB]
  /dev/ram7                    [       16.00 MB]
  /dev/ram8                    [       16.00 MB]
  /dev/ram9                    [       16.00 MB]
  /dev/ram10                   [       16.00 MB]
  /dev/ram11                   [       16.00 MB]
  /dev/ram12                   [       16.00 MB]
  /dev/ram13                   [       16.00 MB]
  /dev/ram14                   [       16.00 MB]
  /dev/ram15                   [       16.00 MB]
  /dev/sdb                     [       17.15 GB]
  /dev/sdb1                    [       17.14 GB] LVM physical volume
  /dev/sdc                     [       17.15 GB]
  /dev/sdc1                    [       17.14 GB] LVM physical volume
  /dev/sdd                     [       17.15 GB]
  /dev/sdd1                    [       17.14 GB] LVM physical volume
  7 disks
  17 partitions
  0 LVM physical volume whole disks
  4 LVM physical volumes

4.2.2. 显​​​​​​​示​​​​​​​物​​​​​​​理​​​​​​​卷​​​​​​​

用​​​​​​​来​​​​​​​显​​​​​​​示​​​​​​​ LVM 物​​​​​​​理​​​​​​​卷​​​​​​​属​​​​​​​性​​​​​​​的​​​​​​​命​​​​​​​令​​​​​​​有​​​​​​​三​​​​​​​个​​​​​​​:pvs、​​​​​​​pvdisplay 和​​​​​​​ pvscan。​​​​​​​
The pvs command provides physical volume information in a configurable form, displaying one line per physical volume. The pvs command provides a great deal of format control, and is useful for scripting. For information on using the pvs command to customize your output, see 第 4.9 节 “为​​​​​​​ LVM 自​​​​​​​定​​​​​​​义​​​​​​​报​​​​​​​告​​​​​​​”.
pvdisplay 命​​​​​​​令​​​​​​​为​​​​​​​每​​​​​​​个​​​​​​​物​​​​​​​理​​​​​​​卷​​​​​​​提​​​​​​​供​​​​​​​详​​​​​​​细​​​​​​​的​​​​​​​多​​​​​​​行​​​​​​​输​​​​​​​出​​​​​​​。​​​​​​​它​​​​​​​用​​​​​​​混​​​​​​​合​​​​​​​格​​​​​​​式​​​​​​​显​​​​​​​示​​​​​​​物​​​​​​​理​​​​​​​属​​​​​​​性​​​​​​​(大​​​​​​​小​​​​​​​、​​​​​​​扩​​​​​​​展​​​​​​​、​​​​​​​卷​​​​​​​组​​​​​​​等​​​​​​​等​​​​​​​)。​​​​​​​
以​​​​​​​下​​​​​​​是​​​​​​​ pvdisplay 为​​​​​​​单​​​​​​​一​​​​​​​物​​​​​​​理​​​​​​​卷​​​​​​​显​​​​​​​示​​​​​​​的​​​​​​​输​​​​​​​出​​​​​​​结​​​​​​​果​​​​​​​示​​​​​​​例​​​​​​​。​​​​​​​
# pvdisplay
  --- Physical volume ---
  PV Name               /dev/sdc1
  VG Name               new_vg
  PV Size               17.14 GB / not usable 3.40 MB
  Allocatable           yes
  PE Size (KByte)       4096
  Total PE              4388
  Free PE               4375
  Allocated PE          13
  PV UUID               Joqlch-yWSj-kuEn-IdwM-01S9-XO8M-mcpsVe
pvscan 命​​​​​​​令​​​​​​​在​​​​​​​系​​​​​​​统​​​​​​​中​​​​​​​为​​​​​​​物​​​​​​​理​​​​​​​卷​​​​​​​扫​​​​​​​描​​​​​​​所​​​​​​​有​​​​​​​支​​​​​​​持​​​​​​​的​​​​​​​ LVM 块​​​​​​​设​​​​​​​备​​​​​​​。​​​​​​​
以​​​​​​​下​​​​​​​命​​​​​​​令​​​​​​​显​​​​​​​示​​​​​​​所​​​​​​​有​​​​​​​找​​​​​​​到​​​​​​​的​​​​​​​物​​​​​​​理​​​​​​​设​​​​​​​备​​​​​​​:
# pvscan
 PV /dev/sdb2   VG vg0   lvm2 [964.00 MB / 0   free]
 PV /dev/sdc1   VG vg0   lvm2 [964.00 MB / 428.00 MB free]
 PV /dev/sdc2            lvm2 [964.84 MB]
 Total: 3 [2.83 GB] / in use: 2 [1.88 GB] / in no VG: 1 [964.84 MB]
You can define a filter in the lvm.conf so that this command will avoid scanning specific physical volumes. For information on using filters to control which devices are scanned, see 第 4.6 节 “用​​​​​​​过​​​​​​​滤​​​​​​​器​​​​​​​控​​​​​​​制​​​​​​​ LVM 设​​​​​​​备​​​​​​​扫​​​​​​​描​​​​​​​”.

4.2.3. 防​​​​​​​止​​​​​​​在​​​​​​​物​​​​​​​理​​​​​​​卷​​​​​​​中​​​​​​​进​​​​​​​行​​​​​​​分​​​​​​​配​​​​​​​

您​​​​​​​可​​​​​​​以​​​​​​​使​​​​​​​用​​​​​​​ pvchange 命​​​​​​​令​​​​​​​防​​​​​​​止​​​​​​​在​​​​​​​一​​​​​​​个​​​​​​​或​​​​​​​者​​​​​​​多​​​​​​​个​​​​​​​物​​​​​​​理​​​​​​​卷​​​​​​​的​​​​​​​剩​​​​​​​余​​​​​​​空​​​​​​​间​​​​​​​进​​​​​​​行​​​​​​​物​​​​​​​理​​​​​​​扩​​​​​​​展​​​​​​​分​​​​​​​配​​​​​​​。​​​​​​​这​​​​​​​在​​​​​​​出​​​​​​​现​​​​​​​磁​​​​​​​盘​​​​​​​错​​​​​​​误​​​​​​​或​​​​​​​者​​​​​​​要​​​​​​​删​​​​​​​除​​​​​​​物​​​​​​​理​​​​​​​卷​​​​​​​时​​​​​​​是​​​​​​​很​​​​​​​必​​​​​​​要​​​​​​​的​​​​​​​。​​​​​​​
以​​​​​​​下​​​​​​​命​​​​​​​令​​​​​​​不​​​​​​​允​​​​​​​许​​​​​​​在​​​​​​​ /dev/sdk1 中​​​​​​​分​​​​​​​配​​​​​​​物​​​​​​​理​​​​​​​扩​​​​​​​展​​​​​​​。​​​​​​​
pvchange -x n /dev/sdk1
您​​​​​​​还​​​​​​​可​​​​​​​以​​​​​​​使​​​​​​​用​​​​​​​ pvchange 命​​​​​​​令​​​​​​​的​​​​​​​ -xy 参​​​​​​​数​​​​​​​来​​​​​​​允​​​​​​​许​​​​​​​在​​​​​​​之​​​​​​​前​​​​​​​禁​​​​​​​止​​​​​​​进​​​​​​​行​​​​​​​分​​​​​​​配​​​​​​​的​​​​​​​地​​​​​​​方​​​​​​​分​​​​​​​配​​​​​​​扩​​​​​​​展​​​​​​​。​​​​​​​

4.2.4. 重​​​​​​​新​​​​​​​设​​​​​​​置​​​​​​​物​​​​​​​理​​​​​​​卷​​​​​​​大​​​​​​​小​​​​​​​

如​​​​​​​果​​​​​​​您​​​​​​​由​​​​​​​于​​​​​​​任​​​​​​​何​​​​​​​原​​​​​​​因​​​​​​​需​​​​​​​要​​​​​​​修​​​​​​​改​​​​​​​基​​​​​​​本​​​​​​​块​​​​​​​设​​​​​​​备​​​​​​​的​​​​​​​大​​​​​​​小​​​​​​​,请​​​​​​​使​​​​​​​用​​​​​​​ pvresize 命​​​​​​​令​​​​​​​来​​​​​​​更​​​​​​​新​​​​​​​ LVM 的​​​​​​​大​​​​​​​小​​​​​​​。​​​​​​​您​​​​​​​可​​​​​​​以​​​​​​​在​​​​​​​ LVM 正​​​​​​​在​​​​​​​使​​​​​​​用​​​​​​​物​​​​​​​理​​​​​​​卷​​​​​​​的​​​​​​​时​​​​​​​候​​​​​​​使​​​​​​​用​​​​​​​这​​​​​​​个​​​​​​​命​​​​​​​令​​​​​​​。​​​​​​​

4.2.5. 删​​​​​​​除​​​​​​​物​​​​​​​理​​​​​​​卷​​​​​​​

如​​​​​​​果​​​​​​​ LVM 不​​​​​​​再​​​​​​​使​​​​​​​用​​​​​​​某​​​​​​​个​​​​​​​设​​​​​​​备​​​​​​​,您​​​​​​​可​​​​​​​以​​​​​​​使​​​​​​​用​​​​​​​ pvremove 命​​​​​​​令​​​​​​​删​​​​​​​除​​​​​​​ LVM 标​​​​​​​签​​​​​​​。​​​​​​​执​​​​​​​行​​​​​​​ pvremove 会​​​​​​​将​​​​​​​空​​​​​​​白​​​​​​​物​​​​​​​理​​​​​​​卷​​​​​​​的​​​​​​​ LVM 元​​​​​​​数​​​​​​​据​​​​​​​归​​​​​​​零​​​​​​​。​​​​​​​
If the physical volume you want to remove is currently part of a volume group, you must remove it from the volume group with the vgreduce command, as described in 第 4.3.6 节 “从​​​​​​​卷​​​​​​​组​​​​​​​中​​​​​​​删​​​​​​​除​​​​​​​物​​​​​​​理​​​​​​​卷​​​​​​​”.
# pvremove /dev/ram15
  Labels on physical volume "/dev/ram15" successfully wiped

4.3. 卷​​​​​​​组​​​​​​​管​​​​​​​理​​​​​​​

这​​​​​​​部​​​​​​​分​​​​​​​论​​​​​​​述​​​​​​​用​​​​​​​于​​​​​​​管​​​​​​​理​​​​​​​卷​​​​​​​组​​​​​​​各​​​​​​​个​​​​​​​方​​​​​​​面​​​​​​​的​​​​​​​命​​​​​​​令​​​​​​​。​​​​​​​

4.3.1. 创​​​​​​​建​​​​​​​卷​​​​​​​组​​​​​​​

To create a volume group from one or more physical volumes, use the vgcreate command. The vgcreate command creates a new volume group by name and adds at least one physical volume to it.
以​​​​​​​下​​​​​​​命​​​​​​​令​​​​​​​创​​​​​​​建​​​​​​​一​​​​​​​个​​​​​​​名​​​​​​​为​​​​​​​ vg1 的​​​​​​​卷​​​​​​​组​​​​​​​,其​​​​​​​中​​​​​​​包​​​​​​​含​​​​​​​物​​​​​​​理​​​​​​​卷​​​​​​​ /dev/sdd1 和​​​​​​​ /dev/sde1。​​​​​​​
vgcreate vg1 /dev/sdd1 /dev/sde1
当​​​​​​​使​​​​​​​用​​​​​​​物​​​​​​​理​​​​​​​卷​​​​​​​创​​​​​​​建​​​​​​​卷​​​​​​​组​​​​​​​时​​​​​​​,默​​​​​​​认​​​​​​​情​​​​​​​况​​​​​​​下​​​​​​​,它​​​​​​​的​​​​​​​磁​​​​​​​盘​​​​​​​空​​​​​​​间​​​​​​​被​​​​​​​分​​​​​​​成​​​​​​​大​​​​​​​小​​​​​​​为​​​​​​​ 4MB 的​​​​​​​扩​​​​​​​展​​​​​​​。​​​​​​​这​​​​​​​个​​​​​​​扩​​​​​​​展​​​​​​​是​​​​​​​增​​​​​​​大​​​​​​​或​​​​​​​者​​​​​​​减​​​​​​​小​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​容​​​​​​​量​​​​​​​的​​​​​​​最​​​​​​​小​​​​​​​单​​​​​​​位​​​​​​​。​​​​​​​大​​​​​​​量​​​​​​​的​​​​​​​扩​​​​​​​展​​​​​​​不​​​​​​​会​​​​​​​影​​​​​​​响​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​的​​​​​​​ I/O 性​​​​​​​能​​​​​​​。​​​​​​​
如​​​​​​​果​​​​​​​默​​​​​​​认​​​​​​​设​​​​​​​置​​​​​​​不​​​​​​​适​​​​​​​用​​​​​​​于​​​​​​​ -s 参​​​​​​​数​​​​​​​时​​​​​​​,您​​​​​​​可​​​​​​​以​​​​​​​使​​​​​​​用​​​​​​​ vgcreate 命​​​​​​​令​​​​​​​指​​​​​​​定​​​​​​​扩​​​​​​​展​​​​​​​的​​​​​​​大​​​​​​​小​​​​​​​。​​​​​​​您​​​​​​​可​​​​​​​以​​​​​​​对​​​​​​​卷​​​​​​​组​​​​​​​中​​​​​​​物​​​​​​​理​​​​​​​和​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​的​​​​​​​数​​​​​​​量​​​​​​​进​​​​​​​行​​​​​​​限​​​​​​​制​​​​​​​,方​​​​​​​法​​​​​​​就​​​​​​​是​​​​​​​用​​​​​​​ vgcreate 命​​​​​​​令​​​​​​​的​​​​​​​ -p 和​​​​​​​ -l 参​​​​​​​数​​​​​​​。​​​​​​​
默​​​​​​​认​​​​​​​情​​​​​​​况​​​​​​​下​​​​​​​,卷​​​​​​​组​​​​​​​根​​​​​​​据​​​​​​​一​​​​​​​般​​​​​​​规​​​​​​​则​​​​​​​分​​​​​​​配​​​​​​​物​​​​​​​理​​​​​​​扩​​​​​​​展​​​​​​​,比​​​​​​​如​​​​​​​不​​​​​​​会​​​​​​​将​​​​​​​平​​​​​​​行​​​​​​​条​​​​​​​带​​​​​​​放​​​​​​​在​​​​​​​同​​​​​​​一​​​​​​​个​​​​​​​物​​​​​​​理​​​​​​​卷​​​​​​​中​​​​​​​。​​​​​​​这​​​​​​​就​​​​​​​是​​​​​​​ normal(标​​​​​​​准​​​​​​​)分​​​​​​​配​​​​​​​策​​​​​​​略​​​​​​​。​​​​​​​您​​​​​​​可​​​​​​​以​​​​​​​使​​​​​​​用​​​​​​​ vgcreate 命​​​​​​​令​​​​​​​的​​​​​​​ --alloc 参​​​​​​​数​​​​​​​来​​​​​​​指​​​​​​​定​​​​​​​ contiguous、​​​​​​​anywhere 或​​​​​​​者​​​​​​​ cling 分​​​​​​​配​​​​​​​策​​​​​​​略​​​​​​​。​​​​​​​
contiguous(持​​​​​​​续​​​​​​​) 策​​​​​​​略​​​​​​​要​​​​​​​求​​​​​​​新​​​​​​​的​​​​​​​扩​​​​​​​展​​​​​​​要​​​​​​​和​​​​​​​现​​​​​​​有​​​​​​​的​​​​​​​扩​​​​​​​展​​​​​​​相​​​​​​​邻​​​​​​​。​​​​​​​如​​​​​​​果​​​​​​​没​​​​​​​有​​​​​​​足​​​​​​​够​​​​​​​的​​​​​​​可​​​​​​​用​​​​​​​扩​​​​​​​展​​​​​​​来​​​​​​​满​​​​​​​足​​​​​​​分​​​​​​​配​​​​​​​请​​​​​​​求​​​​​​​,normal(标​​​​​​​准​​​​​​​)分​​​​​​​配​​​​​​​策​​​​​​​略​​​​​​​就​​​​​​​无​​​​​​​法​​​​​​​使​​​​​​​用​​​​​​​它​​​​​​​们​​​​​​​,而​​​​​​​ anywhere(任​​​​​​​意​​​​​​​)分​​​​​​​配​​​​​​​策​​​​​​​略​​​​​​​会​​​​​​​使​​​​​​​用​​​​​​​它​​​​​​​们​​​​​​​,即​​​​​​​使​​​​​​​不​​​​​​​惜​​​​​​​通​​​​​​​过​​​​​​​将​​​​​​​两​​​​​​​个​​​​​​​条​​​​​​​带​​​​​​​放​​​​​​​在​​​​​​​同​​​​​​​一​​​​​​​个​​​​​​​物​​​​​​​理​​​​​​​卷​​​​​​​中​​​​​​​降​​​​​​​低​​​​​​​性​​​​​​​能​​​​​​​。​​​​​​​cling(粘​​​​​​​贴​​​​​​​)分​​​​​​​配​​​​​​​策​​​​​​​略​​​​​​​会​​​​​​​将​​​​​​​新​​​​​​​的​​​​​​​扩​​​​​​​展​​​​​​​放​​​​​​​到​​​​​​​同​​​​​​​一​​​​​​​个​​​​​​​物​​​​​​​理​​​​​​​卷​​​​​​​中​​​​​​​作​​​​​​​为​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​相​​​​​​​同​​​​​​​条​​​​​​​带​​​​​​​中​​​​​​​现​​​​​​​有​​​​​​​的​​​​​​​扩​​​​​​​展​​​​​​​使​​​​​​​用​​​​​​​。​​​​​​​可​​​​​​​使​​​​​​​用​​​​​​​ vgchange 命​​​​​​​令​​​​​​​修​​​​​​​改​​​​​​​这​​​​​​​些​​​​​​​策​​​​​​​略​​​​​​​。​​​​​​​
一​​​​​​​般​​​​​​​说​​​​​​​来​​​​​​​,分​​​​​​​配​​​​​​​策​​​​​​​略​​​​​​​只​​​​​​​在​​​​​​​很​​​​​​​特​​​​​​​殊​​​​​​​的​​​​​​​情​​​​​​​况​​​​​​​下​​​​​​​,也​​​​​​​就​​​​​​​是​​​​​​​说​​​​​​​您​​​​​​​需​​​​​​​要​​​​​​​指​​​​​​​定​​​​​​​非​​​​​​​常​​​​​​​规​​​​​​​或​​​​​​​者​​​​​​​非​​​​​​​标​​​​​​​准​​​​​​​扩​​​​​​​展​​​​​​​分​​​​​​​配​​​​​​​的​​​​​​​时​​​​​​​候​​​​​​​才​​​​​​​会​​​​​​​使​​​​​​​用​​​​​​​标​​​​​​​准​​​​​​​策​​​​​​​略​​​​​​​以​​​​​​​外​​​​​​​的​​​​​​​策​​​​​​​略​​​​​​​。​​​​​​​
LVM 卷​​​​​​​组​​​​​​​和​​​​​​​基​​​​​​​本​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​是​​​​​​​包​​​​​​​含​​​​​​​在​​​​​​​ /dev 目​​​​​​​录​​​​​​​的​​​​​​​设​​​​​​​备​​​​​​​专​​​​​​​用​​​​​​​文​​​​​​​件​​​​​​​目​​​​​​​录​​​​​​​树​​​​​​​中​​​​​​​的​​​​​​​,布​​​​​​​局​​​​​​​如​​​​​​​下​​​​​​​:
/dev/vg/lv/
例​​​​​​​如​​​​​​​:如​​​​​​​果​​​​​​​您​​​​​​​创​​​​​​​建​​​​​​​两​​​​​​​个​​​​​​​卷​​​​​​​组​​​​​​​ myvg1 和​​​​​​​ myvg2,每​​​​​​​个​​​​​​​带​​​​​​​三​​​​​​​个​​​​​​​名​​​​​​​为​​​​​​​ lvo1、​​​​​​​lvo2 和​​​​​​​ lvo3 的​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​,那​​​​​​​么​​​​​​​就​​​​​​​要​​​​​​​创​​​​​​​建​​​​​​​六​​​​​​​个​​​​​​​设​​​​​​​备​​​​​​​专​​​​​​​用​​​​​​​文​​​​​​​件​​​​​​​:
/dev/myvg1/lv01
/dev/myvg1/lv02
/dev/myvg1/lv03
/dev/myvg2/lv01
/dev/myvg2/lv02
/dev/myvg2/lv03
64 位​​​​​​​ CPU 中​​​​​​​ LVM 的​​​​​​​最​​​​​​​大​​​​​​​设​​​​​​​备​​​​​​​大​​​​​​​小​​​​​​​为​​​​​​​ 8EB。​​​​​​​

4.3.2. 在​​​​​​​群​​​​​​​集​​​​​​​中​​​​​​​创​​​​​​​建​​​​​​​卷​​​​​​​组​​​​​​​

在​​​​​​​群​​​​​​​集​​​​​​​环​​​​​​​境​​​​​​​中​​​​​​​使​​​​​​​用​​​​​​​ vgcreate 命​​​​​​​令​​​​​​​创​​​​​​​建​​​​​​​卷​​​​​​​组​​​​​​​就​​​​​​​如​​​​​​​同​​​​​​​在​​​​​​​单​​​​​​​一​​​​​​​节​​​​​​​点​​​​​​​中​​​​​​​创​​​​​​​建​​​​​​​卷​​​​​​​组​​​​​​​。​​​​​​​
默​​​​​​​认​​​​​​​情​​​​​​​况​​​​​​​下​​​​​​​,在​​​​​​​所​​​​​​​有​​​​​​​可​​​​​​​访​​​​​​​问​​​​​​​共​​​​​​​享​​​​​​​存​​​​​​​储​​​​​​​的​​​​​​​计​​​​​​​算​​​​​​​机​​​​​​​中​​​​​​​都​​​​​​​可​​​​​​​看​​​​​​​到​​​​​​​ CLVM 在​​​​​​​共​​​​​​​享​​​​​​​存​​​​​​​储​​​​​​​中​​​​​​​创​​​​​​​建​​​​​​​的​​​​​​​卷​​​​​​​组​​​​​​​。​​​​​​​但​​​​​​​有​​​​​​​可​​​​​​​能​​​​​​​在​​​​​​​使​​​​​​​用​​​​​​​带​​​​​​​ -c n 选​​​​​​​项​​​​​​​的​​​​​​​ vgcreate 命​​​​​​​令​​​​​​​创​​​​​​​建​​​​​​​的​​​​​​​本​​​​​​​地​​​​​​​卷​​​​​​​组​​​​​​​,只​​​​​​​能​​​​​​​在​​​​​​​群​​​​​​​集​​​​​​​的​​​​​​​一​​​​​​​个​​​​​​​节​​​​​​​点​​​​​​​中​​​​​​​看​​​​​​​到​​​​​​​。​​​​​​​
当​​​​​​​在​​​​​​​群​​​​​​​集​​​​​​​环​​​​​​​境​​​​​​​中​​​​​​​执​​​​​​​行​​​​​​​以​​​​​​​下​​​​​​​命​​​​​​​令​​​​​​​时​​​​​​​,创​​​​​​​建​​​​​​​的​​​​​​​卷​​​​​​​组​​​​​​​对​​​​​​​执​​​​​​​行​​​​​​​该​​​​​​​命​​​​​​​令​​​​​​​的​​​​​​​节​​​​​​​点​​​​​​​来​​​​​​​说​​​​​​​是​​​​​​​本​​​​​​​地​​​​​​​的​​​​​​​。​​​​​​​该​​​​​​​命​​​​​​​令​​​​​​​创​​​​​​​建​​​​​​​一​​​​​​​个​​​​​​​名​​​​​​​为​​​​​​​ vg1 的​​​​​​​卷​​​​​​​组​​​​​​​,其​​​​​​​中​​​​​​​包​​​​​​​含​​​​​​​物​​​​​​​理​​​​​​​卷​​​​​​​ /dev/sdd1 和​​​​​​​ /dev/sde1。​​​​​​​
vgcreate -c n vg1 /dev/sdd1 /dev/sde1
You can change whether an existing volume group is local or clustered with the -c option of the vgchange command, which is described in 第 4.3.7 节 “修​​​​​​​改​​​​​​​卷​​​​​​​组​​​​​​​参​​​​​​​数​​​​​​​”.
您​​​​​​​可​​​​​​​以​​​​​​​使​​​​​​​用​​​​​​​ vgs 命​​​​​​​令​​​​​​​查​​​​​​​看​​​​​​​现​​​​​​​有​​​​​​​卷​​​​​​​组​​​​​​​是​​​​​​​否​​​​​​​为​​​​​​​群​​​​​​​集​​​​​​​卷​​​​​​​组​​​​​​​,如​​​​​​​是​​​​​​​则​​​​​​​会​​​​​​​显​​​​​​​示​​​​​​​ c 属​​​​​​​性​​​​​​​。​​​​​​​以​​​​​​​下​​​​​​​命​​​​​​​令​​​​​​​显​​​​​​​示​​​​​​​卷​​​​​​​组​​​​​​​ VolGroup00 和​​​​​​​ testvg1 的​​​​​​​属​​​​​​​性​​​​​​​。​​​​​​​在​​​​​​​这​​​​​​​个​​​​​​​示​​​​​​​例​​​​​​​中​​​​​​​,VolGroup00 不​​​​​​​是​​​​​​​群​​​​​​​集​​​​​​​的​​​​​​​,而​​​​​​​ testvg1 是​​​​​​​群​​​​​​​集​​​​​​​的​​​​​​​,如​​​​​​​ Attr 标​​​​​​​题​​​​​​​下​​​​​​​的​​​​​​​ c 属​​​​​​​性​​​​​​​所​​​​​​​示​​​​​​​。​​​​​​​
[root@doc-07]# vgs
  VG            #PV #LV #SN Attr   VSize  VFree
  VolGroup00      1   2   0 wz--n- 19.88G    0
  testvg1         1   1   0 wz--nc 46.00G 8.00M

4.3.3. 在​​​​​​​卷​​​​​​​组​​​​​​​中​​​​​​​添​​​​​​​加​​​​​​​物​​​​​​​理​​​​​​​卷​​​​​​​

To add additional physical volumes to an existing volume group, use the vgextend command. The vgextend command increases a volume group's capacity by adding one or more free physical volumes.
以​​​​​​​下​​​​​​​命​​​​​​​令​​​​​​​可​​​​​​​将​​​​​​​物​​​​​​​理​​​​​​​卷​​​​​​​ /dev/sdf1 添​​​​​​​加​​​​​​​到​​​​​​​卷​​​​​​​组​​​​​​​ vg1 中​​​​​​​。​​​​​​​
vgextend vg1 /dev/sdf1

4.3.4. 显​​​​​​​示​​​​​​​卷​​​​​​​组​​​​​​​

您​​​​​​​可​​​​​​​以​​​​​​​使​​​​​​​用​​​​​​​两​​​​​​​个​​​​​​​命​​​​​​​令​​​​​​​来​​​​​​​显​​​​​​​示​​​​​​​ LVM 卷​​​​​​​组​​​​​​​的​​​​​​​属​​​​​​​性​​​​​​​:vgs 和​​​​​​​ vgdisplay。​​​​​​​
The vgs command provides volume group information in a configurable form, displaying one line per volume group. The vgs command provides a great deal of format control, and is useful for scripting. For information on using the vgs command to customize your output, see 第 4.9 节 “为​​​​​​​ LVM 自​​​​​​​定​​​​​​​义​​​​​​​报​​​​​​​告​​​​​​​”.
vgdisplay 命​​​​​​​令​​​​​​​以​​​​​​​固​​​​​​​定​​​​​​​格​​​​​​​式​​​​​​​显​​​​​​​示​​​​​​​卷​​​​​​​组​​​​​​​属​​​​​​​性​​​​​​​(比​​​​​​​如​​​​​​​大​​​​​​​小​​​​​​​、​​​​​​​扩​​​​​​​展​​​​​​​、​​​​​​​物​​​​​​​理​​​​​​​卷​​​​​​​数​​​​​​​量​​​​​​​等​​​​​​​等​​​​​​​)。​​​​​​​下​​​​​​​面​​​​​​​的​​​​​​​例​​​​​​​子​​​​​​​就​​​​​​​是​​​​​​​对​​​​​​​卷​​​​​​​组​​​​​​​ new_vg 执​​​​​​​行​​​​​​​ vgdisplay 命​​​​​​​令​​​​​​​时​​​​​​​的​​​​​​​输​​​​​​​出​​​​​​​结​​​​​​​果​​​​​​​。​​​​​​​如​​​​​​​果​​​​​​​您​​​​​​​没​​​​​​​有​​​​​​​指​​​​​​​定​​​​​​​卷​​​​​​​组​​​​​​​,那​​​​​​​么​​​​​​​就​​​​​​​会​​​​​​​列​​​​​​​出​​​​​​​所​​​​​​​有​​​​​​​现​​​​​​​有​​​​​​​的​​​​​​​卷​​​​​​​组​​​​​​​。​​​​​​​
# vgdisplay new_vg
  --- Volume group ---
  VG Name               new_vg
  System ID
  Format                lvm2
  Metadata Areas        3
  Metadata Sequence No  11
  VG Access             read/write
  VG Status             resizable
  MAX LV                0
  Cur LV                1
  Open LV               0
  Max PV                0
  Cur PV                3
  Act PV                3
  VG Size               51.42 GB
  PE Size               4.00 MB
  Total PE              13164
  Alloc PE / Size       13 / 52.00 MB
  Free  PE / Size       13151 / 51.37 GB
  VG UUID               jxQJ0a-ZKk0-OpMO-0118-nlwO-wwqd-fD5D32

4.3.5. 为​​​​​​​卷​​​​​​​组​​​​​​​扫​​​​​​​描​​​​​​​磁​​​​​​​盘​​​​​​​来​​​​​​​建​​​​​​​立​​​​​​​缓​​​​​​​存​​​​​​​文​​​​​​​件​​​​​​​

vgscan 命​​​​​​​令​​​​​​​在​​​​​​​系​​​​​​​统​​​​​​​中​​​​​​​扫​​​​​​​描​​​​​​​所​​​​​​​有​​​​​​​支​​​​​​​持​​​​​​​的​​​​​​​磁​​​​​​​盘​​​​​​​设​​​​​​​备​​​​​​​来​​​​​​​查​​​​​​​找​​​​​​​ LVM 物​​​​​​​理​​​​​​​卷​​​​​​​和​​​​​​​卷​​​​​​​组​​​​​​​。​​​​​​​这​​​​​​​样​​​​​​​就​​​​​​​在​​​​​​​ /etc/lvm/.cache 中​​​​​​​建​​​​​​​立​​​​​​​了​​​​​​​一​​​​​​​个​​​​​​​ LVM 缓​​​​​​​存​​​​​​​文​​​​​​​件​​​​​​​,该​​​​​​​文​​​​​​​件​​​​​​​可​​​​​​​维​​​​​​​护​​​​​​​当​​​​​​​前​​​​​​​列​​​​​​​出​​​​​​​的​​​​​​​ LVM 设​​​​​​​备​​​​​​​。​​​​​​​
LVM 在​​​​​​​系​​​​​​​统​​​​​​​启​​​​​​​动​​​​​​​以​​​​​​​及​​​​​​​进​​​​​​​行​​​​​​​ LVM 操​​​​​​​作​​​​​​​时​​​​​​​自​​​​​​​动​​​​​​​运​​​​​​​行​​​​​​​ vgscan 命​​​​​​​令​​​​​​​,比​​​​​​​如​​​​​​​您​​​​​​​执​​​​​​​行​​​​​​​ vgcreate 命​​​​​​​令​​​​​​​或​​​​​​​者​​​​​​​当​​​​​​​ LVM 检​​​​​​​测​​​​​​​到​​​​​​​不​​​​​​​一​​​​​​​致​​​​​​​性​​​​​​​时​​​​​​​。​​​​​​​您​​​​​​​可​​​​​​​能​​​​​​​在​​​​​​​修​​​​​​​改​​​​​​​硬​​​​​​​件​​​​​​​配​​​​​​​置​​​​​​​时​​​​​​​需​​​​​​​要​​​​​​​手​​​​​​​动​​​​​​​运​​​​​​​行​​​​​​​ vgscan,这​​​​​​​样​​​​​​​可​​​​​​​以​​​​​​​让​​​​​​​系​​​​​​​统​​​​​​​识​​​​​​​别​​​​​​​在​​​​​​​引​​​​​​​导​​​​​​​时​​​​​​​没​​​​​​​有​​​​​​​出​​​​​​​现​​​​​​​的​​​​​​​新​​​​​​​设​​​​​​​备​​​​​​​。​​​​​​​例​​​​​​​如​​​​​​​:当​​​​​​​您​​​​​​​在​​​​​​​ SAN 中​​​​​​​的​​​​​​​一​​​​​​​个​​​​​​​系​​​​​​​统​​​​​​​中​​​​​​​添​​​​​​​加​​​​​​​了​​​​​​​新​​​​​​​磁​​​​​​​盘​​​​​​​或​​​​​​​者​​​​​​​热​​​​​​​插​​​​​​​拔​​​​​​​一​​​​​​​个​​​​​​​已​​​​​​​经​​​​​​​被​​​​​​​标​​​​​​​记​​​​​​​为​​​​​​​物​​​​​​​理​​​​​​​卷​​​​​​​的​​​​​​​新​​​​​​​磁​​​​​​​盘​​​​​​​时​​​​​​​,这​​​​​​​应​​​​​​​该​​​​​​​是​​​​​​​很​​​​​​​需​​​​​​​要​​​​​​​的​​​​​​​。​​​​​​​
下​​​​​​​面​​​​​​​的​​​​​​​例​​​​​​​子​​​​​​​显​​​​​​​示​​​​​​​了​​​​​​​ vgscan 命​​​​​​​令​​​​​​​的​​​​​​​输​​​​​​​出​​​​​​​结​​​​​​​果​​​​​​​。​​​​​​​
# vgscan
  Reading all physical volumes.  This may take a while...
  Found volume group "new_vg" using metadata type lvm2
  Found volume group "officevg" using metadata type lvm2

4.3.6. 从​​​​​​​卷​​​​​​​组​​​​​​​中​​​​​​​删​​​​​​​除​​​​​​​物​​​​​​​理​​​​​​​卷​​​​​​​

To remove unused physical volumes from a volume group, use the vgreduce command. The vgreduce command shrinks a volume group's capacity by removing one or more empty physical volumes. This frees those physical volumes to be used in different volume groups or to be removed from the system.
在​​​​​​​您​​​​​​​从​​​​​​​卷​​​​​​​组​​​​​​​中​​​​​​​删​​​​​​​除​​​​​​​物​​​​​​​理​​​​​​​卷​​​​​​​之​​​​​​​前​​​​​​​,您​​​​​​​可​​​​​​​以​​​​​​​使​​​​​​​用​​​​​​​ pvdisplay 命​​​​​​​令​​​​​​​确​​​​​​​定​​​​​​​物​​​​​​​理​​​​​​​卷​​​​​​​没​​​​​​​有​​​​​​​被​​​​​​​任​​​​​​​何​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​使​​​​​​​用​​​​​​​。​​​​​​​
# pvdisplay /dev/hda1

-- Physical volume ---
PV Name               /dev/hda1
VG Name               myvg
PV Size               1.95 GB / NOT usable 4 MB [LVM: 122 KB]
PV#                   1
PV Status             available
Allocatable           yes (but full)
Cur LV                1
PE Size (KByte)       4096
Total PE              499
Free PE               0
Allocated PE          499
PV UUID               Sd44tK-9IRw-SrMC-MOkn-76iP-iftz-OVSen7
如​​​​​​​果​​​​​​​物​​​​​​​理​​​​​​​卷​​​​​​​仍​​​​​​​然​​​​​​​在​​​​​​​使​​​​​​​用​​​​​​​,您​​​​​​​可​​​​​​​能​​​​​​​必​​​​​​​须​​​​​​​使​​​​​​​用​​​​​​​ pvmove 命​​​​​​​令​​​​​​​将​​​​​​​数​​​​​​​据​​​​​​​迁​​​​​​​移​​​​​​​到​​​​​​​另​​​​​​​一​​​​​​​个​​​​​​​物​​​​​​​理​​​​​​​卷​​​​​​​。​​​​​​​然​​​​​​​后​​​​​​​使​​​​​​​用​​​​​​​ vgreduce 命​​​​​​​令​​​​​​​删​​​​​​​除​​​​​​​该​​​​​​​物​​​​​​​理​​​​​​​卷​​​​​​​:
以​​​​​​​下​​​​​​​命​​​​​​​令​​​​​​​可​​​​​​​从​​​​​​​卷​​​​​​​组​​​​​​​ my_volume_group 中​​​​​​​删​​​​​​​除​​​​​​​物​​​​​​​理​​​​​​​卷​​​​​​​ /dev/hda1。​​​​​​​
# vgreduce my_volume_group /dev/hda1

4.3.7. 修​​​​​​​改​​​​​​​卷​​​​​​​组​​​​​​​参​​​​​​​数​​​​​​​

There are several volume group parameters that you can change for an existing volume group with the vgchange command. Primarily, however, this command is used to deactivate and activate volume groups, as described in 第 4.3.8 节 “激​​​​​​​活​​​​​​​和​​​​​​​失​​​​​​​活​​​​​​​卷​​​​​​​组​​​​​​​”,
下​​​​​​​面​​​​​​​的​​​​​​​命​​​​​​​令​​​​​​​将​​​​​​​卷​​​​​​​组​​​​​​​ vg00 的​​​​​​​包​​​​​​​含​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​的​​​​​​​最​​​​​​​大​​​​​​​数​​​​​​​量​​​​​​​改​​​​​​​为​​​​​​​ 128。​​​​​​​
vgchange -l 128 /dev/vg00
有​​​​​​​关​​​​​​​ vgchange 命​​​​​​​令​​​​​​​的​​​​​​​卷​​​​​​​组​​​​​​​参​​​​​​​数​​​​​​​的​​​​​​​论​​​​​​​述​​​​​​​请​​​​​​​参​​​​​​​考​​​​​​​ vgchange(8) man page。​​​​​​​

4.3.8. 激​​​​​​​活​​​​​​​和​​​​​​​失​​​​​​​活​​​​​​​卷​​​​​​​组​​​​​​​

当​​​​​​​您​​​​​​​创​​​​​​​建​​​​​​​一​​​​​​​个​​​​​​​卷​​​​​​​组​​​​​​​时​​​​​​​,默​​​​​​​认​​​​​​​情​​​​​​​况​​​​​​​下​​​​​​​它​​​​​​​是​​​​​​​激​​​​​​​活​​​​​​​的​​​​​​​。​​​​​​​这​​​​​​​就​​​​​​​是​​​​​​​说​​​​​​​该​​​​​​​组​​​​​​​中​​​​​​​的​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​是​​​​​​​可​​​​​​​访​​​​​​​问​​​​​​​,也​​​​​​​可​​​​​​​修​​​​​​​改​​​​​​​的​​​​​​​。​​​​​​​
有​​​​​​​一​​​​​​​些​​​​​​​情​​​​​​​况​​​​​​​需​​​​​​​要​​​​​​​您​​​​​​​失​​​​​​​活​​​​​​​卷​​​​​​​组​​​​​​​,使​​​​​​​其​​​​​​​无​​​​​​​法​​​​​​​被​​​​​​​内​​​​​​​核​​​​​​​识​​​​​​​别​​​​​​​。​​​​​​​要​​​​​​​失​​​​​​​活​​​​​​​或​​​​​​​者​​​​​​​激​​​​​​​活​​​​​​​卷​​​​​​​组​​​​​​​,请​​​​​​​使​​​​​​​用​​​​​​​ vgchange 命​​​​​​​令​​​​​​​的​​​​​​​ -a--available)参​​​​​​​数​​​​​​​。​​​​​​​
下​​​​​​​面​​​​​​​的​​​​​​​例​​​​​​​子​​​​​​​失​​​​​​​活​​​​​​​了​​​​​​​卷​​​​​​​组​​​​​​​ my_volume_group。​​​​​​​
vgchange -a n my_volume_group
如​​​​​​​果​​​​​​​启​​​​​​​用​​​​​​​了​​​​​​​群​​​​​​​集​​​​​​​的​​​​​​​锁​​​​​​​定​​​​​​​,添​​​​​​​加​​​​​​​‘​​​​​​​e’​​​​​​​来​​​​​​​激​​​​​​​活​​​​​​​或​​​​​​​者​​​​​​​失​​​​​​​活​​​​​​​完​​​​​​​全​​​​​​​占​​​​​​​据​​​​​​​一​​​​​​​个​​​​​​​节​​​​​​​点​​​​​​​的​​​​​​​卷​​​​​​​组​​​​​​​,或​​​​​​​者​​​​​​​添​​​​​​​加​​​​​​​‘​​​​​​​l’​​​​​​​来​​​​​​​激​​​​​​​活​​​​​​​或​​​​​​​者​​​​​​​失​​​​​​​活​​​​​​​只​​​​​​​位​​​​​​​于​​​​​​​本​​​​​​​地​​​​​​​节​​​​​​​点​​​​​​​的​​​​​​​卷​​​​​​​组​​​​​​​。​​​​​​​带​​​​​​​单​​​​​​​一​​​​​​​主​​​​​​​机​​​​​​​快​​​​​​​照​​​​​​​的​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​总​​​​​​​是​​​​​​​被​​​​​​​完​​​​​​​全​​​​​​​激​​​​​​​活​​​​​​​,因​​​​​​​为​​​​​​​他​​​​​​​们​​​​​​​一​​​​​​​次​​​​​​​只​​​​​​​能​​​​​​​在​​​​​​​一​​​​​​​个​​​​​​​节​​​​​​​点​​​​​​​上​​​​​​​使​​​​​​​用​​​​​​​。​​​​​​​

4.3.9. 删​​​​​​​除​​​​​​​卷​​​​​​​组​​​​​​​

要​​​​​​​删​​​​​​​除​​​​​​​不​​​​​​​包​​​​​​​含​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​的​​​​​​​卷​​​​​​​组​​​​​​​,请​​​​​​​使​​​​​​​用​​​​​​​ vgremove 命​​​​​​​令​​​​​​​。​​​​​​​
# vgremove officevg
  Volume group "officevg" successfully removed

4.3.10. 分​​​​​​​割​​​​​​​卷​​​​​​​组​​​​​​​

要​​​​​​​分​​​​​​​割​​​​​​​卷​​​​​​​组​​​​​​​的​​​​​​​物​​​​​​​理​​​​​​​卷​​​​​​​并​​​​​​​创​​​​​​​建​​​​​​​新​​​​​​​的​​​​​​​卷​​​​​​​组​​​​​​​,请​​​​​​​使​​​​​​​用​​​​​​​ vgsplit 命​​​​​​​令​​​​​​​。​​​​​​​
无​​​​​​​法​​​​​​​在​​​​​​​卷​​​​​​​组​​​​​​​间​​​​​​​分​​​​​​​割​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​。​​​​​​​每​​​​​​​个​​​​​​​现​​​​​​​有​​​​​​​的​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​必​​​​​​​须​​​​​​​完​​​​​​​整​​​​​​​地​​​​​​​存​​​​​​​在​​​​​​​于​​​​​​​物​​​​​​​理​​​​​​​卷​​​​​​​中​​​​​​​来​​​​​​​构​​​​​​​成​​​​​​​旧​​​​​​​的​​​​​​​或​​​​​​​者​​​​​​​新​​​​​​​的​​​​​​​卷​​​​​​​组​​​​​​​。​​​​​​​如​​​​​​​果​​​​​​​需​​​​​​​要​​​​​​​,您​​​​​​​可​​​​​​​以​​​​​​​使​​​​​​​用​​​​​​​ pvmove 命​​​​​​​令​​​​​​​来​​​​​​​进​​​​​​​行​​​​​​​强​​​​​​​制​​​​​​​分​​​​​​​割​​​​​​​。​​​​​​​
下​​​​​​​面​​​​​​​的​​​​​​​例​​​​​​​子​​​​​​​将​​​​​​​新​​​​​​​的​​​​​​​卷​​​​​​​组​​​​​​​ smallvg 从​​​​​​​原​​​​​​​来​​​​​​​的​​​​​​​卷​​​​​​​组​​​​​​​ bigvg 中​​​​​​​分​​​​​​​割​​​​​​​出​​​​​​​来​​​​​​​。​​​​​​​
# vgsplit bigvg smallvg /dev/ram15
  Volume group "smallvg" successfully split from "bigvg"

4.3.11. 合​​​​​​​并​​​​​​​卷​​​​​​​组​​​​​​​

Two combine two volume groups into a single volume group, use the vgmerge command. You can merge an inactive "source" volume with an active or an inactive "destination" volume if the physical extent sizes of the volume are equal and the physical and logical volume summaries of both volume groups fit into the destination volume groups limits.
下​​​​​​​面​​​​​​​的​​​​​​​命​​​​​​​令​​​​​​​将​​​​​​​失​​​​​​​活​​​​​​​卷​​​​​​​组​​​​​​​ my_vg 归​​​​​​​并​​​​​​​到​​​​​​​激​​​​​​​活​​​​​​​或​​​​​​​者​​​​​​​失​​​​​​​活​​​​​​​的​​​​​​​卷​​​​​​​组​​​​​​​ databases 中​​​​​​​,给​​​​​​​出​​​​​​​详​​​​​​​细​​​​​​​的​​​​​​​运​​​​​​​行​​​​​​​时​​​​​​​信​​​​​​​息​​​​​​​。​​​​​​​
vgmerge -v databases my_vg

4.3.12. 备​​​​​​​份​​​​​​​卷​​​​​​​组​​​​​​​元​​​​​​​数​​​​​​​据​​​​​​​

在​​​​​​​每​​​​​​​次​​​​​​​修​​​​​​​改​​​​​​​卷​​​​​​​组​​​​​​​和​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​配​​​​​​​置​​​​​​​时​​​​​​​都​​​​​​​会​​​​​​​自​​​​​​​动​​​​​​​进​​​​​​​行​​​​​​​元​​​​​​​数​​​​​​​据​​​​​​​备​​​​​​​份​​​​​​​和​​​​​​​归​​​​​​​档​​​​​​​,除​​​​​​​非​​​​​​​您​​​​​​​在​​​​​​​ lvm.conf 文​​​​​​​件​​​​​​​中​​​​​​​禁​​​​​​​用​​​​​​​该​​​​​​​功​​​​​​​能​​​​​​​。​​​​​​​在​​​​​​​默​​​​​​​认​​​​​​​情​​​​​​​况​​​​​​​下​​​​​​​,元​​​​​​​数​​​​​​​据​​​​​​​备​​​​​​​份​​​​​​​保​​​​​​​存​​​​​​​在​​​​​​​ /etc/lvm/backup 文​​​​​​​件​​​​​​​中​​​​​​​,元​​​​​​​数​​​​​​​据​​​​​​​归​​​​​​​档​​​​​​​保​​​​​​​存​​​​​​​在​​​​​​​ /etc/lvm/archives 中​​​​​​​。​​​​​​​您​​​​​​​可​​​​​​​以​​​​​​​手​​​​​​​动​​​​​​​使​​​​​​​用​​​​​​​ vgcfgbackup 命​​​​​​​令​​​​​​​将​​​​​​​元​​​​​​​数​​​​​​​据​​​​​​​备​​​​​​​份​​​​​​​到​​​​​​​ /etc/lvm/backup 文​​​​​​​件​​​​​​​中​​​​​​​。​​​​​​​
vgcfrestore 命​​​​​​​令​​​​​​​可​​​​​​​为​​​​​​​卷​​​​​​​组​​​​​​​中​​​​​​​的​​​​​​​所​​​​​​​有​​​​​​​物​​​​​​​理​​​​​​​卷​​​​​​​从​​​​​​​归​​​​​​​档​​​​​​​中​​​​​​​恢​​​​​​​复​​​​​​​卷​​​​​​​组​​​​​​​的​​​​​​​元​​​​​​​数​​​​​​​据​​​​​​​。​​​​​​​

4.3.13. 重​​​​​​​命​​​​​​​名​​​​​​​卷​​​​​​​组​​​​​​​

使​​​​​​​用​​​​​​​ vgrename 命​​​​​​​令​​​​​​​来​​​​​​​重​​​​​​​新​​​​​​​命​​​​​​​名​​​​​​​一​​​​​​​个​​​​​​​现​​​​​​​有​​​​​​​的​​​​​​​卷​​​​​​​组​​​​​​​。​​​​​​​
可​​​​​​​使​​​​​​​用​​​​​​​以​​​​​​​下​​​​​​​命​​​​​​​令​​​​​​​的​​​​​​​之​​​​​​​一​​​​​​​将​​​​​​​现​​​​​​​有​​​​​​​卷​​​​​​​组​​​​​​​ vg02 重​​​​​​​新​​​​​​​命​​​​​​​名​​​​​​​为​​​​​​​ my_volume_group。​​​​​​​
vgrename /dev/vg02 /dev/my_volume_group
vgrename vg02 my_volume_group

4.3.14. 将​​​​​​​卷​​​​​​​组​​​​​​​移​​​​​​​动​​​​​​​到​​​​​​​其​​​​​​​它​​​​​​​系​​​​​​​统​​​​​​​中​​​​​​​

您​​​​​​​可​​​​​​​以​​​​​​​将​​​​​​​整​​​​​​​个​​​​​​​ LVM 卷​​​​​​​组​​​​​​​移​​​​​​​动​​​​​​​到​​​​​​​另​​​​​​​一​​​​​​​个​​​​​​​系​​​​​​​统​​​​​​​中​​​​​​​。​​​​​​​建​​​​​​​议​​​​​​​您​​​​​​​使​​​​​​​用​​​​​​​ vgexport 和​​​​​​​ vgimport 命​​​​​​​令​​​​​​​进​​​​​​​行​​​​​​​此​​​​​​​操​​​​​​​作​​​​​​​。​​​​​​​
vgexport 使​​​​​​​系​​​​​​​统​​​​​​​无​​​​​​​法​​​​​​​访​​​​​​​问​​​​​​​失​​​​​​​活​​​​​​​卷​​​​​​​组​​​​​​​,这​​​​​​​样​​​​​​​可​​​​​​​允​​​​​​​许​​​​​​​您​​​​​​​卸​​​​​​​去​​​​​​​其​​​​​​​物​​​​​​​理​​​​​​​卷​​​​​​​。​​​​​​​vgimport 命​​​​​​​令​​​​​​​可​​​​​​​在​​​​​​​ vgexport 命​​​​​​​令​​​​​​​使​​​​​​​卷​​​​​​​组​​​​​​​失​​​​​​​活​​​​​​​后​​​​​​​让​​​​​​​机​​​​​​​器​​​​​​​可​​​​​​​以​​​​​​​重​​​​​​​新​​​​​​​访​​​​​​​问​​​​​​​该​​​​​​​卷​​​​​​​组​​​​​​​。​​​​​​​
要​​​​​​​将​​​​​​​一​​​​​​​个​​​​​​​卷​​​​​​​组​​​​​​​从​​​​​​​一​​​​​​​个​​​​​​​系​​​​​​​统​​​​​​​移​​​​​​​动​​​​​​​到​​​​​​​另​​​​​​​一​​​​​​​个​​​​​​​系​​​​​​​统​​​​​​​,请​​​​​​​执​​​​​​​行​​​​​​​以​​​​​​​下​​​​​​​步​​​​​​​骤​​​​​​​:
  1. 确​​​​​​​定​​​​​​​没​​​​​​​有​​​​​​​用​​​​​​​户​​​​​​​正​​​​​​​在​​​​​​​访​​​​​​​问​​​​​​​卷​​​​​​​组​​​​​​​中​​​​​​​激​​​​​​​活​​​​​​​卷​​​​​​​中​​​​​​​的​​​​​​​文​​​​​​​件​​​​​​​,然​​​​​​​后​​​​​​​卸​​​​​​​载​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​。​​​​​​​
  2. 使​​​​​​​用​​​​​​​ vgchange 命​​​​​​​令​​​​​​​的​​​​​​​ -a n 参​​​​​​​数​​​​​​​将​​​​​​​卷​​​​​​​组​​​​​​​标​​​​​​​记​​​​​​​为​​​​​​​失​​​​​​​活​​​​​​​,这​​​​​​​样​​​​​​​可​​​​​​​防​​​​​​​止​​​​​​​在​​​​​​​该​​​​​​​卷​​​​​​​组​​​​​​​中​​​​​​​进​​​​​​​行​​​​​​​任​​​​​​​何​​​​​​​进​​​​​​​一​​​​​​​步​​​​​​​的​​​​​​​操​​​​​​​作​​​​​​​。​​​​​​​
  3. 使​​​​​​​用​​​​​​​ vgexport 命​​​​​​​令​​​​​​​导​​​​​​​出​​​​​​​卷​​​​​​​组​​​​​​​。​​​​​​​这​​​​​​​样​​​​​​​可​​​​​​​防​​​​​​​止​​​​​​​您​​​​​​​要​​​​​​​将​​​​​​​其​​​​​​​从​​​​​​​中​​​​​​​删​​​​​​​除​​​​​​​的​​​​​​​系​​​​​​​统​​​​​​​访​​​​​​​问​​​​​​​该​​​​​​​卷​​​​​​​组​​​​​​​。​​​​​​​
    在​​​​​​​您​​​​​​​导​​​​​​​出​​​​​​​卷​​​​​​​组​​​​​​​后​​​​​​​,在​​​​​​​执​​​​​​​行​​​​​​​ pvscan 命​​​​​​​令​​​​​​​时​​​​​​​,物​​​​​​​理​​​​​​​卷​​​​​​​会​​​​​​​在​​​​​​​导​​​​​​​出​​​​​​​的​​​​​​​物​​​​​​​理​​​​​​​卷​​​​​​​中​​​​​​​显​​​​​​​示​​​​​​​,如​​​​​​​下​​​​​​​。​​​​​​​
    [root@tng3-1]# pvscan
      PV /dev/sda1    is in exported VG myvg [17.15 GB / 7.15 GB free]
      PV /dev/sdc1    is in exported VG myvg [17.15 GB / 15.15 GB free]
      PV /dev/sdd1   is in exported VG myvg [17.15 GB / 15.15 GB free]
      ...
    
    当​​​​​​​关​​​​​​​闭​​​​​​​系​​​​​​​统​​​​​​​时​​​​​​​,您​​​​​​​可​​​​​​​以​​​​​​​拔​​​​​​​出​​​​​​​组​​​​​​​成​​​​​​​该​​​​​​​卷​​​​​​​组​​​​​​​的​​​​​​​磁​​​​​​​盘​​​​​​​并​​​​​​​将​​​​​​​它​​​​​​​们​​​​​​​连​​​​​​​接​​​​​​​到​​​​​​​新​​​​​​​的​​​​​​​系​​​​​​​统​​​​​​​中​​​​​​​。​​​​​​​
  4. 当​​​​​​​将​​​​​​​磁​​​​​​​盘​​​​​​​插​​​​​​​入​​​​​​​新​​​​​​​的​​​​​​​系​​​​​​​统​​​​​​​,使​​​​​​​用​​​​​​​ vgimport 命​​​​​​​令​​​​​​​导​​​​​​​入​​​​​​​卷​​​​​​​组​​​​​​​,并​​​​​​​使​​​​​​​新​​​​​​​的​​​​​​​系​​​​​​​统​​​​​​​可​​​​​​​以​​​​​​​访​​​​​​​问​​​​​​​该​​​​​​​卷​​​​​​​组​​​​​​​。​​​​​​​
  5. 用​​​​​​​ vgchange 命​​​​​​​令​​​​​​​的​​​​​​​ -a y 参​​​​​​​数​​​​​​​激​​​​​​​活​​​​​​​卷​​​​​​​组​​​​​​​。​​​​​​​
  6. 挂​​​​​​​载​​​​​​​文​​​​​​​件​​​​​​​系​​​​​​​统​​​​​​​使​​​​​​​其​​​​​​​可​​​​​​​用​​​​​​​。​​​​​​​

4.3.15. 重​​​​​​​新​​​​​​​创​​​​​​​建​​​​​​​卷​​​​​​​组​​​​​​​目​​​​​​​录​​​​​​​

要​​​​​​​重​​​​​​​新​​​​​​​创​​​​​​​建​​​​​​​卷​​​​​​​组​​​​​​​目​​​​​​​录​​​​​​​和​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​专​​​​​​​用​​​​​​​文​​​​​​​件​​​​​​​,请​​​​​​​使​​​​​​​用​​​​​​​ vgmknodes 命​​​​​​​令​​​​​​​。​​​​​​​这​​​​​​​个​​​​​​​命​​​​​​​令​​​​​​​会​​​​​​​检​​​​​​​查​​​​​​​位​​​​​​​于​​​​​​​ /dev 目​​​​​​​录​​​​​​​中​​​​​​​用​​​​​​​来​​​​​​​激​​​​​​​活​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​的​​​​​​​ LVM2 专​​​​​​​用​​​​​​​文​​​​​​​件​​​​​​​。​​​​​​​它​​​​​​​创​​​​​​​建​​​​​​​所​​​​​​​有​​​​​​​丢​​​​​​​失​​​​​​​的​​​​​​​专​​​​​​​用​​​​​​​文​​​​​​​件​​​​​​​,并​​​​​​​删​​​​​​​除​​​​​​​不​​​​​​​使​​​​​​​用​​​​​​​的​​​​​​​文​​​​​​​件​​​​​​​。​​​​​​​
您​​​​​​​可​​​​​​​以​​​​​​​通​​​​​​​过​​​​​​​在​​​​​​​命​​​​​​​令​​​​​​​中​​​​​​​指​​​​​​​定​​​​​​​ --mknodes 参​​​​​​​数​​​​​​​来​​​​​​​将​​​​​​​ vgmknodes 命​​​​​​​令​​​​​​​整​​​​​​​合​​​​​​​到​​​​​​​ vgscan 命​​​​​​​令​​​​​​​中​​​​​​​。​​​​​​​

4.4. 逻​​​​​​​辑​​​​​​​卷​​​​​​​管​​​​​​​理​​​​​​​

这​​​​​​​部​​​​​​​分​​​​​​​介​​​​​​​绍​​​​​​​了​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​管​​​​​​​理​​​​​​​各​​​​​​​个​​​​​​​方​​​​​​​面​​​​​​​的​​​​​​​命​​​​​​​令​​​​​​​。​​​​​​​

4.4.1. 创​​​​​​​建​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​

要​​​​​​​创​​​​​​​建​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​,请​​​​​​​使​​​​​​​用​​​​​​​ lvcreate 命​​​​​​​令​​​​​​​。​​​​​​​您​​​​​​​可​​​​​​​以​​​​​​​按​​​​​​​照​​​​​​​以​​​​​​​下​​​​​​​子​​​​​​​部​​​​​​​分​​​​​​​的​​​​​​​论​​​​​​​述​​​​​​​创​​​​​​​建​​​​​​​线​​​​​​​性​​​​​​​卷​​​​​​​、​​​​​​​条​​​​​​​状​​​​​​​卷​​​​​​​和​​​​​​​镜​​​​​​​像​​​​​​​卷​​​​​​​。​​​​​​​
如​​​​​​​果​​​​​​​您​​​​​​​没​​​​​​​有​​​​​​​为​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​指​​​​​​​定​​​​​​​名​​​​​​​称​​​​​​​,就​​​​​​​会​​​​​​​使​​​​​​​用​​​​​​​默​​​​​​​认​​​​​​​的​​​​​​​名​​​​​​​称​​​​​​​ lvol#,其​​​​​​​中​​​​​​​用​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​的​​​​​​​内​​​​​​​部​​​​​​​号​​​​​​​码​​​​​​​替​​​​​​​换​​​​​​​ #。​​​​​​​
下​​​​​​​面​​​​​​​的​​​​​​​部​​​​​​​分​​​​​​​为​​​​​​​您​​​​​​​提​​​​​​​供​​​​​​​可​​​​​​​以​​​​​​​在​​​​​​​ LVM 中​​​​​​​创​​​​​​​建​​​​​​​的​​​​​​​三​​​​​​​种​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​的​​​​​​​示​​​​​​​例​​​​​​​。​​​​​​​

4.4.1.1. 创​​​​​​​建​​​​​​​线​​​​​​​性​​​​​​​卷​​​​​​​

当​​​​​​​您​​​​​​​创​​​​​​​建​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​时​​​​​​​,该​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​是​​​​​​​从​​​​​​​使​​​​​​​用​​​​​​​物​​​​​​​理​​​​​​​卷​​​​​​​可​​​​​​​用​​​​​​​扩​​​​​​​展​​​​​​​的​​​​​​​卷​​​​​​​组​​​​​​​中​​​​​​​切​​​​​​​割​​​​​​​下​​​​​​​来​​​​​​​的​​​​​​​,它​​​​​​​们​​​​​​​构​​​​​​​成​​​​​​​了​​​​​​​卷​​​​​​​组​​​​​​​。​​​​​​​通​​​​​​​常​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​会​​​​​​​根​​​​​​​据​​​​​​​下​​​​​​​一​​​​​​​个​​​​​​​可​​​​​​​用​​​​​​​原​​​​​​​则​​​​​​​在​​​​​​​最​​​​​​​大​​​​​​​程​​​​​​​度​​​​​​​上​​​​​​​使​​​​​​​用​​​​​​​基​​​​​​​本​​​​​​​物​​​​​​​理​​​​​​​卷​​​​​​​中​​​​​​​的​​​​​​​空​​​​​​​间​​​​​​​。​​​​​​​修​​​​​​​改​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​可​​​​​​​释​​​​​​​放​​​​​​​并​​​​​​​重​​​​​​​新​​​​​​​分​​​​​​​配​​​​​​​物​​​​​​​理​​​​​​​卷​​​​​​​的​​​​​​​空​​​​​​​间​​​​​​​。​​​​​​​
下​​​​​​​面​​​​​​​的​​​​​​​命​​​​​​​令​​​​​​​在​​​​​​​卷​​​​​​​组​​​​​​​ vg1 中​​​​​​​创​​​​​​​建​​​​​​​了​​​​​​​大​​​​​​​小​​​​​​​为​​​​​​​ 10GB 的​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​。​​​​​​​
lvcreate -L 10G vg1
下​​​​​​​面​​​​​​​的​​​​​​​命​​​​​​​令​​​​​​​在​​​​​​​创​​​​​​​建​​​​​​​了​​​​​​​块​​​​​​​设​​​​​​​备​​​​​​​ /dev/testvg/testlv 的​​​​​​​卷​​​​​​​组​​​​​​​ testvg 中​​​​​​​创​​​​​​​建​​​​​​​了​​​​​​​大​​​​​​​小​​​​​​​为​​​​​​​ 1500MB,名​​​​​​​为​​​​​​​ testlv 的​​​​​​​线​​​​​​​性​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​。​​​​​​​
lvcreate -L1500 -n testlv testvg
下​​​​​​​面​​​​​​​的​​​​​​​命​​​​​​​令​​​​​​​在​​​​​​​卷​​​​​​​组​​​​​​​ vg0 中​​​​​​​使​​​​​​​用​​​​​​​可​​​​​​​用​​​​​​​扩​​​​​​​展​​​​​​​创​​​​​​​建​​​​​​​了​​​​​​​大​​​​​​​小​​​​​​​为​​​​​​​ 50GB,名​​​​​​​为​​​​​​​ gfslv 的​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​。​​​​​​​
lvcreate -L 50G -n gfslv vg0
您​​​​​​​可​​​​​​​以​​​​​​​使​​​​​​​用​​​​​​​ lvcreate 命​​​​​​​令​​​​​​​的​​​​​​​ -l 参​​​​​​​数​​​​​​​以​​​​​​​扩​​​​​​​展​​​​​​​为​​​​​​​单​​​​​​​位​​​​​​​指​​​​​​​定​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​的​​​​​​​大​​​​​​​小​​​​​​​。​​​​​​​您​​​​​​​还​​​​​​​可​​​​​​​以​​​​​​​使​​​​​​​用​​​​​​​这​​​​​​​个​​​​​​​参​​​​​​​数​​​​​​​来​​​​​​​为​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​指​​​​​​​定​​​​​​​所​​​​​​​用​​​​​​​卷​​​​​​​组​​​​​​​的​​​​​​​比​​​​​​​例​​​​​​​。​​​​​​​下​​​​​​​面​​​​​​​的​​​​​​​命​​​​​​​令​​​​​​​创​​​​​​​建​​​​​​​了​​​​​​​名​​​​​​​为​​​​​​​ mylv 逻​​​​​​​辑​​​​​​​卷​​​​​​​,它​​​​​​​使​​​​​​​用​​​​​​​了​​​​​​​卷​​​​​​​组​​​​​​​ testvol 总​​​​​​​空​​​​​​​间​​​​​​​的​​​​​​​ 60%。​​​​​​​
lvcreate -l 60%VG -n mylv testvg
您​​​​​​​还​​​​​​​可​​​​​​​以​​​​​​​使​​​​​​​用​​​​​​​ lvcreate 命​​​​​​​令​​​​​​​的​​​​​​​ -l 参​​​​​​​数​​​​​​​来​​​​​​​用​​​​​​​卷​​​​​​​组​​​​​​​中​​​​​​​所​​​​​​​剩​​​​​​​空​​​​​​​间​​​​​​​的​​​​​​​比​​​​​​​例​​​​​​​指​​​​​​​定​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​的​​​​​​​大​​​​​​​小​​​​​​​。​​​​​​​下​​​​​​​面​​​​​​​的​​​​​​​命​​​​​​​令​​​​​​​创​​​​​​​建​​​​​​​了​​​​​​​名​​​​​​​为​​​​​​​ yourlv,使​​​​​​​用​​​​​​​卷​​​​​​​组​​​​​​​ testvol 中​​​​​​​所​​​​​​​有​​​​​​​未​​​​​​​分​​​​​​​配​​​​​​​空​​​​​​​间​​​​​​​的​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​。​​​​​​​
lvcreate -l 100%FREE -n yourlv testvg
You can use -l argument of the lvcreate command to create a logical volume that uses the entire volume group. Another way to create a logical volume that uses the entire volume group is to use the vgdisplay command to find the "Total PE" size and to use those results as input to the the lvcreate command.
下​​​​​​​面​​​​​​​的​​​​​​​命​​​​​​​令​​​​​​​创​​​​​​​建​​​​​​​了​​​​​​​名​​​​​​​为​​​​​​​ mylv,可​​​​​​​充​​​​​​​满​​​​​​​卷​​​​​​​组​​​​​​​ testvg 的​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​。​​​​​​​
# vgdisplay testvg | grep "Total PE"
Total PE              10230
# lvcreate -l 10230 testvg -n mylv
The underlying physical volumes used to create a logical volume can be important if the physical volume needs to be removed, so you may need to consider this possibility when you create the logical volume. For information on removing a physical volume from a volume group, see 第 4.3.6 节 “从​​​​​​​卷​​​​​​​组​​​​​​​中​​​​​​​删​​​​​​​除​​​​​​​物​​​​​​​理​​​​​​​卷​​​​​​​”.
要​​​​​​​创​​​​​​​建​​​​​​​一​​​​​​​个​​​​​​​从​​​​​​​卷​​​​​​​组​​​​​​​的​​​​​​​特​​​​​​​定​​​​​​​物​​​​​​​理​​​​​​​卷​​​​​​​中​​​​​​​分​​​​​​​配​​​​​​​出​​​​​​​来​​​​​​​的​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​,请​​​​​​​在​​​​​​​ lvcreate 命​​​​​​​令​​​​​​​行​​​​​​​的​​​​​​​最​​​​​​​后​​​​​​​指​​​​​​​定​​​​​​​物​​​​​​​理​​​​​​​卷​​​​​​​或​​​​​​​者​​​​​​​卷​​​​​​​。​​​​​​​下​​​​​​​面​​​​​​​的​​​​​​​命​​​​​​​令​​​​​​​在​​​​​​​卷​​​​​​​组​​​​​​​ testvg 中​​​​​​​创​​​​​​​建​​​​​​​了​​​​​​​名​​​​​​​为​​​​​​​ testlv 的​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​,并​​​​​​​在​​​​​​​物​​​​​​​理​​​​​​​卷​​​​​​​ /dev/sdg1 中​​​​​​​进​​​​​​​行​​​​​​​分​​​​​​​配​​​​​​​:
lvcreate -L 1500 -ntestlv testvg /dev/sdg1
您​​​​​​​可​​​​​​​以​​​​​​​指​​​​​​​定​​​​​​​物​​​​​​​理​​​​​​​卷​​​​​​​中​​​​​​​的​​​​​​​哪​​​​​​​些​​​​​​​扩​​​​​​​展​​​​​​​可​​​​​​​用​​​​​​​作​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​。​​​​​​​下​​​​​​​面​​​​​​​的​​​​​​​例​​​​​​​子​​​​​​​创​​​​​​​建​​​​​​​了​​​​​​​一​​​​​​​个​​​​​​​线​​​​​​​性​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​,使​​​​​​​用​​​​​​​卷​​​​​​​组​​​​​​​ testvg 的​​​​​​​物​​​​​​​理​​​​​​​卷​​​​​​​ /dev/sda1 的​​​​​​​扩​​​​​​​展​​​​​​​ 0-25,和​​​​​​​物​​​​​​​理​​​​​​​卷​​​​​​​ /dev/sdb1 的​​​​​​​扩​​​​​​​展​​​​​​​ 50-125。​​​​​​​
lvcreate -l 100 -n testlv testvg /dev/sda1:0-25 /dev/sdb1:50-125
下​​​​​​​面​​​​​​​的​​​​​​​例​​​​​​​子​​​​​​​创​​​​​​​建​​​​​​​了​​​​​​​线​​​​​​​性​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​,使​​​​​​​用​​​​​​​的​​​​​​​是​​​​​​​物​​​​​​​理​​​​​​​卷​​​​​​​ /dev/sda1 的​​​​​​​扩​​​​​​​展​​​​​​​ 0-25,然​​​​​​​后​​​​​​​继​​​​​​​续​​​​​​​在​​​​​​​扩​​​​​​​展​​​​​​​ 100 处​​​​​​​部​​​​​​​署​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​。​​​​​​​
lvcreate -l 100 -n testlv testvg /dev/sda1:0-25:100-
The default policy for how the extents of a logical volume are allocated is inherit, which applies the same policy as for the volume group. These policies can be changed using the lvchange command. For information on allocation policies, see 第 4.3.1 节 “创​​​​​​​建​​​​​​​卷​​​​​​​组​​​​​​​”.

4.4.1.2. 创​​​​​​​建​​​​​​​条​​​​​​​状​​​​​​​卷​​​​​​​

For large sequential reads and writes, creating a striped logical volume can improve the efficiency of the data I/O. For general information about striped volumes, see 第 2.3.2 节 “条​​​​​​​状​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​”.
当​​​​​​​您​​​​​​​创​​​​​​​建​​​​​​​条​​​​​​​状​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​时​​​​​​​,请​​​​​​​使​​​​​​​用​​​​​​​ lvcreate 命​​​​​​​令​​​​​​​的​​​​​​​ -i 参​​​​​​​数​​​​​​​指​​​​​​​定​​​​​​​条​​​​​​​带​​​​​​​的​​​​​​​数​​​​​​​目​​​​​​​。​​​​​​​这​​​​​​​取​​​​​​​决​​​​​​​于​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​要​​​​​​​进​​​​​​​行​​​​​​​条​​​​​​​带​​​​​​​化​​​​​​​的​​​​​​​物​​​​​​​理​​​​​​​卷​​​​​​​数​​​​​​​目​​​​​​​。​​​​​​​条​​​​​​​带​​​​​​​的​​​​​​​数​​​​​​​目​​​​​​​不​​​​​​​能​​​​​​​超​​​​​​​过​​​​​​​卷​​​​​​​组​​​​​​​中​​​​​​​物​​​​​​​理​​​​​​​卷​​​​​​​的​​​​​​​数​​​​​​​目​​​​​​​(除​​​​​​​非​​​​​​​使​​​​​​​用​​​​​​​ --alloc anywhere 参​​​​​​​数​​​​​​​)。​​​​​​​
如​​​​​​​果​​​​​​​构​​​​​​​成​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​的​​​​​​​基​​​​​​​本​​​​​​​物​​​​​​​理​​​​​​​设​​​​​​​备​​​​​​​的​​​​​​​大​​​​​​​小​​​​​​​不​​​​​​​同​​​​​​​,条​​​​​​​状​​​​​​​卷​​​​​​​的​​​​​​​最​​​​​​​大​​​​​​​容​​​​​​​量​​​​​​​由​​​​​​​最​​​​​​​小​​​​​​​的​​​​​​​基​​​​​​​本​​​​​​​设​​​​​​​备​​​​​​​决​​​​​​​定​​​​​​​。​​​​​​​例​​​​​​​如​​​​​​​,在​​​​​​​有​​​​​​​两​​​​​​​个​​​​​​​分​​​​​​​支​​​​​​​条​​​​​​​状​​​​​​​卷​​​​​​​中​​​​​​​,其​​​​​​​容​​​​​​​量​​​​​​​最​​​​​​​大​​​​​​​为​​​​​​​较​​​​​​​小​​​​​​​设​​​​​​​备​​​​​​​的​​​​​​​两​​​​​​​倍​​​​​​​。​​​​​​​在​​​​​​​有​​​​​​​三​​​​​​​个​​​​​​​分​​​​​​​支​​​​​​​的​​​​​​​条​​​​​​​状​​​​​​​卷​​​​​​​中​​​​​​​,其​​​​​​​容​​​​​​​量​​​​​​​是​​​​​​​最​​​​​​​小​​​​​​​设​​​​​​​备​​​​​​​的​​​​​​​三​​​​​​​倍​​​​​​​。​​​​​​​
下​​​​​​​面​​​​​​​的​​​​​​​命​​​​​​​令​​​​​​​创​​​​​​​建​​​​​​​了​​​​​​​跨​​​​​​​两​​​​​​​个​​​​​​​物​​​​​​​理​​​​​​​卷​​​​​​​,幅​​​​​​​度​​​​​​​为​​​​​​​ 64KB 的​​​​​​​条​​​​​​​状​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​。​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​大​​​​​​​小​​​​​​​为​​​​​​​ 50GB,名​​​​​​​称​​​​​​​为​​​​​​​ gfslv,它​​​​​​​是​​​​​​​从​​​​​​​卷​​​​​​​组​​​​​​​ vg0 中​​​​​​​分​​​​​​​割​​​​​​​出​​​​​​​来​​​​​​​的​​​​​​​。​​​​​​​
lvcreate -L 50G -i2 -I64 -n gfslv vg0
在​​​​​​​线​​​​​​​性​​​​​​​卷​​​​​​​中​​​​​​​,您​​​​​​​可​​​​​​​以​​​​​​​指​​​​​​​定​​​​​​​用​​​​​​​于​​​​​​​条​​​​​​​状​​​​​​​卷​​​​​​​的​​​​​​​物​​​​​​​理​​​​​​​卷​​​​​​​扩​​​​​​​展​​​​​​​。​​​​​​​下​​​​​​​面​​​​​​​的​​​​​​​命​​​​​​​令​​​​​​​创​​​​​​​建​​​​​​​了​​​​​​​大​​​​​​​小​​​​​​​为​​​​​​​ 100 扩​​​​​​​展​​​​​​​的​​​​​​​条​​​​​​​状​​​​​​​卷​​​​​​​,跨​​​​​​​两​​​​​​​个​​​​​​​物​​​​​​​理​​​​​​​卷​​​​​​​,名​​​​​​​为​​​​​​​ stripelv,属​​​​​​​于​​​​​​​卷​​​​​​​组​​​​​​​ testvg。​​​​​​​该​​​​​​​条​​​​​​​状​​​​​​​卷​​​​​​​将​​​​​​​使​​​​​​​用​​​​​​​ /dev/sda1 的​​​​​​​ 0-50 区​​​​​​​段​​​​​​​以​​​​​​​及​​​​​​​ /dev/sdb1 50-100 区​​​​​​​段​​​​​​​的​​​​​​​。​​​​​​​
# lvcreate -l 100 -i2 -nstripelv testvg /dev/sda1:0-50 /dev/sdb1:50-100
  Using default stripesize 64.00 KB
  Logical volume "stripelv" created

4.4.1.3. 创​​​​​​​建​​​​​​​镜​​​​​​​像​​​​​​​卷​​​​​​​

当​​​​​​​您​​​​​​​创​​​​​​​建​​​​​​​一​​​​​​​个​​​​​​​镜​​​​​​​像​​​​​​​卷​​​​​​​时​​​​​​​,您​​​​​​​可​​​​​​​使​​​​​​​用​​​​​​​ lvcreate 命​​​​​​​令​​​​​​​的​​​​​​​ -m 参​​​​​​​数​​​​​​​来​​​​​​​指​​​​​​​定​​​​​​​数​​​​​​​据​​​​​​​的​​​​​​​备​​​​​​​份​​​​​​​数​​​​​​​目​​​​​​​。​​​​​​​指​​​​​​​定​​​​​​​ -m1 生​​​​​​​成​​​​​​​一​​​​​​​个​​​​​​​镜​​​​​​​像​​​​​​​,也​​​​​​​就​​​​​​​是​​​​​​​生​​​​​​​成​​​​​​​两​​​​​​​个​​​​​​​文​​​​​​​件​​​​​​​系​​​​​​​统​​​​​​​副​​​​​​​本​​​​​​​:一​​​​​​​个​​​​​​​线​​​​​​​性​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​加​​​​​​​上​​​​​​​一​​​​​​​个​​​​​​​副​​​​​​​本​​​​​​​。​​​​​​​同​​​​​​​样​​​​​​​的​​​​​​​,指​​​​​​​定​​​​​​​ -m2 会​​​​​​​生​​​​​​​成​​​​​​​两​​​​​​​个​​​​​​​镜​​​​​​​像​​​​​​​,也​​​​​​​就​​​​​​​是​​​​​​​生​​​​​​​成​​​​​​​三​​​​​​​个​​​​​​​文​​​​​​​件​​​​​​​系​​​​​​​统​​​​​​​副​​​​​​​本​​​​​​​。​​​​​​​
下​​​​​​​面​​​​​​​的​​​​​​​命​​​​​​​令​​​​​​​使​​​​​​​用​​​​​​​单​​​​​​​一​​​​​​​镜​​​​​​​像​​​​​​​创​​​​​​​建​​​​​​​一​​​​​​​个​​​​​​​镜​​​​​​​像​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​。​​​​​​​大​​​​​​​小​​​​​​​为​​​​​​​ 50GB,名​​​​​​​为​​​​​​​ mirrorlv,且​​​​​​​是​​​​​​​从​​​​​​​卷​​​​​​​组​​​​​​​ vg0 中​​​​​​​分​​​​​​​离​​​​​​​出​​​​​​​来​​​​​​​的​​​​​​​:
lvcreate -L 50G -m1 -n gfslv vg0
LVM 镜​​​​​​​像​​​​​​​将​​​​​​​分​​​​​​​割​​​​​​​复​​​​​​​制​​​​​​​到​​​​​​​区​​​​​​​域​​​​​​​(默​​​​​​​认​​​​​​​大​​​​​​​小​​​​​​​为​​​​​​​ 512K)的​​​​​​​设​​​​​​​备​​​​​​​。​​​​​​​您​​​​​​​可​​​​​​​以​​​​​​​使​​​​​​​用​​​​​​​ -R 参​​​​​​​数​​​​​​​以​​​​​​​ MB 为​​​​​​​单​​​​​​​位​​​​​​​指​​​​​​​定​​​​​​​区​​​​​​​域​​​​​​​大​​​​​​​小​​​​​​​。​​​​​​​LVM 维​​​​​​​护​​​​​​​一​​​​​​​个​​​​​​​小​​​​​​​的​​​​​​​日​​​​​​​志​​​​​​​,可​​​​​​​用​​​​​​​来​​​​​​​追​​​​​​​踪​​​​​​​哪​​​​​​​些​​​​​​​区​​​​​​​域​​​​​​​是​​​​​​​和​​​​​​​镜​​​​​​​像​​​​​​​同​​​​​​​步​​​​​​​的​​​​​​​。​​​​​​​默​​​​​​​认​​​​​​​情​​​​​​​况​​​​​​​下​​​​​​​,该​​​​​​​日​​​​​​​志​​​​​​​是​​​​​​​保​​​​​​​存​​​​​​​在​​​​​​​磁​​​​​​​盘​​​​​​​中​​​​​​​的​​​​​​​,这​​​​​​​样​​​​​​​可​​​​​​​以​​​​​​​使​​​​​​​它​​​​​​​在​​​​​​​机​​​​​​​器​​​​​​​重​​​​​​​启​​​​​​​后​​​​​​​得​​​​​​​以​​​​​​​保​​​​​​​存​​​​​​​。​​​​​​​您​​​​​​​可​​​​​​​以​​​​​​​使​​​​​​​用​​​​​​​ --corelog 参​​​​​​​数​​​​​​​令​​​​​​​该​​​​​​​日​​​​​​​志​​​​​​​在​​​​​​​内​​​​​​​存​​​​​​​中​​​​​​​保​​​​​​​存​​​​​​​,这​​​​​​​样​​​​​​​就​​​​​​​需​​​​​​​要​​​​​​​额​​​​​​​外​​​​​​​的​​​​​​​日​​​​​​​志​​​​​​​设​​​​​​​备​​​​​​​,但​​​​​​​它​​​​​​​将​​​​​​​需​​​​​​​要​​​​​​​在​​​​​​​每​​​​​​​次​​​​​​​重​​​​​​​启​​​​​​​时​​​​​​​重​​​​​​​新​​​​​​​同​​​​​​​步​​​​​​​化​​​​​​​来​​​​​​​获​​​​​​​得​​​​​​​完​​​​​​​整​​​​​​​镜​​​​​​​像​​​​​​​。​​​​​​​
下​​​​​​​面​​​​​​​的​​​​​​​命​​​​​​​令​​​​​​​在​​​​​​​卷​​​​​​​组​​​​​​​ bigvg 中​​​​​​​创​​​​​​​建​​​​​​​镜​​​​​​​像​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​。​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​名​​​​​​​称​​​​​​​为​​​​​​​ ondiskmirvol,它​​​​​​​有​​​​​​​单​​​​​​​一​​​​​​​镜​​​​​​​像​​​​​​​。​​​​​​​卷​​​​​​​大​​​​​​​小​​​​​​​为​​​​​​​ 12MB,并​​​​​​​在​​​​​​​内​​​​​​​存​​​​​​​中​​​​​​​保​​​​​​​存​​​​​​​镜​​​​​​​像​​​​​​​日​​​​​​​志​​​​​​​。​​​​​​​
# lvcreate -L 12MB -m1 --corelog -n ondiskmirvol bigvg
  Logical volume "ondiskmirvol" created
镜​​​​​​​像​​​​​​​日​​​​​​​志​​​​​​​是​​​​​​​在​​​​​​​与​​​​​​​生​​​​​​​成​​​​​​​镜​​​​​​​像​​​​​​​分​​​​​​​支​​​​​​​的​​​​​​​设​​​​​​​备​​​​​​​不​​​​​​​同​​​​​​​的​​​​​​​设​​​​​​​备​​​​​​​中​​​​​​​生​​​​​​​成​​​​​​​的​​​​​​​。​​​​​​​但​​​​​​​有​​​​​​​可​​​​​​​能​​​​​​​使​​​​​​​用​​​​​​​ vgcreate 命​​​​​​​令​​​​​​​的​​​​​​​ --alloc anywhere 参​​​​​​​数​​​​​​​在​​​​​​​镜​​​​​​​像​​​​​​​分​​​​​​​支​​​​​​​之​​​​​​​一​​​​​​​的​​​​​​​同​​​​​​​一​​​​​​​设​​​​​​​备​​​​​​​中​​​​​​​创​​​​​​​建​​​​​​​镜​​​​​​​像​​​​​​​分​​​​​​​支​​​​​​​。​​​​​​​这​​​​​​​可​​​​​​​能​​​​​​​会​​​​​​​降​​​​​​​低​​​​​​​性​​​​​​​能​​​​​​​,但​​​​​​​可​​​​​​​让​​​​​​​您​​​​​​​在​​​​​​​只​​​​​​​有​​​​​​​两​​​​​​​个​​​​​​​基​​​​​​​础​​​​​​​设​​​​​​​备​​​​​​​的​​​​​​​情​​​​​​​况​​​​​​​下​​​​​​​创​​​​​​​建​​​​​​​镜​​​​​​​像​​​​​​​。​​​​​​​
下​​​​​​​面​​​​​​​的​​​​​​​命​​​​​​​令​​​​​​​使​​​​​​​用​​​​​​​单​​​​​​​一​​​​​​​镜​​​​​​​像​​​​​​​创​​​​​​​建​​​​​​​一​​​​​​​个​​​​​​​镜​​​​​​​像​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​,其​​​​​​​镜​​​​​​​像​​​​​​​日​​​​​​​志​​​​​​​位​​​​​​​于​​​​​​​作​​​​​​​为​​​​​​​镜​​​​​​​像​​​​​​​分​​​​​​​支​​​​​​​之​​​​​​​一​​​​​​​的​​​​​​​设​​​​​​​备​​​​​​​中​​​​​​​。​​​​​​​在​​​​​​​这​​​​​​​个​​​​​​​示​​​​​​​例​​​​​​​中​​​​​​​,卷​​​​​​​组​​​​​​​ vg0 只​​​​​​​包​​​​​​​括​​​​​​​两​​​​​​​个​​​​​​​设​​​​​​​备​​​​​​​。​​​​​​​这​​​​​​​个​​​​​​​命​​​​​​​令​​​​​​​创​​​​​​​建​​​​​​​的​​​​​​​镜​​​​​​​像​​​​​​​卷​​​​​​​大​​​​​​​小​​​​​​​为​​​​​​​ 50GB,名​​​​​​​为​​​​​​​ mirrorlv,且​​​​​​​是​​​​​​​从​​​​​​​卷​​​​​​​组​​​​​​​ vg0 中​​​​​​​分​​​​​​​离​​​​​​​出​​​​​​​来​​​​​​​的​​​​​​​。​​​​​​​
lvcreate -L 500M -m1 -n mirrorlv -alloc anywhere vg0
创​​​​​​​建​​​​​​​了​​​​​​​镜​​​​​​​像​​​​​​​时​​​​​​​,就​​​​​​​会​​​​​​​同​​​​​​​步​​​​​​​镜​​​​​​​像​​​​​​​区​​​​​​​域​​​​​​​。​​​​​​​对​​​​​​​于​​​​​​​大​​​​​​​量​​​​​​​的​​​​​​​镜​​​​​​​像​​​​​​​组​​​​​​​件​​​​​​​来​​​​​​​说​​​​​​​,同​​​​​​​步​​​​​​​进​​​​​​​程​​​​​​​可​​​​​​​能​​​​​​​需​​​​​​​要​​​​​​​一​​​​​​​些​​​​​​​时​​​​​​​间​​​​​​​。​​​​​​​当​​​​​​​您​​​​​​​创​​​​​​​建​​​​​​​一​​​​​​​个​​​​​​​不​​​​​​​需​​​​​​​要​​​​​​​恢​​​​​​​复​​​​​​​的​​​​​​​新​​​​​​​镜​​​​​​​像​​​​​​​时​​​​​​​,您​​​​​​​可​​​​​​​以​​​​​​​指​​​​​​​定​​​​​​​ nosync 参​​​​​​​数​​​​​​​说​​​​​​​明​​​​​​​不​​​​​​​需​​​​​​​要​​​​​​​从​​​​​​​第​​​​​​​一​​​​​​​个​​​​​​​设​​​​​​​备​​​​​​​进​​​​​​​行​​​​​​​初​​​​​​​始​​​​​​​同​​​​​​​步​​​​​​​化​​​​​​​。​​​​​​​
您​​​​​​​可​​​​​​​以​​​​​​​指​​​​​​​定​​​​​​​镜​​​​​​​像​​​​​​​日​​​​​​​志​​​​​​​使​​​​​​​用​​​​​​​哪​​​​​​​些​​​​​​​设​​​​​​​备​​​​​​​并​​​​​​​进​​​​​​​行​​​​​​​记​​​​​​​录​​​​​​​。​​​​​​​您​​​​​​​还​​​​​​​可​​​​​​​以​​​​​​​指​​​​​​​定​​​​​​​要​​​​​​​使​​​​​​​用​​​​​​​的​​​​​​​设​​​​​​​备​​​​​​​扩​​​​​​​展​​​​​​​。​​​​​​​要​​​​​​​强​​​​​​​制​​​​​​​登​​​​​​​录​​​​​​​到​​​​​​​特​​​​​​​定​​​​​​​磁​​​​​​​盘​​​​​​​,请​​​​​​​在​​​​​​​存​​​​​​​放​​​​​​​扩​​​​​​​展​​​​​​​的​​​​​​​磁​​​​​​​盘​​​​​​​中​​​​​​​明​​​​​​​确​​​​​​​指​​​​​​​定​​​​​​​一​​​​​​​个​​​​​​​扩​​​​​​​展​​​​​​​。​​​​​​​LVM 不​​​​​​​一​​​​​​​定​​​​​​​要​​​​​​​考​​​​​​​虑​​​​​​​命​​​​​​​令​​​​​​​行​​​​​​​中​​​​​​​的​​​​​​​设​​​​​​​备​​​​​​​顺​​​​​​​序​​​​​​​。​​​​​​​如​​​​​​​果​​​​​​​列​​​​​​​出​​​​​​​任​​​​​​​意​​​​​​​物​​​​​​​理​​​​​​​卷​​​​​​​,那​​​​​​​么​​​​​​​那​​​​​​​里​​​​​​​就​​​​​​​是​​​​​​​唯​​​​​​​一​​​​​​​进​​​​​​​行​​​​​​​磁​​​​​​​盘​​​​​​​分​​​​​​​配​​​​​​​的​​​​​​​地​​​​​​​方​​​​​​​。​​​​​​​列​​​​​​​表​​​​​​​中​​​​​​​包​​​​​​​含​​​​​​​的​​​​​​​任​​​​​​​何​​​​​​​已​​​​​​​经​​​​​​​被​​​​​​​分​​​​​​​配​​​​​​​的​​​​​​​物​​​​​​​理​​​​​​​扩​​​​​​​展​​​​​​​将​​​​​​​会​​​​​​​被​​​​​​​忽​​​​​​​略​​​​​​​。​​​​​​​
下​​​​​​​面​​​​​​​的​​​​​​​命​​​​​​​令​​​​​​​创​​​​​​​建​​​​​​​了​​​​​​​带​​​​​​​单​​​​​​​一​​​​​​​镜​​​​​​​像​​​​​​​的​​​​​​​镜​​​​​​​像​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​,卷​​​​​​​大​​​​​​​小​​​​​​​为​​​​​​​ 500GB,名​​​​​​​为​​​​​​​ mirrorlv,是​​​​​​​从​​​​​​​卷​​​​​​​组​​​​​​​ vg0 中​​​​​​​分​​​​​​​割​​​​​​​出​​​​​​​来​​​​​​​的​​​​​​​。​​​​​​​镜​​​​​​​像​​​​​​​的​​​​​​​一​​​​​​​支​​​​​​​位​​​​​​​于​​​​​​​设​​​​​​​备​​​​​​​ /dev/sda1,第​​​​​​​二​​​​​​​支​​​​​​​位​​​​​​​于​​​​​​​设​​​​​​​备​​​​​​​ /dev/sdb1,镜​​​​​​​像​​​​​​​日​​​​​​​志​​​​​​​位​​​​​​​于​​​​​​​ /dev/sdc1。​​​​​​​
lvcreate -L 500M -m1 -n mirrorlv vg0 /dev/sda1 /dev/sdb1 /dev/sdc1
下​​​​​​​面​​​​​​​的​​​​​​​命​​​​​​​令​​​​​​​创​​​​​​​建​​​​​​​了​​​​​​​带​​​​​​​单​​​​​​​一​​​​​​​镜​​​​​​​像​​​​​​​的​​​​​​​镜​​​​​​​像​​​​​​​卷​​​​​​​。​​​​​​​卷​​​​​​​的​​​​​​​大​​​​​​​小​​​​​​​为​​​​​​​ 500MB,名​​​​​​​为​​​​​​​ mirrorlv,是​​​​​​​从​​​​​​​卷​​​​​​​组​​​​​​​ vg0 中​​​​​​​分​​​​​​​割​​​​​​​出​​​​​​​来​​​​​​​的​​​​​​​。​​​​​​​镜​​​​​​​像​​​​​​​的​​​​​​​第​​​​​​​一​​​​​​​个​​​​​​​分​​​​​​​支​​​​​​​在​​​​​​​设​​​​​​​备​​​​​​​ /dev/sda1 的​​​​​​​第​​​​​​​ 0 到​​​​​​​ 499 扩​​​​​​​展​​​​​​​,镜​​​​​​​像​​​​​​​的​​​​​​​第​​​​​​​二​​​​​​​个​​​​​​​分​​​​​​​支​​​​​​​位​​​​​​​于​​​​​​​设​​​​​​​备​​​​​​​ /dev/sdb1 的​​​​​​​第​​​​​​​ 0 到​​​​​​​ 499 扩​​​​​​​展​​​​​​​,且​​​​​​​镜​​​​​​​像​​​​​​​日​​​​​​​志​​​​​​​从​​​​​​​ /dev/sdc1 的​​​​​​​扩​​​​​​​展​​​​​​​ 0 开​​​​​​​始​​​​​​​。​​​​​​​这​​​​​​​些​​​​​​​是​​​​​​​ 1MB 的​​​​​​​扩​​​​​​​展​​​​​​​。​​​​​​​如​​​​​​​果​​​​​​​任​​​​​​​何​​​​​​​指​​​​​​​定​​​​​​​的​​​​​​​扩​​​​​​​展​​​​​​​已​​​​​​​经​​​​​​​被​​​​​​​分​​​​​​​配​​​​​​​了​​​​​​​,那​​​​​​​么​​​​​​​它​​​​​​​们​​​​​​​就​​​​​​​会​​​​​​​被​​​​​​​忽​​​​​​​略​​​​​​​。​​​​​​​
lvcreate -L 500M -m1 -n mirrorlv vg0 /dev/sda1:0-499 /dev/sdb1:0-499 /dev/sdc1:0

注意

在​​​​​​​ RHEL 5.3 发​​​​​​​行​​​​​​​本​​​​​​​中​​​​​​​,在​​​​​​​群​​​​​​​集​​​​​​​中​​​​​​​支​​​​​​​持​​​​​​​镜​​​​​​​像​​​​​​​的​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​。​​​​​​​

4.4.1.4. 修​​​​​​​改​​​​​​​镜​​​​​​​像​​​​​​​卷​​​​​​​配​​​​​​​置​​​​​​​

您​​​​​​​可​​​​​​​以​​​​​​​使​​​​​​​用​​​​​​​ lvconvert 命​​​​​​​令​​​​​​​将​​​​​​​一​​​​​​​个​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​从​​​​​​​镜​​​​​​​像​​​​​​​卷​​​​​​​转​​​​​​​换​​​​​​​成​​​​​​​线​​​​​​​性​​​​​​​卷​​​​​​​,或​​​​​​​者​​​​​​​从​​​​​​​线​​​​​​​性​​​​​​​卷​​​​​​​转​​​​​​​换​​​​​​​成​​​​​​​镜​​​​​​​像​​​​​​​卷​​​​​​​。​​​​​​​您​​​​​​​还​​​​​​​可​​​​​​​以​​​​​​​使​​​​​​​用​​​​​​​这​​​​​​​个​​​​​​​命​​​​​​​令​​​​​​​来​​​​​​​重​​​​​​​新​​​​​​​配​​​​​​​置​​​​​​​现​​​​​​​有​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​的​​​​​​​其​​​​​​​它​​​​​​​镜​​​​​​​像​​​​​​​参​​​​​​​数​​​​​​​,比​​​​​​​如​​​​​​​ corelog。​​​​​​​
当​​​​​​​您​​​​​​​将​​​​​​​一​​​​​​​个​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​转​​​​​​​换​​​​​​​成​​​​​​​镜​​​​​​​像​​​​​​​卷​​​​​​​时​​​​​​​,通​​​​​​​常​​​​​​​您​​​​​​​需​​​​​​​要​​​​​​​为​​​​​​​现​​​​​​​有​​​​​​​卷​​​​​​​创​​​​​​​建​​​​​​​镜​​​​​​​像​​​​​​​分​​​​​​​支​​​​​​​。​​​​​​​就​​​​​​​是​​​​​​​说​​​​​​​您​​​​​​​的​​​​​​​卷​​​​​​​组​​​​​​​必​​​​​​​须​​​​​​​包​​​​​​​含​​​​​​​用​​​​​​​作​​​​​​​镜​​​​​​​像​​​​​​​分​​​​​​​支​​​​​​​和​​​​​​​镜​​​​​​​像​​​​​​​日​​​​​​​志​​​​​​​的​​​​​​​设​​​​​​​备​​​​​​​和​​​​​​​空​​​​​​​间​​​​​​​。​​​​​​​
If you lose a leg of a mirror, LVM converts the volume to a linear volume so that you still have access to the volume, without the mirror redundancy. After you replace the leg, you can use the lvconvert command to restore the mirror. This procedure is provided in 第 6.3 节 “修​​​​​​​复​​​​​​​ LVM 镜​​​​​​​像​​​​​​​错​​​​​​​误​​​​​​​”.
下​​​​​​​面​​​​​​​的​​​​​​​命​​​​​​​令​​​​​​​可​​​​​​​将​​​​​​​线​​​​​​​性​​​​​​​卷​​​​​​​ vg00/lvol1 转​​​​​​​换​​​​​​​成​​​​​​​镜​​​​​​​像​​​​​​​卷​​​​​​​。​​​​​​​
lvconvert -m1 vg00/lvol1
下​​​​​​​面​​​​​​​的​​​​​​​命​​​​​​​令​​​​​​​可​​​​​​​将​​​​​​​镜​​​​​​​像​​​​​​​卷​​​​​​​ vg00/lvol1 转​​​​​​​换​​​​​​​成​​​​​​​线​​​​​​​性​​​​​​​卷​​​​​​​,并​​​​​​​删​​​​​​​除​​​​​​​镜​​​​​​​像​​​​​​​分​​​​​​​支​​​​​​​。​​​​​​​
lvconvert -m0 vg00/lvol1

4.4.2. 持​​​​​​​久​​​​​​​的​​​​​​​设​​​​​​​备​​​​​​​号​​​​​​​码​​​​​​​

在​​​​​​​载​​​​​​​入​​​​​​​模​​​​​​​块​​​​​​​的​​​​​​​时​​​​​​​候​​​​​​​会​​​​​​​自​​​​​​​动​​​​​​​分​​​​​​​配​​​​​​​主​​​​​​​、​​​​​​​副​​​​​​​设​​​​​​​备​​​​​​​号​​​​​​​码​​​​​​​。​​​​​​​如​​​​​​​果​​​​​​​总​​​​​​​是​​​​​​​用​​​​​​​相​​​​​​​同​​​​​​​的​​​​​​​设​​​​​​​备​​​​​​​(主​​​​​​​和​​​​​​​副​​​​​​​)号​​​​​​​码​​​​​​​激​​​​​​​活​​​​​​​块​​​​​​​设​​​​​​​备​​​​​​​,可​​​​​​​使​​​​​​​有​​​​​​​些​​​​​​​应​​​​​​​用​​​​​​​程​​​​​​​序​​​​​​​获​​​​​​​得​​​​​​​最​​​​​​​佳​​​​​​​性​​​​​​​能​​​​​​​。​​​​​​​您​​​​​​​可​​​​​​​以​​​​​​​通​​​​​​​过​​​​​​​使​​​​​​​用​​​​​​​以​​​​​​​下​​​​​​​参​​​​​​​数​​​​​​​来​​​​​​​指​​​​​​​定​​​​​​​ lvcreate 和​​​​​​​ lvchange 来​​​​​​​达​​​​​​​到​​​​​​​此​​​​​​​目​​​​​​​的​​​​​​​:
--persistent y --major major --minor minor
Use a large minor number to be sure that it hasn't already been allocated to another device dynamically.
如​​​​​​​果​​​​​​​您​​​​​​​使​​​​​​​用​​​​​​​ NFS 导​​​​​​​出​​​​​​​一​​​​​​​个​​​​​​​文​​​​​​​件​​​​​​​系​​​​​​​统​​​​​​​,在​​​​​​​导​​​​​​​出​​​​​​​文​​​​​​​件​​​​​​​中​​​​​​​指​​​​​​​定​​​​​​​ fsid 参​​​​​​​数​​​​​​​可​​​​​​​避​​​​​​​免​​​​​​​在​​​​​​​ LVM 中​​​​​​​设​​​​​​​定​​​​​​​持​​​​​​​久​​​​​​​的​​​​​​​设​​​​​​​备​​​​​​​号​​​​​​​码​​​​​​​。​​​​​​​

4.4.3. 重​​​​​​​新​​​​​​​设​​​​​​​定​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​大​​​​​​​小​​​​​​​

要​​​​​​​修​​​​​​​改​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​的​​​​​​​大​​​​​​​小​​​​​​​,请​​​​​​​使​​​​​​​用​​​​​​​ lvreduce 命​​​​​​​令​​​​​​​。​​​​​​​如​​​​​​​果​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​包​​​​​​​含​​​​​​​一​​​​​​​个​​​​​​​文​​​​​​​件​​​​​​​系​​​​​​​统​​​​​​​,请​​​​​​​确​​​​​​​定​​​​​​​首​​​​​​​先​​​​​​​减​​​​​​​小​​​​​​​文​​​​​​​件​​​​​​​系​​​​​​​统​​​​​​​(或​​​​​​​者​​​​​​​使​​​​​​​用​​​​​​​ LVM GUI),以​​​​​​​便​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​总​​​​​​​是​​​​​​​至​​​​​​​少​​​​​​​可​​​​​​​达​​​​​​​到​​​​​​​文​​​​​​​件​​​​​​​系​​​​​​​统​​​​​​​所​​​​​​​需​​​​​​​的​​​​​​​大​​​​​​​小​​​​​​​。​​​​​​​
下​​​​​​​面​​​​​​​的​​​​​​​命​​​​​​​令​​​​​​​将​​​​​​​卷​​​​​​​组​​​​​​​ vg00 中​​​​​​​的​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​ lvol1 的​​​​​​​大​​​​​​​小​​​​​​​减​​​​​​​少​​​​​​​了​​​​​​​三​​​​​​​个​​​​​​​逻​​​​​​​辑​​​​​​​扩​​​​​​​展​​​​​​​。​​​​​​​
lvreduce -l -3 vg00/lvol1

4.4.4. 修​​​​​​​改​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​组​​​​​​​的​​​​​​​参​​​​​​​数​​​​​​​

要​​​​​​​修​​​​​​​改​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​参​​​​​​​数​​​​​​​,请​​​​​​​使​​​​​​​用​​​​​​​ lvchange 命​​​​​​​令​​​​​​​。​​​​​​​有​​​​​​​关​​​​​​​您​​​​​​​可​​​​​​​以​​​​​​​修​​​​​​​改​​​​​​​的​​​​​​​参​​​​​​​数​​​​​​​列​​​​​​​表​​​​​​​,请​​​​​​​参​​​​​​​考​​​​​​​ lvchange(8) man page。​​​​​​​
You can use the lvchange command to activate and deactivate logical volumes. To activate and deactivate all the logical volumes in a volume group at the same time, use the vgchange command, as described in 第 4.3.7 节 “修​​​​​​​改​​​​​​​卷​​​​​​​组​​​​​​​参​​​​​​​数​​​​​​​”.
下​​​​​​​面​​​​​​​的​​​​​​​命​​​​​​​令​​​​​​​将​​​​​​​卷​​​​​​​组​​​​​​​ vg00 中​​​​​​​卷​​​​​​​ lvol1 的​​​​​​​权​​​​​​​限​​​​​​​改​​​​​​​为​​​​​​​只​​​​​​​读​​​​​​​。​​​​​​​
lvchange -pr vg00/lvol1

4.4.5. 重​​​​​​​新​​​​​​​命​​​​​​​名​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​

要​​​​​​​重​​​​​​​新​​​​​​​命​​​​​​​名​​​​​​​一​​​​​​​个​​​​​​​现​​​​​​​有​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​,请​​​​​​​使​​​​​​​用​​​​​​​ lvrename 命​​​​​​​令​​​​​​​。​​​​​​​
下​​​​​​​面​​​​​​​两​​​​​​​个​​​​​​​命​​​​​​​令​​​​​​​之​​​​​​​一​​​​​​​都​​​​​​​可​​​​​​​以​​​​​​​将​​​​​​​卷​​​​​​​组​​​​​​​ vg02 中​​​​​​​的​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​ lvold 重​​​​​​​新​​​​​​​命​​​​​​​名​​​​​​​为​​​​​​​ lvnew。​​​​​​​
lvrename /dev/vg02/lvold /dev/vg02/lvnew
lvrename vg02 lvold lvnew

4.4.6. 删​​​​​​​除​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​

要​​​​​​​删​​​​​​​除​​​​​​​一​​​​​​​个​​​​​​​失​​​​​​​活​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​,请​​​​​​​使​​​​​​​用​​​​​​​ lvremove 命​​​​​​​令​​​​​​​。​​​​​​​您​​​​​​​必​​​​​​​须​​​​​​​在​​​​​​​它​​​​​​​可​​​​​​​被​​​​​​​删​​​​​​​除​​​​​​​之​​​​​​​前​​​​​​​使​​​​​​​用​​​​​​​ umount 命​​​​​​​令​​​​​​​关​​​​​​​闭​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​。​​​​​​​另​​​​​​​外​​​​​​​,在​​​​​​​群​​​​​​​集​​​​​​​的​​​​​​​环​​​​​​​境​​​​​​​中​​​​​​​,您​​​​​​​必​​​​​​​须​​​​​​​在​​​​​​​删​​​​​​​除​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​之​​​​​​​前​​​​​​​将​​​​​​​其​​​​​​​失​​​​​​​活​​​​​​​。​​​​​​​
如​​​​​​​果​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​目​​​​​​​前​​​​​​​是​​​​​​​挂​​​​​​​载​​​​​​​状​​​​​​​态​​​​​​​,请​​​​​​​在​​​​​​​删​​​​​​​除​​​​​​​它​​​​​​​之​​​​​​​前​​​​​​​将​​​​​​​其​​​​​​​卸​​​​​​​载​​​​​​​。​​​​​​​
下​​​​​​​面​​​​​​​的​​​​​​​命​​​​​​​令​​​​​​​可​​​​​​​从​​​​​​​卷​​​​​​​组​​​​​​​ testvg 中​​​​​​​删​​​​​​​除​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​ /dev/testvg/testlv。​​​​​​​注​​​​​​​意​​​​​​​:在​​​​​​​这​​​​​​​种​​​​​​​情​​​​​​​况​​​​​​​下​​​​​​​,逻​​​​​​​辑​​​​​​​卷​​​​​​​还​​​​​​​没​​​​​​​有​​​​​​​被​​​​​​​失​​​​​​​活​​​​​​​。​​​​​​​
[root@tng3-1 lvm]# lvremove /dev/testvg/testlv
Do you really want to remove active logical volume "testlv"? [y/n]: y
  Logical volume "testlv" successfully removed
您​​​​​​​可​​​​​​​以​​​​​​​使​​​​​​​用​​​​​​​ lvchange -an 命​​​​​​​令​​​​​​​在​​​​​​​删​​​​​​​除​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​之​​​​​​​前​​​​​​​明​​​​​​​确​​​​​​​将​​​​​​​其​​​​​​​失​​​​​​​活​​​​​​​,这​​​​​​​样​​​​​​​就​​​​​​​不​​​​​​​会​​​​​​​出​​​​​​​现​​​​​​​询​​​​​​​问​​​​​​​您​​​​​​​是​​​​​​​否​​​​​​​删​​​​​​​除​​​​​​​某​​​​​​​个​​​​​​​激​​​​​​​活​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​的​​​​​​​提​​​​​​​示​​​​​​​。​​​​​​​

4.4.7. 显​​​​​​​示​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​

有​​​​​​​三​​​​​​​个​​​​​​​命​​​​​​​令​​​​​​​可​​​​​​​显​​​​​​​示​​​​​​​ LVM 逻​​​​​​​辑​​​​​​​卷​​​​​​​的​​​​​​​属​​​​​​​性​​​​​​​:lvs、​​​​​​​lvdisplay 和​​​​​​​ lvscan。​​​​​​​
The lvs command provides logical volume information in a configurable form, displaying one line per logical volume. The lvs command provides a great deal of format control, and is useful for scripting. For information on using the lvs command to customize your output, see 第 4.9 节 “为​​​​​​​ LVM 自​​​​​​​定​​​​​​​义​​​​​​​报​​​​​​​告​​​​​​​”.
lvdisplay 命​​​​​​​令​​​​​​​用​​​​​​​混​​​​​​​合​​​​​​​格​​​​​​​式​​​​​​​显​​​​​​​示​​​​​​​物​​​​​​​理​​​​​​​属​​​​​​​性​​​​​​​(大​​​​​​​小​​​​​​​、​​​​​​​布​​​​​​​局​​​​​​​和​​​​​​​映​​​​​​​射​​​​​​​)。​​​​​​​
下​​​​​​​面​​​​​​​的​​​​​​​命​​​​​​​令​​​​​​​显​​​​​​​示​​​​​​​ vg00 中​​​​​​​ lvol2 的​​​​​​​属​​​​​​​性​​​​​​​。​​​​​​​如​​​​​​​果​​​​​​​已​​​​​​​经​​​​​​​为​​​​​​​原​​​​​​​始​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​创​​​​​​​建​​​​​​​了​​​​​​​快​​​​​​​照​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​,这​​​​​​​个​​​​​​​命​​​​​​​令​​​​​​​还​​​​​​​会​​​​​​​显​​​​​​​示​​​​​​​所​​​​​​​有​​​​​​​快​​​​​​​照​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​及​​​​​​​其​​​​​​​状​​​​​​​态​​​​​​​(激​​​​​​​活​​​​​​​或​​​​​​​者​​​​​​​失​​​​​​​活​​​​​​​)的​​​​​​​列​​​​​​​表​​​​​​​。​​​​​​​
lvdisplay -v /dev/vg00/lvol2
lvscan 命​​​​​​​令​​​​​​​扫​​​​​​​描​​​​​​​系​​​​​​​统​​​​​​​中​​​​​​​所​​​​​​​有​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​并​​​​​​​将​​​​​​​其​​​​​​​列​​​​​​​出​​​​​​​,如​​​​​​​下​​​​​​​:
# lvscan
 ACTIVE                   '/dev/vg0/gfslv' [1.46 GB] inherit

4.4.8. 增​​​​​​​大​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​

要​​​​​​​增​​​​​​​大​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​的​​​​​​​大​​​​​​​小​​​​​​​,请​​​​​​​使​​​​​​​用​​​​​​​ lvextend 命​​​​​​​令​​​​​​​。​​​​​​​
在​​​​​​​扩​​​​​​​展​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​后​​​​​​​,您​​​​​​​将​​​​​​​需​​​​​​​要​​​​​​​增​​​​​​​大​​​​​​​相​​​​​​​关​​​​​​​的​​​​​​​文​​​​​​​件​​​​​​​系​​​​​​​统​​​​​​​以​​​​​​​使​​​​​​​之​​​​​​​与​​​​​​​其​​​​​​​匹​​​​​​​配​​​​​​​。​​​​​​​
当​​​​​​​您​​​​​​​扩​​​​​​​展​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​时​​​​​​​,您​​​​​​​可​​​​​​​以​​​​​​​指​​​​​​​定​​​​​​​您​​​​​​​想​​​​​​​要​​​​​​​增​​​​​​​大​​​​​​​的​​​​​​​量​​​​​​​,或​​​​​​​者​​​​​​​在​​​​​​​您​​​​​​​扩​​​​​​​展​​​​​​​它​​​​​​​之​​​​​​​后​​​​​​​,它​​​​​​​应​​​​​​​该​​​​​​​是​​​​​​​多​​​​​​​大​​​​​​​。​​​​​​​
下​​​​​​​面​​​​​​​的​​​​​​​命​​​​​​​令​​​​​​​将​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​ /dev/myvg/homevol 增​​​​​​​大​​​​​​​到​​​​​​​ 12GB。​​​​​​​
# lvextend -L12G /dev/myvg/homevol 
lvextend -- extending logical volume "/dev/myvg/homevol" to 12 GB
lvextend -- doing automatic backup of volume group "myvg"
lvextend -- logical volume "/dev/myvg/homevol" successfully extended
下​​​​​​​面​​​​​​​的​​​​​​​命​​​​​​​令​​​​​​​为​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​ /dev/myvg/homevol 添​​​​​​​加​​​​​​​了​​​​​​​另​​​​​​​一​​​​​​​个​​​​​​​ GB。​​​​​​​
# lvextend -L+1G /dev/myvg/homevol
lvextend -- extending logical volume "/dev/myvg/homevol" to 13 GB
lvextend -- doing automatic backup of volume group "myvg"
lvextend -- logical volume "/dev/myvg/homevol" successfully extended
和​​​​​​​使​​​​​​​用​​​​​​​ lvcreate 命​​​​​​​令​​​​​​​一​​​​​​​样​​​​​​​,您​​​​​​​可​​​​​​​以​​​​​​​使​​​​​​​用​​​​​​​ lvextend 命​​​​​​​令​​​​​​​的​​​​​​​ -l 参​​​​​​​数​​​​​​​指​​​​​​​定​​​​​​​扩​​​​​​​展​​​​​​​的​​​​​​​数​​​​​​​目​​​​​​​,并​​​​​​​据​​​​​​​此​​​​​​​增​​​​​​​加​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​的​​​​​​​大​​​​​​​小​​​​​​​。​​​​​​​您​​​​​​​还​​​​​​​可​​​​​​​以​​​​​​​使​​​​​​​用​​​​​​​此​​​​​​​参​​​​​​​数​​​​​​​指​​​​​​​定​​​​​​​卷​​​​​​​组​​​​​​​的​​​​​​​比​​​​​​​例​​​​​​​或​​​​​​​者​​​​​​​卷​​​​​​​组​​​​​​​中​​​​​​​剩​​​​​​​余​​​​​​​空​​​​​​​间​​​​​​​的​​​​​​​比​​​​​​​例​​​​​​​。​​​​​​​下​​​​​​​面​​​​​​​的​​​​​​​命​​​​​​​令​​​​​​​扩​​​​​​​展​​​​​​​了​​​​​​​名​​​​​​​为​​​​​​​ testlv 的​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​,并​​​​​​​使​​​​​​​其​​​​​​​使​​​​​​​用​​​​​​​卷​​​​​​​组​​​​​​​ myvg 所​​​​​​​有​​​​​​​未​​​​​​​被​​​​​​​分​​​​​​​配​​​​​​​的​​​​​​​空​​​​​​​间​​​​​​​。​​​​​​​
[root@tng3-1 ~]# lvextend -l +100%FREE /dev/myvg/testlv
  Extending logical volume testlv to 68.59 GB
  Logical volume testlv successfully resized
在​​​​​​​您​​​​​​​扩​​​​​​​展​​​​​​​完​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​后​​​​​​​,有​​​​​​​必​​​​​​​要​​​​​​​增​​​​​​​大​​​​​​​文​​​​​​​件​​​​​​​系​​​​​​​统​​​​​​​的​​​​​​​大​​​​​​​小​​​​​​​与​​​​​​​之​​​​​​​进​​​​​​​行​​​​​​​匹​​​​​​​配​​​​​​​。​​​​​​​
在​​​​​​​默​​​​​​​认​​​​​​​情​​​​​​​况​​​​​​​下​​​​​​​,大​​​​​​​多​​​​​​​数​​​​​​​重​​​​​​​新​​​​​​​定​​​​​​​义​​​​​​​文​​​​​​​件​​​​​​​系​​​​​​​统​​​​​​​大​​​​​​​小​​​​​​​的​​​​​​​工​​​​​​​具​​​​​​​都​​​​​​​会​​​​​​​将​​​​​​​文​​​​​​​件​​​​​​​系​​​​​​​统​​​​​​​的​​​​​​​大​​​​​​​小​​​​​​​增​​​​​​​加​​​​​​​到​​​​​​​基​​​​​​​本​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​的​​​​​​​大​​​​​​​小​​​​​​​,这​​​​​​​样​​​​​​​您​​​​​​​就​​​​​​​不​​​​​​​必​​​​​​​担​​​​​​​心​​​​​​​为​​​​​​​两​​​​​​​个​​​​​​​命​​​​​​​令​​​​​​​指​​​​​​​定​​​​​​​相​​​​​​​同​​​​​​​的​​​​​​​容​​​​​​​量​​​​​​​了​​​​​​​。​​​​​​​

4.4.9. 扩​​​​​​​展​​​​​​​条​​​​​​​状​​​​​​​卷​​​​​​​

要​​​​​​​增​​​​​​​加​​​​​​​条​​​​​​​状​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​的​​​​​​​大​​​​​​​小​​​​​​​,基​​​​​​​本​​​​​​​物​​​​​​​理​​​​​​​卷​​​​​​​中​​​​​​​必​​​​​​​须​​​​​​​有​​​​​​​足​​​​​​​够​​​​​​​的​​​​​​​可​​​​​​​用​​​​​​​空​​​​​​​间​​​​​​​,以​​​​​​​便​​​​​​​让​​​​​​​卷​​​​​​​组​​​​​​​支​​​​​​​持​​​​​​​它​​​​​​​。​​​​​​​例​​​​​​​如​​​​​​​,如​​​​​​​果​​​​​​​您​​​​​​​有​​​​​​​一​​​​​​​个​​​​​​​使​​​​​​​用​​​​​​​了​​​​​​​这​​​​​​​个​​​​​​​卷​​​​​​​组​​​​​​​的​​​​​​​双​​​​​​​向​​​​​​​条​​​​​​​带​​​​​​​,那​​​​​​​么​​​​​​​在​​​​​​​卷​​​​​​​组​​​​​​​中​​​​​​​添​​​​​​​加​​​​​​​一​​​​​​​个​​​​​​​物​​​​​​​理​​​​​​​卷​​​​​​​将​​​​​​​会​​​​​​​使​​​​​​​您​​​​​​​无​​​​​​​法​​​​​​​扩​​​​​​​展​​​​​​​条​​​​​​​带​​​​​​​,反​​​​​​​之​​​​​​​,您​​​​​​​必​​​​​​​须​​​​​​​在​​​​​​​卷​​​​​​​组​​​​​​​中​​​​​​​添​​​​​​​加​​​​​​​至​​​​​​​少​​​​​​​两​​​​​​​个​​​​​​​物​​​​​​​理​​​​​​​卷​​​​​​​。​​​​​​​
例​​​​​​​如​​​​​​​:考​​​​​​​虑​​​​​​​卷​​​​​​​组​​​​​​​ vg 包​​​​​​​括​​​​​​​两​​​​​​​个​​​​​​​基​​​​​​​本​​​​​​​物​​​​​​​理​​​​​​​卷​​​​​​​,参​​​​​​​见​​​​​​​ vgs 命​​​​​​​令​​​​​​​的​​​​​​​结​​​​​​​果​​​​​​​。​​​​​​​
# vgs
  VG   #PV #LV #SN Attr   VSize   VFree
  vg     2   0   0 wz--n- 271.31G 271.31G
您​​​​​​​可​​​​​​​以​​​​​​​使​​​​​​​用​​​​​​​整​​​​​​​个​​​​​​​卷​​​​​​​组​​​​​​​空​​​​​​​间​​​​​​​创​​​​​​​建​​​​​​​一​​​​​​​个​​​​​​​条​​​​​​​带​​​​​​​。​​​​​​​
# lvcreate -n stripe1 -L 271.31G -i 2 vg
  Using default stripesize 64.00 KB
  Rounding up size to full physical extent 271.31 GB
  Logical volume "stripe1" created
# lvs -a -o +devices
  LV      VG   Attr   LSize   Origin Snap%  Move Log Copy%  Devices
  stripe1 vg   -wi-a- 271.31G                               /dev/sda1(0),/dev/sdb1(0)
注​​​​​​​意​​​​​​​:那​​​​​​​个​​​​​​​卷​​​​​​​组​​​​​​​中​​​​​​​已​​​​​​​经​​​​​​​没​​​​​​​有​​​​​​​剩​​​​​​​余​​​​​​​空​​​​​​​间​​​​​​​了​​​​​​​。​​​​​​​
# vgs
  VG   #PV #LV #SN Attr   VSize   VFree
  vg     2   1   0 wz--n- 271.31G    0
下​​​​​​​面​​​​​​​的​​​​​​​命​​​​​​​令​​​​​​​在​​​​​​​卷​​​​​​​组​​​​​​​中​​​​​​​添​​​​​​​加​​​​​​​了​​​​​​​另​​​​​​​一​​​​​​​个​​​​​​​物​​​​​​​理​​​​​​​卷​​​​​​​,那​​​​​​​么​​​​​​​就​​​​​​​有​​​​​​​了​​​​​​​ 135G 的​​​​​​​额​​​​​​​外​​​​​​​空​​​​​​​间​​​​​​​。​​​​​​​
# vgextend vg /dev/sdc1
  Volume group "vg" successfully extended
# vgs
  VG   #PV #LV #SN Attr   VSize   VFree
  vg     3   1   0 wz--n- 406.97G 135.66G
此​​​​​​​时​​​​​​​您​​​​​​​不​​​​​​​能​​​​​​​扩​​​​​​​展​​​​​​​条​​​​​​​状​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​来​​​​​​​充​​​​​​​满​​​​​​​卷​​​​​​​组​​​​​​​,因​​​​​​​为​​​​​​​需​​​​​​​要​​​​​​​两​​​​​​​个​​​​​​​基​​​​​​​本​​​​​​​设​​​​​​​备​​​​​​​来​​​​​​​将​​​​​​​数​​​​​​​据​​​​​​​按​​​​​​​条​​​​​​​状​​​​​​​保​​​​​​​存​​​​​​​。​​​​​​​
# lvextend vg/stripe1 -L 406G
  Using stripesize of last segment 64.00 KB
  Extending logical volume stripe1 to 406.00 GB
  Insufficient suitable allocatable extents for logical volume stripe1: 34480 
more required
要​​​​​​​扩​​​​​​​展​​​​​​​条​​​​​​​状​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​,请​​​​​​​添​​​​​​​加​​​​​​​另​​​​​​​一​​​​​​​个​​​​​​​物​​​​​​​理​​​​​​​卷​​​​​​​,然​​​​​​​后​​​​​​​扩​​​​​​​展​​​​​​​该​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​。​​​​​​​在​​​​​​​这​​​​​​​个​​​​​​​示​​​​​​​例​​​​​​​中​​​​​​​,在​​​​​​​卷​​​​​​​组​​​​​​​中​​​​​​​添​​​​​​​加​​​​​​​两​​​​​​​个​​​​​​​物​​​​​​​理​​​​​​​卷​​​​​​​,我​​​​​​​们​​​​​​​就​​​​​​​可​​​​​​​以​​​​​​​将​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​ 5A 扩​​​​​​​展​​​​​​​成​​​​​​​卷​​​​​​​组​​​​​​​的​​​​​​​大​​​​​​​小​​​​​​​。​​​​​​​
# vgextend vg /dev/sdd1
  Volume group "vg" successfully extended
# vgs
  VG   #PV #LV #SN Attr   VSize   VFree
  vg     4   1   0 wz--n- 542.62G 271.31G
# lvextend vg/stripe1 -L 542G
  Using stripesize of last segment 64.00 KB
  Extending logical volume stripe1 to 542.00 GB
  Logical volume stripe1 successfully resized
如​​​​​​​果​​​​​​​您​​​​​​​没​​​​​​​有​​​​​​​足​​​​​​​够​​​​​​​的​​​​​​​基​​​​​​​本​​​​​​​物​​​​​​​理​​​​​​​设​​​​​​​备​​​​​​​来​​​​​​​扩​​​​​​​展​​​​​​​条​​​​​​​状​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​,那​​​​​​​么​​​​​​​在​​​​​​​扩​​​​​​​展​​​​​​​不​​​​​​​是​​​​​​​条​​​​​​​状​​​​​​​的​​​​​​​情​​​​​​​况​​​​​​​下​​​​​​​也​​​​​​​可​​​​​​​能​​​​​​​扩​​​​​​​大​​​​​​​卷​​​​​​​,但​​​​​​​可​​​​​​​能​​​​​​​导​​​​​​​致​​​​​​​性​​​​​​​能​​​​​​​不​​​​​​​平​​​​​​​衡​​​​​​​。​​​​​​​当​​​​​​​为​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​添​​​​​​​加​​​​​​​空​​​​​​​间​​​​​​​时​​​​​​​,默​​​​​​​认​​​​​​​操​​​​​​​作​​​​​​​是​​​​​​​使​​​​​​​用​​​​​​​与​​​​​​​现​​​​​​​有​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​最​​​​​​​新​​​​​​​片​​​​​​​段​​​​​​​相​​​​​​​同​​​​​​​的​​​​​​​条​​​​​​​状​​​​​​​参​​​​​​​数​​​​​​​,但​​​​​​​您​​​​​​​可​​​​​​​覆​​​​​​​盖​​​​​​​那​​​​​​​些​​​​​​​参​​​​​​​数​​​​​​​。​​​​​​​下​​​​​​​面​​​​​​​的​​​​​​​例​​​​​​​子​​​​​​​是​​​​​​​在​​​​​​​启​​​​​​​动​​​​​​​ lvextend 命​​​​​​​令​​​​​​​失​​​​​​​败​​​​​​​后​​​​​​​,使​​​​​​​用​​​​​​​剩​​​​​​​余​​​​​​​的​​​​​​​可​​​​​​​用​​​​​​​空​​​​​​​间​​​​​​​扩​​​​​​​大​​​​​​​了​​​​​​​条​​​​​​​状​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​。​​​​​​​
# lvextend vg/stripe1 -L 406G
  Using stripesize of last segment 64.00 KB
  Extending logical volume stripe1 to 406.00 GB
  Insufficient suitable allocatable extents for logical volume stripe1: 34480 
more required
# lvextend -i1 -l+100%FREE vg/stripe1

4.4.10. 缩​​​​​​​小​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​

要​​​​​​​减​​​​​​​小​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​的​​​​​​​大​​​​​​​小​​​​​​​,首​​​​​​​先​​​​​​​卸​​​​​​​载​​​​​​​文​​​​​​​件​​​​​​​系​​​​​​​统​​​​​​​。​​​​​​​您​​​​​​​可​​​​​​​以​​​​​​​接​​​​​​​着​​​​​​​使​​​​​​​用​​​​​​​ lvreduce 命​​​​​​​令​​​​​​​缩​​​​​​​小​​​​​​​卷​​​​​​​,缩​​​​​​​小​​​​​​​卷​​​​​​​后​​​​​​​,重​​​​​​​新​​​​​​​挂​​​​​​​载​​​​​​​文​​​​​​​件​​​​​​​系​​​​​​​统​​​​​​​。​​​​​​​

警告

在​​​​​​​缩​​​​​​​小​​​​​​​卷​​​​​​​自​​​​​​​身​​​​​​​大​​​​​​​小​​​​​​​之​​​​​​​前​​​​​​​,减​​​​​​​小​​​​​​​文​​​​​​​件​​​​​​​系​​​​​​​统​​​​​​​或​​​​​​​者​​​​​​​卷​​​​​​​中​​​​​​​任​​​​​​​何​​​​​​​事​​​​​​​物​​​​​​​的​​​​​​​大​​​​​​​小​​​​​​​是​​​​​​​很​​​​​​​重​​​​​​​要​​​​​​​的​​​​​​​,否​​​​​​​则​​​​​​​您​​​​​​​可​​​​​​​能​​​​​​​会​​​​​​​丢​​​​​​​失​​​​​​​数​​​​​​​据​​​​​​​。​​​​​​​
缩​​​​​​​小​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​,释​​​​​​​放​​​​​​​一​​​​​​​些​​​​​​​卷​​​​​​​组​​​​​​​,可​​​​​​​将​​​​​​​其​​​​​​​分​​​​​​​配​​​​​​​给​​​​​​​卷​​​​​​​组​​​​​​​中​​​​​​​的​​​​​​​其​​​​​​​它​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​。​​​​​​​
下​​​​​​​面​​​​​​​的​​​​​​​例​​​​​​​子​​​​​​​是​​​​​​​将​​​​​​​卷​​​​​​​组​​​​​​​ vg00 中​​​​​​​的​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​ lvol1 的​​​​​​​减​​​​​​​小​​​​​​​三​​​​​​​个​​​​​​​逻​​​​​​​辑​​​​​​​扩​​​​​​​展​​​​​​​。​​​​​​​
lvreduce -l -3 vg00/lvol1

4.5. 创​​​​​​​建​​​​​​​快​​​​​​​照​​​​​​​卷​​​​​​​

使​​​​​​​用​​​​​​​ lvcreate 命​​​​​​​令​​​​​​​的​​​​​​​ -s 参​​​​​​​数​​​​​​​创​​​​​​​建​​​​​​​快​​​​​​​照​​​​​​​卷​​​​​​​。​​​​​​​快​​​​​​​照​​​​​​​卷​​​​​​​是​​​​​​​可​​​​​​​写​​​​​​​入​​​​​​​的​​​​​​​。​​​​​​​

注意

在​​​​​​​群​​​​​​​集​​​​​​​中​​​​​​​不​​​​​​​支​​​​​​​持​​​​​​​跨​​​​​​​节​​​​​​​点​​​​​​​的​​​​​​​ LVM 快​​​​​​​照​​​​​​​。​​​​​​​
以​​​​​​​下​​​​​​​命​​​​​​​令​​​​​​​创​​​​​​​建​​​​​​​了​​​​​​​一​​​​​​​个​​​​​​​快​​​​​​​照​​​​​​​卷​​​​​​​,大​​​​​​​小​​​​​​​为​​​​​​​ 100MB,名​​​​​​​为​​​​​​​ /dev/vg00/snap。​​​​​​​它​​​​​​​是​​​​​​​名​​​​​​​为​​​​​​​ /dev/vg00/lvol1 的​​​​​​​源​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​的​​​​​​​快​​​​​​​照​​​​​​​。​​​​​​​如​​​​​​​果​​​​​​​源​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​有​​​​​​​一​​​​​​​个​​​​​​​文​​​​​​​件​​​​​​​系​​​​​​​统​​​​​​​,您​​​​​​​可​​​​​​​以​​​​​​​将​​​​​​​快​​​​​​​照​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​挂​​​​​​​载​​​​​​​到​​​​​​​任​​​​​​​意​​​​​​​目​​​​​​​录​​​​​​​下​​​​​​​,以​​​​​​​便​​​​​​​访​​​​​​​问​​​​​​​该​​​​​​​文​​​​​​​件​​​​​​​系​​​​​​​统​​​​​​​的​​​​​​​内​​​​​​​容​​​​​​​来​​​​​​​在​​​​​​​源​​​​​​​文​​​​​​​件​​​​​​​系​​​​​​​统​​​​​​​不​​​​​​​断​​​​​​​更​​​​​​​新​​​​​​​的​​​​​​​情​​​​​​​况​​​​​​​下​​​​​​​进​​​​​​​行​​​​​​​备​​​​​​​份​​​​​​​。​​​​​​​
lvcreate --size 100M --snapshot --name snap /dev/vg00/lvol1
在​​​​​​​您​​​​​​​创​​​​​​​建​​​​​​​了​​​​​​​快​​​​​​​照​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​之​​​​​​​后​​​​​​​,对​​​​​​​源​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​执​​​​​​​行​​​​​​​ lvdisplay 命​​​​​​​令​​​​​​​产​​​​​​​生​​​​​​​的​​​​​​​输​​​​​​​出​​​​​​​结​​​​​​​果​​​​​​​包​​​​​​​含​​​​​​​了​​​​​​​所​​​​​​​有​​​​​​​扩​​​​​​​展​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​及​​​​​​​其​​​​​​​状​​​​​​​态​​​​​​​(激​​​​​​​活​​​​​​​或​​​​​​​者​​​​​​​失​​​​​​​活​​​​​​​)的​​​​​​​列​​​​​​​表​​​​​​​。​​​​​​​
下​​​​​​​面​​​​​​​的​​​​​​​命​​​​​​​令​​​​​​​显​​​​​​​示​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​ /dev/new_vg/lvol0 的​​​​​​​状​​​​​​​态​​​​​​​,并​​​​​​​为​​​​​​​其​​​​​​​生​​​​​​​成​​​​​​​了​​​​​​​快​​​​​​​照​​​​​​​卷​​​​​​​ /dev/new_vg/newvgsnap。​​​​​​​
# lvdisplay /dev/new_vg/lvol0
  --- Logical volume ---
  LV Name                /dev/new_vg/lvol0
  VG Name                new_vg
  LV UUID                LBy1Tz-sr23-OjsI-LT03-nHLC-y8XW-EhCl78
  LV Write Access        read/write
  LV snapshot status     source of
                         /dev/new_vg/newvgsnap1 [active]
  LV Status              available
  # open                 0
  LV Size                52.00 MB
  Current LE             13
  Segments               1
  Allocation             inherit
  Read ahead sectors     0
  Block device           253:2
默​​​​​​​认​​​​​​​情​​​​​​​况​​​​​​​下​​​​​​​,lvs 命​​​​​​​令​​​​​​​显​​​​​​​示​​​​​​​快​​​​​​​照​​​​​​​卷​​​​​​​的​​​​​​​源​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​以​​​​​​​及​​​​​​​目​​​​​​​前​​​​​​​所​​​​​​​使​​​​​​​用​​​​​​​的​​​​​​​快​​​​​​​照​​​​​​​卷​​​​​​​的​​​​​​​比​​​​​​​例​​​​​​​。​​​​​​​下​​​​​​​面​​​​​​​的​​​​​​​例​​​​​​​子​​​​​​​显​​​​​​​示​​​​​​​了​​​​​​​在​​​​​​​系​​​​​​​统​​​​​​​中​​​​​​​执​​​​​​​行​​​​​​​ lvs 命​​​​​​​令​​​​​​​的​​​​​​​默​​​​​​​认​​​​​​​输​​​​​​​出​​​​​​​结​​​​​​​果​​​​​​​,其​​​​​​​中​​​​​​​包​​​​​​​括​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​ /dev/new_vg/lvol0 以​​​​​​​及​​​​​​​为​​​​​​​其​​​​​​​生​​​​​​​成​​​​​​​的​​​​​​​快​​​​​​​照​​​​​​​卷​​​​​​​ /dev/new_vg/newvgsnap。​​​​​​​
# lvs
  LV         VG     Attr   LSize  Origin Snap%  Move Log Copy%
  lvol0      new_vg owi-a- 52.00M
  newvgsnap1 new_vg swi-a-  8.00M lvol0    0.20

注意

因​​​​​​​为​​​​​​​快​​​​​​​照​​​​​​​在​​​​​​​源​​​​​​​卷​​​​​​​有​​​​​​​变​​​​​​​化​​​​​​​时​​​​​​​会​​​​​​​增​​​​​​​大​​​​​​​,所​​​​​​​以​​​​​​​常​​​​​​​规​​​​​​​使​​​​​​​用​​​​​​​ lvs 命​​​​​​​令​​​​​​​监​​​​​​​控​​​​​​​快​​​​​​​照​​​​​​​卷​​​​​​​的​​​​​​​比​​​​​​​例​​​​​​​以​​​​​​​确​​​​​​​定​​​​​​​它​​​​​​​还​​​​​​​没​​​​​​​有​​​​​​​被​​​​​​​填​​​​​​​满​​​​​​​是​​​​​​​很​​​​​​​重​​​​​​​要​​​​​​​的​​​​​​​。​​​​​​​使​​​​​​​用​​​​​​​了​​​​​​​ 100% 的​​​​​​​快​​​​​​​照​​​​​​​卷​​​​​​​会​​​​​​​完​​​​​​​全​​​​​​​丢​​​​​​​失​​​​​​​,因​​​​​​​为​​​​​​​写​​​​​​​入​​​​​​​源​​​​​​​卷​​​​​​​中​​​​​​​不​​​​​​​修​​​​​​​改​​​​​​​的​​​​​​​部​​​​​​​分​​​​​​​的​​​​​​​操​​​​​​​作​​​​​​​如​​​​​​​果​​​​​​​不​​​​​​​破​​​​​​​坏​​​​​​​快​​​​​​​照​​​​​​​是​​​​​​​无​​​​​​​法​​​​​​​成​​​​​​​功​​​​​​​的​​​​​​​。​​​​​​​

4.6. 用​​​​​​​过​​​​​​​滤​​​​​​​器​​​​​​​控​​​​​​​制​​​​​​​ LVM 设​​​​​​​备​​​​​​​扫​​​​​​​描​​​​​​​

在​​​​​​​启​​​​​​​动​​​​​​​时​​​​​​​会​​​​​​​运​​​​​​​行​​​​​​​ vgscan 命​​​​​​​令​​​​​​​来​​​​​​​扫​​​​​​​描​​​​​​​系​​​​​​​统​​​​​​​中​​​​​​​的​​​​​​​块​​​​​​​设​​​​​​​备​​​​​​​以​​​​​​​查​​​​​​​找​​​​​​​ LVM 标​​​​​​​签​​​​​​​来​​​​​​​确​​​​​​​定​​​​​​​哪​​​​​​​些​​​​​​​是​​​​​​​物​​​​​​​理​​​​​​​卷​​​​​​​,并​​​​​​​读​​​​​​​取​​​​​​​元​​​​​​​数​​​​​​​据​​​​​​​建​​​​​​​立​​​​​​​卷​​​​​​​组​​​​​​​列​​​​​​​表​​​​​​​。​​​​​​​物​​​​​​​理​​​​​​​卷​​​​​​​的​​​​​​​名​​​​​​​称​​​​​​​被​​​​​​​保​​​​​​​存​​​​​​​在​​​​​​​系​​​​​​​统​​​​​​​每​​​​​​​个​​​​​​​节​​​​​​​点​​​​​​​的​​​​​​​缓​​​​​​​冲​​​​​​​文​​​​​​​件​​​​​​​中​​​​​​​,即​​​​​​​ /etc/lvm/.cache。​​​​​​​之​​​​​​​后​​​​​​​运​​​​​​​行​​​​​​​的​​​​​​​命​​​​​​​令​​​​​​​可​​​​​​​以​​​​​​​读​​​​​​​取​​​​​​​该​​​​​​​文​​​​​​​件​​​​​​​以​​​​​​​避​​​​​​​免​​​​​​​重​​​​​​​复​​​​​​​扫​​​​​​​描​​​​​​​。​​​​​​​
您​​​​​​​可​​​​​​​以​​​​​​​在​​​​​​​ lvm.conf 配​​​​​​​置​​​​​​​文​​​​​​​件​​​​​​​中​​​​​​​通​​​​​​​过​​​​​​​设​​​​​​​置​​​​​​​过​​​​​​​滤​​​​​​​器​​​​​​​来​​​​​​​控​​​​​​​制​​​​​​​ LVM 要​​​​​​​扫​​​​​​​描​​​​​​​的​​​​​​​设​​​​​​​备​​​​​​​。​​​​​​​过​​​​​​​滤​​​​​​​器​​​​​​​由​​​​​​​一​​​​​​​组​​​​​​​简​​​​​​​单​​​​​​​正​​​​​​​则​​​​​​​表​​​​​​​达​​​​​​​式​​​​​​​组​​​​​​​成​​​​​​​,使​​​​​​​用​​​​​​​ /dev 目​​​​​​​录​​​​​​​中​​​​​​​的​​​​​​​设​​​​​​​备​​​​​​​名​​​​​​​称​​​​​​​来​​​​​​​确​​​​​​​定​​​​​​​接​​​​​​​受​​​​​​​还​​​​​​​是​​​​​​​拒​​​​​​​绝​​​​​​​找​​​​​​​到​​​​​​​的​​​​​​​块​​​​​​​设​​​​​​​备​​​​​​​。​​​​​​​
下​​​​​​​面​​​​​​​的​​​​​​​例​​​​​​​子​​​​​​​显​​​​​​​示​​​​​​​用​​​​​​​过​​​​​​​滤​​​​​​​器​​​​​​​控​​​​​​​制​​​​​​​ LVM 要​​​​​​​扫​​​​​​​描​​​​​​​设​​​​​​​备​​​​​​​的​​​​​​​方​​​​​​​法​​​​​​​。​​​​​​​请​​​​​​​注​​​​​​​意​​​​​​​:有​​​​​​​些​​​​​​​例​​​​​​​子​​​​​​​不​​​​​​​一​​​​​​​定​​​​​​​是​​​​​​​最​​​​​​​好​​​​​​​的​​​​​​​实​​​​​​​践​​​​​​​方​​​​​​​法​​​​​​​,因​​​​​​​为​​​​​​​正​​​​​​​则​​​​​​​表​​​​​​​达​​​​​​​式​​​​​​​根​​​​​​​据​​​​​​​完​​​​​​​整​​​​​​​路​​​​​​​径​​​​​​​名​​​​​​​称​​​​​​​自​​​​​​​由​​​​​​​匹​​​​​​​配​​​​​​​。​​​​​​​例​​​​​​​如​​​​​​​:a/.*loop.*/ 和​​​​​​​ a/loop/ 及​​​​​​​ /dev/solooperation/lvol1 都​​​​​​​对​​​​​​​映​​​​​​​。​​​​​​​
下​​​​​​​面​​​​​​​的​​​​​​​过​​​​​​​滤​​​​​​​器​​​​​​​添​​​​​​​加​​​​​​​所​​​​​​​有​​​​​​​找​​​​​​​到​​​​​​​的​​​​​​​设​​​​​​​备​​​​​​​,这​​​​​​​是​​​​​​​配​​​​​​​置​​​​​​​文​​​​​​​件​​​​​​​中​​​​​​​没​​​​​​​有​​​​​​​配​​​​​​​置​​​​​​​过​​​​​​​滤​​​​​​​器​​​​​​​的​​​​​​​默​​​​​​​认​​​​​​​行​​​​​​​为​​​​​​​:
filter = [ "a/.*/" ]
下​​​​​​​面​​​​​​​的​​​​​​​过​​​​​​​滤​​​​​​​器​​​​​​​会​​​​​​​删​​​​​​​除​​​​​​​光​​​​​​​驱​​​​​​​以​​​​​​​避​​​​​​​免​​​​​​​在​​​​​​​驱​​​​​​​动​​​​​​​器​​​​​​​中​​​​​​​没​​​​​​​有​​​​​​​介​​​​​​​质​​​​​​​时​​​​​​​造​​​​​​​成​​​​​​​延​​​​​​​迟​​​​​​​:
filter = [ "r|/dev/cdrom|" ]
下​​​​​​​面​​​​​​​的​​​​​​​过​​​​​​​滤​​​​​​​器​​​​​​​添​​​​​​​加​​​​​​​所​​​​​​​有​​​​​​​回​​​​​​​路​​​​​​​设​​​​​​​备​​​​​​​并​​​​​​​删​​​​​​​除​​​​​​​其​​​​​​​它​​​​​​​块​​​​​​​设​​​​​​​备​​​​​​​:
filter = [ "a/loop.*/", "r/.*/" ]
下​​​​​​​面​​​​​​​的​​​​​​​过​​​​​​​滤​​​​​​​器​​​​​​​添​​​​​​​加​​​​​​​所​​​​​​​有​​​​​​​回​​​​​​​路​​​​​​​设​​​​​​​备​​​​​​​和​​​​​​​ IDE 设​​​​​​​备​​​​​​​,同​​​​​​​时​​​​​​​删​​​​​​​除​​​​​​​所​​​​​​​有​​​​​​​其​​​​​​​它​​​​​​​块​​​​​​​设​​​​​​​备​​​​​​​:
filter =[ "a|loop.*|", "a|/dev/hd.*|", "r|.*|" ]
下​​​​​​​面​​​​​​​的​​​​​​​过​​​​​​​滤​​​​​​​器​​​​​​​只​​​​​​​添​​​​​​​加​​​​​​​第​​​​​​​一​​​​​​​个​​​​​​​ IDE 驱​​​​​​​动​​​​​​​器​​​​​​​中​​​​​​​的​​​​​​​分​​​​​​​区​​​​​​​ 8,同​​​​​​​时​​​​​​​删​​​​​​​除​​​​​​​所​​​​​​​有​​​​​​​其​​​​​​​它​​​​​​​块​​​​​​​设​​​​​​​备​​​​​​​:
filter = [ "a|^/dev/hda8$|", "r/.*/" ]
For more information on the lvm.conf file, see 附录 B, LVM 配​​​​​​​置​​​​​​​文​​​​​​​件​​​​​​​ and the lvm.conf(5) man page.

4.7. 在​​​​​​​线​​​​​​​数​​​​​​​据​​​​​​​重​​​​​​​定​​​​​​​位​​​​​​​

您​​​​​​​可​​​​​​​以​​​​​​​使​​​​​​​用​​​​​​​ pvmove 命​​​​​​​令​​​​​​​在​​​​​​​系​​​​​​​统​​​​​​​还​​​​​​​在​​​​​​​使​​​​​​​用​​​​​​​时​​​​​​​移​​​​​​​动​​​​​​​数​​​​​​​据​​​​​​​。​​​​​​​
pvmove 命​​​​​​​令​​​​​​​将​​​​​​​数​​​​​​​据​​​​​​​分​​​​​​​成​​​​​​​片​​​​​​​段​​​​​​​,并​​​​​​​生​​​​​​​成​​​​​​​临​​​​​​​时​​​​​​​镜​​​​​​​像​​​​​​​来​​​​​​​移​​​​​​​动​​​​​​​每​​​​​​​个​​​​​​​片​​​​​​​段​​​​​​​。​​​​​​​有​​​​​​​关​​​​​​​ pvmove 命​​​​​​​令​​​​​​​操​​​​​​​作​​​​​​​的​​​​​​​详​​​​​​​细​​​​​​​内​​​​​​​容​​​​​​​请​​​​​​​参​​​​​​​考​​​​​​​ pvmove(8) man page。​​​​​​​
下​​​​​​​面​​​​​​​的​​​​​​​命​​​​​​​令​​​​​​​将​​​​​​​物​​​​​​​理​​​​​​​卷​​​​​​​ /dev/sdc1 中​​​​​​​所​​​​​​​有​​​​​​​分​​​​​​​配​​​​​​​了​​​​​​​的​​​​​​​空​​​​​​​间​​​​​​​都​​​​​​​移​​​​​​​动​​​​​​​到​​​​​​​卷​​​​​​​组​​​​​​​中​​​​​​​其​​​​​​​它​​​​​​​可​​​​​​​用​​​​​​​物​​​​​​​理​​​​​​​卷​​​​​​​中​​​​​​​:
pvmove /dev/sdc1
下​​​​​​​面​​​​​​​的​​​​​​​命​​​​​​​令​​​​​​​只​​​​​​​移​​​​​​​动​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​ MyLV 中​​​​​​​的​​​​​​​扩​​​​​​​展​​​​​​​:
pvmove -n MyLV /dev/sdc1
因​​​​​​​为​​​​​​​执​​​​​​​行​​​​​​​ pvmove 命​​​​​​​令​​​​​​​要​​​​​​​花​​​​​​​很​​​​​​​长​​​​​​​时​​​​​​​间​​​​​​​,您​​​​​​​可​​​​​​​能​​​​​​​想​​​​​​​要​​​​​​​在​​​​​​​后​​​​​​​台​​​​​​​运​​​​​​​行​​​​​​​此​​​​​​​命​​​​​​​令​​​​​​​以​​​​​​​避​​​​​​​免​​​​​​​在​​​​​​​前​​​​​​​台​​​​​​​显​​​​​​​示​​​​​​​更​​​​​​​新​​​​​​​的​​​​​​​过​​​​​​​程​​​​​​​。​​​​​​​下​​​​​​​面​​​​​​​的​​​​​​​命​​​​​​​令​​​​​​​在​​​​​​​后​​​​​​​台​​​​​​​将​​​​​​​所​​​​​​​有​​​​​​​分​​​​​​​配​​​​​​​给​​​​​​​物​​​​​​​理​​​​​​​卷​​​​​​​ /dev/sdc1 的​​​​​​​扩​​​​​​​展​​​​​​​移​​​​​​​动​​​​​​​到​​​​​​​ /dev/sdf1。​​​​​​​
pvmove -b /dev/sdc1 /dev/sdf1
下​​​​​​​面​​​​​​​的​​​​​​​命​​​​​​​令​​​​​​​以​​​​​​​ 5 秒​​​​​​​为​​​​​​​间​​​​​​​隔​​​​​​​,以​​​​​​​百​​​​​​​分​​​​​​​比​​​​​​​形​​​​​​​式​​​​​​​报​​​​​​​告​​​​​​​移​​​​​​​动​​​​​​​的​​​​​​​过​​​​​​​程​​​​​​​。​​​​​​​
pvmove -i5 /dev/sdd1

4.8. 在​​​​​​​群​​​​​​​集​​​​​​​的​​​​​​​独​​​​​​​立​​​​​​​节​​​​​​​点​​​​​​​中​​​​​​​激​​​​​​​活​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​

如​​​​​​​果​​​​​​​您​​​​​​​在​​​​​​​群​​​​​​​集​​​​​​​环​​​​​​​境​​​​​​​中​​​​​​​安​​​​​​​装​​​​​​​了​​​​​​​ lvm,您​​​​​​​可​​​​​​​能​​​​​​​需​​​​​​​要​​​​​​​多​​​​​​​次​​​​​​​在​​​​​​​一​​​​​​​个​​​​​​​节​​​​​​​点​​​​​​​完​​​​​​​全​​​​​​​激​​​​​​​活​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​。​​​​​​​例​​​​​​​如​​​​​​​: pvmove 命​​​​​​​令​​​​​​​,且​​​​​​​需​​​​​​​要​​​​​​​对​​​​​​​卷​​​​​​​的​​​​​​​完​​​​​​​全​​​​​​​访​​​​​​​问​​​​​​​。​​​​​​​LVM 快​​​​​​​照​​​​​​​也​​​​​​​需​​​​​​​要​​​​​​​对​​​​​​​卷​​​​​​​的​​​​​​​完​​​​​​​全​​​​​​​访​​​​​​​问​​​​​​​。​​​​​​​
要​​​​​​​在​​​​​​​一​​​​​​​个​​​​​​​节​​​​​​​点​​​​​​​上​​​​​​​完​​​​​​​全​​​​​​​激​​​​​​​活​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​,请​​​​​​​使​​​​​​​用​​​​​​​ lvchange -aey 命​​​​​​​令​​​​​​​。​​​​​​​另​​​​​​​外​​​​​​​,您​​​​​​​可​​​​​​​以​​​​​​​使​​​​​​​用​​​​​​​ lvchange -aly 来​​​​​​​只​​​​​​​激​​​​​​​活​​​​​​​本​​​​​​​地​​​​​​​节​​​​​​​点​​​​​​​中​​​​​​​的​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​,而​​​​​​​不​​​​​​​是​​​​​​​所​​​​​​​有​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​。​​​​​​​您​​​​​​​可​​​​​​​以​​​​​​​晚​​​​​​​些​​​​​​​时​​​​​​​候​​​​​​​在​​​​​​​附​​​​​​​加​​​​​​​节​​​​​​​点​​​​​​​上​​​​​​​同​​​​​​​时​​​​​​​激​​​​​​​活​​​​​​​它​​​​​​​们​​​​​​​。​​​​​​​
You can also activate logical volumes on individual nodes by using LVM tags, which are described in 附录 C, LVM 对​​​​​​​象​​​​​​​标​​​​​​​签​​​​​​​. You can also specify activation of nodes in the configuration file, which is described in 附录 B, LVM 配​​​​​​​置​​​​​​​文​​​​​​​件​​​​​​​.

4.9. 为​​​​​​​ LVM 自​​​​​​​定​​​​​​​义​​​​​​​报​​​​​​​告​​​​​​​

您​​​​​​​可​​​​​​​以​​​​​​​使​​​​​​​用​​​​​​​ pvs、​​​​​​​lvs 和​​​​​​​ vgs 命​​​​​​​令​​​​​​​得​​​​​​​到​​​​​​​一​​​​​​​份​​​​​​​ LVM 对​​​​​​​象​​​​​​​的​​​​​​​简​​​​​​​洁​​​​​​​自​​​​​​​定​​​​​​​义​​​​​​​报​​​​​​​告​​​​​​​。​​​​​​​这​​​​​​​些​​​​​​​命​​​​​​​令​​​​​​​生​​​​​​​成​​​​​​​的​​​​​​​报​​​​​​​告​​​​​​​包​​​​​​​括​​​​​​​每​​​​​​​行​​​​​​​一​​​​​​​个​​​​​​​对​​​​​​​象​​​​​​​的​​​​​​​输​​​​​​​出​​​​​​​结​​​​​​​果​​​​​​​。​​​​​​​每​​​​​​​行​​​​​​​包​​​​​​​含​​​​​​​有​​​​​​​关​​​​​​​对​​​​​​​象​​​​​​​属​​​​​​​性​​​​​​​字​​​​​​​段​​​​​​​排​​​​​​​序​​​​​​​列​​​​​​​表​​​​​​​。​​​​​​​选​​​​​​​择​​​​​​​要​​​​​​​报​​​​​​​告​​​​​​​的​​​​​​​对​​​​​​​象​​​​​​​有​​​​​​​五​​​​​​​种​​​​​​​方​​​​​​​法​​​​​​​:根​​​​​​​据​​​​​​​物​​​​​​​理​​​​​​​卷​​​​​​​、​​​​​​​卷​​​​​​​组​​​​​​​、​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​、​​​​​​​物​​​​​​​理​​​​​​​卷​​​​​​​片​​​​​​​段​​​​​​​和​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​片​​​​​​​段​​​​​​​。​​​​​​​
以​​​​​​​下​​​​​​​部​​​​​​​分​​​​​​​提​​​​​​​供​​​​​​​了​​​​​​​:
  • 您​​​​​​​可​​​​​​​以​​​​​​​用​​​​​​​来​​​​​​​扩​​​​​​​展​​​​​​​生​​​​​​​成​​​​​​​报​​​​​​​告​​​​​​​格​​​​​​​式​​​​​​​的​​​​​​​参​​​​​​​数​​​​​​​概​​​​​​​述​​​​​​​。​​​​​​​
  • 您​​​​​​​可​​​​​​​以​​​​​​​为​​​​​​​每​​​​​​​个​​​​​​​ LVM 对​​​​​​​象​​​​​​​选​​​​​​​择​​​​​​​的​​​​​​​字​​​​​​​段​​​​​​​列​​​​​​​表​​​​​​​。​​​​​​​
  • 您​​​​​​​可​​​​​​​以​​​​​​​用​​​​​​​来​​​​​​​对​​​​​​​生​​​​​​​成​​​​​​​的​​​​​​​报​​​​​​​告​​​​​​​进​​​​​​​行​​​​​​​排​​​​​​​序​​​​​​​的​​​​​​​命​​​​​​​令​​​​​​​参​​​​​​​数​​​​​​​总​​​​​​​结​​​​​​​。​​​​​​​
  • 指​​​​​​​定​​​​​​​报​​​​​​​告​​​​​​​输​​​​​​​出​​​​​​​结​​​​​​​果​​​​​​​单​​​​​​​位​​​​​​​的​​​​​​​步​​​​​​​骤​​​​​​​。​​​​​​​

4.9.1. 格​​​​​​​式​​​​​​​控​​​​​​​制​​​​​​​

无​​​​​​​论​​​​​​​您​​​​​​​使​​​​​​​用​​​​​​​ pvs、​​​​​​​lvs 或​​​​​​​者​​​​​​​ vgs 命​​​​​​​令​​​​​​​,都​​​​​​​要​​​​​​​确​​​​​​​定​​​​​​​默​​​​​​​认​​​​​​​字​​​​​​​段​​​​​​​显​​​​​​​示​​​​​​​和​​​​​​​排​​​​​​​列​​​​​​​顺​​​​​​​序​​​​​​​。​​​​​​​您​​​​​​​可​​​​​​​以​​​​​​​使​​​​​​​用​​​​​​​以​​​​​​​下​​​​​​​参​​​​​​​数​​​​​​​来​​​​​​​控​​​​​​​制​​​​​​​这​​​​​​​些​​​​​​​命​​​​​​​令​​​​​​​的​​​​​​​输​​​​​​​出​​​​​​​结​​​​​​​果​​​​​​​:
  • 您​​​​​​​可​​​​​​​以​​​​​​​使​​​​​​​用​​​​​​​ -o 参​​​​​​​数​​​​​​​将​​​​​​​字​​​​​​​段​​​​​​​显​​​​​​​示​​​​​​​的​​​​​​​内​​​​​​​容​​​​​​​改​​​​​​​成​​​​​​​任​​​​​​​意​​​​​​​内​​​​​​​容​​​​​​​,而​​​​​​​不​​​​​​​只​​​​​​​是​​​​​​​默​​​​​​​认​​​​​​​的​​​​​​​内​​​​​​​容​​​​​​​。​​​​​​​例​​​​​​​如​​​​​​​:pvs 命​​​​​​​令​​​​​​​默​​​​​​​认​​​​​​​显​​​​​​​示​​​​​​​如​​​​​​​下​​​​​​​(显​​​​​​​示​​​​​​​有​​​​​​​关​​​​​​​物​​​​​​​理​​​​​​​卷​​​​​​​的​​​​​​​信​​​​​​​息​​​​​​​):
    # pvs
      PV         VG     Fmt  Attr PSize  PFree
      /dev/sdb1  new_vg lvm2 a-   17.14G 17.14G
      /dev/sdc1  new_vg lvm2 a-   17.14G 17.09G
      /dev/sdd1  new_vg lvm2 a-   17.14G 17.14G
    
    您​​​​​​​可​​​​​​​以​​​​​​​用​​​​​​​下​​​​​​​面​​​​​​​的​​​​​​​命​​​​​​​令​​​​​​​只​​​​​​​显​​​​​​​示​​​​​​​物​​​​​​​理​​​​​​​卷​​​​​​​的​​​​​​​名​​​​​​​称​​​​​​​和​​​​​​​大​​​​​​​小​​​​​​​。​​​​​​​
    # pvs -o pv_name,pv_size
      PV         PSize
      /dev/sdb1  17.14G
      /dev/sdc1  17.14G
      /dev/sdd1  17.14G
    
  • 您​​​​​​​可​​​​​​​以​​​​​​​用​​​​​​​ (+) 符​​​​​​​号​​​​​​​在​​​​​​​输​​​​​​​出​​​​​​​结​​​​​​​果​​​​​​​中​​​​​​​附​​​​​​​加​​​​​​​一​​​​​​​个​​​​​​​字​​​​​​​段​​​​​​​,它​​​​​​​通​​​​​​​常​​​​​​​与​​​​​​​ -o 参​​​​​​​数​​​​​​​合​​​​​​​用​​​​​​​。​​​​​​​
    下​​​​​​​面​​​​​​​的​​​​​​​例​​​​​​​子​​​​​​​除​​​​​​​默​​​​​​​认​​​​​​​字​​​​​​​段​​​​​​​外​​​​​​​还​​​​​​​显​​​​​​​示​​​​​​​物​​​​​​​理​​​​​​​卷​​​​​​​ UUID。​​​​​​​
    # pvs -o +pv_uuid
      PV         VG     Fmt  Attr PSize  PFree  PV UUID
      /dev/sdb1  new_vg lvm2 a-   17.14G 17.14G onFF2w-1fLC-ughJ-D9eB-M7iv-6XqA-dqGeXY
      /dev/sdc1  new_vg lvm2 a-   17.14G 17.09G Joqlch-yWSj-kuEn-IdwM-01S9-X08M-mcpsVe
      /dev/sdd1  new_vg lvm2 a-   17.14G 17.14G yvfvZK-Cf31-j75k-dECm-0RZ3-0dGW-UqkCS
    
  • 在​​​​​​​命​​​​​​​令​​​​​​​中​​​​​​​添​​​​​​​加​​​​​​​ -v 参​​​​​​​数​​​​​​​使​​​​​​​其​​​​​​​包​​​​​​​括​​​​​​​一​​​​​​​些​​​​​​​额​​​​​​​外​​​​​​​的​​​​​​​字​​​​​​​段​​​​​​​。​​​​​​​例​​​​​​​如​​​​​​​:pvs -v 命​​​​​​​令​​​​​​​将​​​​​​​在​​​​​​​默​​​​​​​认​​​​​​​字​​​​​​​段​​​​​​​之​​​​​​​外​​​​​​​显​​​​​​​示​​​​​​​ DevSize 和​​​​​​​ PV UUID 字​​​​​​​段​​​​​​​。​​​​​​​
    # pvs -v
        Scanning for physical volume names
      PV         VG     Fmt  Attr PSize  PFree  DevSize PV UUID
      /dev/sdb1  new_vg lvm2 a-   17.14G 17.14G  17.14G onFF2w-1fLC-ughJ-D9eB-M7iv-6XqA-dqGeXY
      /dev/sdc1  new_vg lvm2 a-   17.14G 17.09G  17.14G Joqlch-yWSj-kuEn-IdwM-01S9-XO8M-mcpsVe
      /dev/sdd1  new_vg lvm2 a-   17.14G 17.14G  17.14G yvfvZK-Cf31-j75k-dECm-0RZ3-0dGW-tUqkCS
    
  • --noheadings 参​​​​​​​数​​​​​​​制​​​​​​​止​​​​​​​标​​​​​​​题​​​​​​​行​​​​​​​。​​​​​​​这​​​​​​​在​​​​​​​写​​​​​​​脚​​​​​​​本​​​​​​​时​​​​​​​很​​​​​​​有​​​​​​​用​​​​​​​。​​​​​​​
    下​​​​​​​面​​​​​​​的​​​​​​​命​​​​​​​令​​​​​​​合​​​​​​​并​​​​​​​使​​​​​​​用​​​​​​​ --noheadings 和​​​​​​​ pv_name 参​​​​​​​数​​​​​​​,将​​​​​​​生​​​​​​​成​​​​​​​所​​​​​​​有​​​​​​​物​​​​​​​理​​​​​​​卷​​​​​​​的​​​​​​​列​​​​​​​表​​​​​​​。​​​​​​​
    # pvs --noheadings -o pv_name
      /dev/sdb1
      /dev/sdc1
      /dev/sdd1
    
  • --separator 分​​​​​​​隔​​​​​​​符​​​​​​​ 参​​​​​​​数​​​​​​​使​​​​​​​用​​​​​​​ 分​​​​​​​隔​​​​​​​符​​​​​​​ 来​​​​​​​分​​​​​​​隔​​​​​​​每​​​​​​​个​​​​​​​字​​​​​​​段​​​​​​​。​​​​​​​这​​​​​​​在​​​​​​​对​​​​​​​输​​​​​​​出​​​​​​​结​​​​​​​果​​​​​​​运​​​​​​​行​​​​​​​ grep 命​​​​​​​令​​​​​​​的​​​​​​​脚​​​​​​​本​​​​​​​中​​​​​​​很​​​​​​​有​​​​​​​用​​​​​​​。​​​​​​​
    下​​​​​​​面​​​​​​​的​​​​​​​例​​​​​​​子​​​​​​​使​​​​​​​用​​​​​​​等​​​​​​​号​​​​​​​(=)分​​​​​​​隔​​​​​​​ pvs 命​​​​​​​令​​​​​​​的​​​​​​​默​​​​​​​认​​​​​​​输​​​​​​​出​​​​​​​字​​​​​​​段​​​​​​​。​​​​​​​
    # pvs --separator =
      PV=VG=Fmt=Attr=PSize=PFree
      /dev/sdb1=new_vg=lvm2=a-=17.14G=17.14G
      /dev/sdc1=new_vg=lvm2=a-=17.14G=17.09G
      /dev/sdd1=new_vg=lvm2=a-=17.14G=17.14G
    
    要​​​​​​​在​​​​​​​使​​​​​​​用​​​​​​​ separator 参​​​​​​​数​​​​​​​时​​​​​​​让​​​​​​​字​​​​​​​段​​​​​​​对​​​​​​​齐​​​​​​​,请​​​​​​​联​​​​​​​合​​​​​​​使​​​​​​​用​​​​​​​ separator 和​​​​​​​ --aligned 参​​​​​​​数​​​​​​​。​​​​​​​
    # pvs --separator = --aligned
      PV        =VG    =Fmt =Attr=PSize =PFree
      /dev/sdb1 =new_vg=lvm2=a-  =17.14G=17.14G
      /dev/sdc1 =new_vg=lvm2=a-  =17.14G=17.09G
      /dev/sdd1 =new_vg=lvm2=a-  =17.14G=17.14G
    
有​​​​​​​关​​​​​​​显​​​​​​​示​​​​​​​参​​​​​​​数​​​​​​​的​​​​​​​完​​​​​​​整​​​​​​​列​​​​​​​表​​​​​​​请​​​​​​​参​​​​​​​考​​​​​​​ pvs(8)、​​​​​​​vgs(8) 和​​​​​​​ lvs(8) man page。​​​​​​​
卷​​​​​​​组​​​​​​​字​​​​​​​段​​​​​​​可​​​​​​​以​​​​​​​与​​​​​​​物​​​​​​​理​​​​​​​卷​​​​​​​(和​​​​​​​物​​​​​​​理​​​​​​​卷​​​​​​​片​​​​​​​段​​​​​​​)字​​​​​​​段​​​​​​​或​​​​​​​者​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​(和​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​片​​​​​​​段​​​​​​​)字​​​​​​​段​​​​​​​混​​​​​​​合​​​​​​​,但​​​​​​​物​​​​​​​理​​​​​​​卷​​​​​​​和​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​字​​​​​​​段​​​​​​​不​​​​​​​能​​​​​​​混​​​​​​​合​​​​​​​。​​​​​​​例​​​​​​​如​​​​​​​:下​​​​​​​面​​​​​​​的​​​​​​​命​​​​​​​令​​​​​​​将​​​​​​​在​​​​​​​输​​​​​​​出​​​​​​​结​​​​​​​果​​​​​​​中​​​​​​​每​​​​​​​行​​​​​​​显​​​​​​​示​​​​​​​一​​​​​​​个​​​​​​​物​​​​​​​理​​​​​​​卷​​​​​​​。​​​​​​​
# vgs -o +pv_name
  VG     #PV #LV #SN Attr   VSize  VFree  PV
  new_vg   3   1   0 wz--n- 51.42G 51.37G /dev/sdc1
  new_vg   3   1   0 wz--n- 51.42G 51.37G /dev/sdd1
  new_vg   3   1   0 wz--n- 51.42G 51.37G /dev/sdb1

4.9.2. 对​​​​​​​象​​​​​​​选​​​​​​​择​​​​​​​

这​​​​​​​部​​​​​​​分​​​​​​​提​​​​​​​供​​​​​​​了​​​​​​​一​​​​​​​组​​​​​​​列​​​​​​​表​​​​​​​,表​​​​​​​中​​​​​​​列​​​​​​​出​​​​​​​的​​​​​​​有​​​​​​​关​​​​​​​ LVM 对​​​​​​​象​​​​​​​的​​​​​​​信​​​​​​​息​​​​​​​您​​​​​​​可​​​​​​​以​​​​​​​用​​​​​​​ pvs、​​​​​​​vgs 和​​​​​​​ lvs 命​​​​​​​令​​​​​​​获​​​​​​​得​​​​​​​。​​​​​​​
为​​​​​​​方​​​​​​​便​​​​​​​起​​​​​​​见​​​​​​​,字​​​​​​​段​​​​​​​名​​​​​​​称​​​​​​​前​​​​​​​缀​​​​​​​如​​​​​​​果​​​​​​​与​​​​​​​命​​​​​​​令​​​​​​​默​​​​​​​认​​​​​​​字​​​​​​​段​​​​​​​匹​​​​​​​配​​​​​​​就​​​​​​​可​​​​​​​以​​​​​​​去​​​​​​​掉​​​​​​​。​​​​​​​例​​​​​​​如​​​​​​​:在​​​​​​​ pvs 命​​​​​​​令​​​​​​​中​​​​​​​,name 的​​​​​​​指​​​​​​​的​​​​​​​是​​​​​​​ pv_name,但​​​​​​​使​​​​​​​用​​​​​​​ vgs 命​​​​​​​令​​​​​​​时​​​​​​​,name 被​​​​​​​理​​​​​​​解​​​​​​​为​​​​​​​ vg_name。​​​​​​​
执​​​​​​​行​​​​​​​以​​​​​​​下​​​​​​​命​​​​​​​令​​​​​​​和​​​​​​​执​​​​​​​行​​​​​​​ pvs -o pv_free 的​​​​​​​结​​​​​​​果​​​​​​​相​​​​​​​同​​​​​​​。​​​​​​​
# pvs -o free
  PFree
  17.14G
  17.09G
  17.14G

pvs 命​​​​​​​令​​​​​​​

表 4.1 “pvs 显​​​​​​​示​​​​​​​字​​​​​​​段​​​​​​​” lists the display arguments of the pvs command, along with the field name as it appears in the header display and a description of the field.

表 4.1. pvs 显​​​​​​​示​​​​​​​字​​​​​​​段​​​​​​​

参​​​​​​​数​​​​​​​ 标​​​​​​​题​​​​​​​ 描​​​​​​​述​​​​​​​
dev_size DevSize 创​​​​​​​建​​​​​​​物​​​​​​​理​​​​​​​卷​​​​​​​的​​​​​​​基​​​​​​​本​​​​​​​设​​​​​​​备​​​​​​​的​​​​​​​大​​​​​​​小​​​​​​​
pe_start 1st PE 在​​​​​​​基​​​​​​​本​​​​​​​设​​​​​​​备​​​​​​​中​​​​​​​调​​​​​​​整​​​​​​​到​​​​​​​第​​​​​​​一​​​​​​​个​​​​​​​物​​​​​​​理​​​​​​​扩​​​​​​​展​​​​​​​的​​​​​​​起​​​​​​​始​​​​​​​位​​​​​​​置​​​​​​​
pv_attr Attr 物​​​​​​​理​​​​​​​卷​​​​​​​状​​​​​​​态​​​​​​​:可​​​​​​​分​​​​​​​配​​​​​​​(a)或​​​​​​​者​​​​​​​导​​​​​​​出​​​​​​​的​​​​​​​(x)。​​​​​​​
pv_fmt Fmt 物​​​​​​​理​​​​​​​卷​​​​​​​的​​​​​​​元​​​​​​​数​​​​​​​据​​​​​​​格​​​​​​​式​​​​​​​(lvm2 或​​​​​​​者​​​​​​​ lvm1
pv_free PFree 物​​​​​​​理​​​​​​​卷​​​​​​​中​​​​​​​剩​​​​​​​余​​​​​​​的​​​​​​​可​​​​​​​用​​​​​​​空​​​​​​​间​​​​​​​
pv_name PV 物​​​​​​​理​​​​​​​卷​​​​​​​名​​​​​​​称​​​​​​​
pv_pe_alloc_count Alloc 已​​​​​​​经​​​​​​​使​​​​​​​用​​​​​​​的​​​​​​​物​​​​​​​理​​​​​​​扩​​​​​​​展​​​​​​​数​​​​​​​目​​​​​​​
pv_pe_count PE 物​​​​​​​理​​​​​​​扩​​​​​​​展​​​​​​​数​​​​​​​量​​​​​​​
pvseg_size SSize 物​​​​​​​理​​​​​​​卷​​​​​​​的​​​​​​​片​​​​​​​段​​​​​​​大​​​​​​​小​​​​​​​
pvseg_start Start 物​​​​​​​理​​​​​​​卷​​​​​​​片​​​​​​​段​​​​​​​的​​​​​​​起​​​​​​​始​​​​​​​物​​​​​​​理​​​​​​​扩​​​​​​​展​​​​​​​
pv_size PSize 物​​​​​​​理​​​​​​​卷​​​​​​​的​​​​​​​大​​​​​​​小​​​​​​​
pv_tags PV Tags 附​​​​​​​加​​​​​​​到​​​​​​​物​​​​​​​理​​​​​​​卷​​​​​​​的​​​​​​​ LVM 标​​​​​​​签​​​​​​​
pv_used Used 目​​​​​​​前​​​​​​​物​​​​​​​理​​​​​​​卷​​​​​​​中​​​​​​​已​​​​​​​经​​​​​​​使​​​​​​​用​​​​​​​的​​​​​​​空​​​​​​​间​​​​​​​量​​​​​​​
pv_uuid PV UUID 物​​​​​​​理​​​​​​​卷​​​​​​​的​​​​​​​ UUID
默​​​​​​​认​​​​​​​情​​​​​​​况​​​​​​​下​​​​​​​ pvs 命​​​​​​​令​​​​​​​显​​​​​​​示​​​​​​​以​​​​​​​下​​​​​​​字​​​​​​​段​​​​​​​:pv_name、​​​​​​​vg_name、​​​​​​​pv_fmt、​​​​​​​pv_attr、​​​​​​​pv_size、​​​​​​​pv_free。​​​​​​​结​​​​​​​果​​​​​​​根​​​​​​​据​​​​​​​ pv_name 排​​​​​​​序​​​​​​​。​​​​​​​
# pvs
  PV         VG     Fmt  Attr PSize  PFree
  /dev/sdb1  new_vg lvm2 a-   17.14G 17.14G
  /dev/sdc1  new_vg lvm2 a-   17.14G 17.09G
  /dev/sdd1  new_vg lvm2 a-   17.14G 17.13G
使​​​​​​​用​​​​​​​带​​​​​​​ -v 参​​​​​​​数​​​​​​​的​​​​​​​ pvs 命​​​​​​​令​​​​​​​向​​​​​​​默​​​​​​​认​​​​​​​显​​​​​​​示​​​​​​​中​​​​​​​添​​​​​​​加​​​​​​​以​​​​​​​下​​​​​​​字​​​​​​​段​​​​​​​:dev_size、​​​​​​​pv_uuid。​​​​​​​
# pvs -v
    Scanning for physical volume names
  PV         VG     Fmt  Attr PSize  PFree  DevSize PV UUID
  /dev/sdb1  new_vg lvm2 a-   17.14G 17.14G  17.14G onFF2w-1fLC-ughJ-D9eB-M7iv-6XqA-dqGeXY
  /dev/sdc1  new_vg lvm2 a-   17.14G 17.09G  17.14G Joqlch-yWSj-kuEn-IdwM-01S9-XO8M-mcpsVe
  /dev/sdd1  new_vg lvm2 a-   17.14G 17.13G  17.14G yvfvZK-Cf31-j75k-dECm-0RZ3-0dGW-tUqkCS
您​​​​​​​可​​​​​​​以​​​​​​​使​​​​​​​用​​​​​​​ pvs 命​​​​​​​令​​​​​​​的​​​​​​​ --segments 参​​​​​​​数​​​​​​​显​​​​​​​示​​​​​​​每​​​​​​​个​​​​​​​物​​​​​​​理​​​​​​​卷​​​​​​​片​​​​​​​段​​​​​​​的​​​​​​​信​​​​​​​息​​​​​​​。​​​​​​​一​​​​​​​个​​​​​​​片​​​​​​​段​​​​​​​就​​​​​​​是​​​​​​​一​​​​​​​组​​​​​​​扩​​​​​​​展​​​​​​​。​​​​​​​查​​​​​​​看​​​​​​​片​​​​​​​段​​​​​​​在​​​​​​​想​​​​​​​要​​​​​​​查​​​​​​​看​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​是​​​​​​​否​​​​​​​有​​​​​​​很​​​​​​​多​​​​​​​碎​​​​​​​片​​​​​​​时​​​​​​​很​​​​​​​有​​​​​​​用​​​​​​​。​​​​​​​
pvs --segments 命​​​​​​​令​​​​​​​默​​​​​​​认​​​​​​​显​​​​​​​示​​​​​​​以​​​​​​​下​​​​​​​字​​​​​​​段​​​​​​​:pv_name、​​​​​​​vg_name、​​​​​​​pv_fmt、​​​​​​​pv_attr、​​​​​​​pv_size、​​​​​​​pv_free、​​​​​​​pvseg_start、​​​​​​​pvseg_size。​​​​​​​结​​​​​​​果​​​​​​​按​​​​​​​照​​​​​​​物​​​​​​​理​​​​​​​卷​​​​​​​中​​​​​​​ pv_name 和​​​​​​​ pvseg_size 排​​​​​​​序​​​​​​​。​​​​​​​
# pvs --segments
  PV         VG         Fmt  Attr PSize  PFree  Start SSize
  /dev/hda2  VolGroup00 lvm2 a-   37.16G 32.00M     0  1172
  /dev/hda2  VolGroup00 lvm2 a-   37.16G 32.00M  1172    16
  /dev/hda2  VolGroup00 lvm2 a-   37.16G 32.00M  1188     1
  /dev/sda1  vg         lvm2 a-   17.14G 16.75G     0    26
  /dev/sda1  vg         lvm2 a-   17.14G 16.75G    26    24
  /dev/sda1  vg         lvm2 a-   17.14G 16.75G    50    26
  /dev/sda1  vg         lvm2 a-   17.14G 16.75G    76    24
  /dev/sda1  vg         lvm2 a-   17.14G 16.75G   100    26
  /dev/sda1  vg         lvm2 a-   17.14G 16.75G   126    24
  /dev/sda1  vg         lvm2 a-   17.14G 16.75G   150    22
  /dev/sda1  vg         lvm2 a-   17.14G 16.75G   172  4217
  /dev/sdb1  vg         lvm2 a-   17.14G 17.14G     0  4389
  /dev/sdc1  vg         lvm2 a-   17.14G 17.14G     0  4389
  /dev/sdd1  vg         lvm2 a-   17.14G 17.14G     0  4389
  /dev/sde1  vg         lvm2 a-   17.14G 17.14G     0  4389
  /dev/sdf1  vg         lvm2 a-   17.14G 17.14G     0  4389
  /dev/sdg1  vg         lvm2 a-   17.14G 17.14G     0  4389
您​​​​​​​可​​​​​​​以​​​​​​​使​​​​​​​用​​​​​​​ pvs -a 查​​​​​​​看​​​​​​​被​​​​​​​ LVM 侦​​​​​​​测​​​​​​​出​​​​​​​来​​​​​​​但​​​​​​​还​​​​​​​没​​​​​​​有​​​​​​​初​​​​​​​始​​​​​​​化​​​​​​​为​​​​​​​ LVM 物​​​​​​​理​​​​​​​卷​​​​​​​的​​​​​​​设​​​​​​​备​​​​​​​。​​​​​​​
# pvs -a
  PV                             VG     Fmt  Attr PSize  PFree
  /dev/VolGroup00/LogVol01                   --       0      0
  /dev/new_vg/lvol0                          --       0      0
  /dev/ram                                   --       0      0
  /dev/ram0                                  --       0      0
  /dev/ram2                                  --       0      0
  /dev/ram3                                  --       0      0
  /dev/ram4                                  --       0      0
  /dev/ram5                                  --       0      0
  /dev/ram6                                  --       0      0
  /dev/root                                  --       0      0
  /dev/sda                                   --       0      0
  /dev/sdb                                   --       0      0
  /dev/sdb1                      new_vg lvm2 a-   17.14G 17.14G
  /dev/sdc                                   --       0      0
  /dev/sdc1                      new_vg lvm2 a-   17.14G 17.09G
  /dev/sdd                                   --       0      0
  /dev/sdd1                      new_vg lvm2 a-   17.14G 17.14G

vgs 命​​​​​​​令​​​​​​​

表 4.2 “vgs 显​​​​​​​示​​​​​​​字​​​​​​​段​​​​​​​” lists the display arguments of the vgs command, along with the field name as it appears in the header display and a description of the field.

表 4.2. vgs 显​​​​​​​示​​​​​​​字​​​​​​​段​​​​​​​

参​​​​​​​数​​​​​​​ 标​​​​​​​题​​​​​​​ 描​​​​​​​述​​​​​​​
lv_count #LV 卷​​​​​​​组​​​​​​​中​​​​​​​含​​​​​​​有​​​​​​​的​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​数​​​​​​​目​​​​​​​
max_lv MaxLV 卷​​​​​​​组​​​​​​​中​​​​​​​最​​​​​​​多​​​​​​​可​​​​​​​用​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​数​​​​​​​量​​​​​​​(如​​​​​​​果​​​​​​​没​​​​​​​有​​​​​​​限​​​​​​​制​​​​​​​就​​​​​​​是​​​​​​​ 0)
max_pv MaxPV 卷​​​​​​​组​​​​​​​中​​​​​​​最​​​​​​​多​​​​​​​允​​​​​​​许​​​​​​​的​​​​​​​物​​​​​​​理​​​​​​​卷​​​​​​​数​​​​​​​目​​​​​​​(如​​​​​​​果​​​​​​​没​​​​​​​有​​​​​​​限​​​​​​​制​​​​​​​就​​​​​​​是​​​​​​​ 0)
pv_count #PV 定​​​​​​​义​​​​​​​卷​​​​​​​组​​​​​​​的​​​​​​​物​​​​​​​理​​​​​​​卷​​​​​​​数​​​​​​​目​​​​​​​
snap_count #SN 卷​​​​​​​组​​​​​​​包​​​​​​​含​​​​​​​的​​​​​​​快​​​​​​​照​​​​​​​数​​​​​​​目​​​​​​​
vg_attr Attr 卷​​​​​​​组​​​​​​​状​​​​​​​态​​​​​​​:可​​​​​​​写​​​​​​​入​​​​​​​(w)、​​​​​​​只​​​​​​​读​​​​​​​(r)、​​​​​​​可​​​​​​​重​​​​​​​新​​​​​​​定​​​​​​​义​​​​​​​大​​​​​​​小​​​​​​​(z)、​​​​​​​导​​​​​​​出​​​​​​​的​​​​​​​(x)、​​​​​​​不​​​​​​​完​​​​​​​整​​​​​​​的​​​​​​​(p)和​​​​​​​群​​​​​​​集​​​​​​​的​​​​​​​(c)。​​​​​​​
vg_extent_count #Ext 卷​​​​​​​组​​​​​​​中​​​​​​​的​​​​​​​物​​​​​​​理​​​​​​​扩​​​​​​​展​​​​​​​数​​​​​​​目​​​​​​​
vg_extent_size Ext 卷​​​​​​​组​​​​​​​中​​​​​​​物​​​​​​​理​​​​​​​扩​​​​​​​展​​​​​​​的​​​​​​​大​​​​​​​小​​​​​​​
vg_fmt Fmt 卷​​​​​​​组​​​​​​​(lvm2 或​​​​​​​者​​​​​​​ lvm1)的​​​​​​​元​​​​​​​数​​​​​​​据​​​​​​​格​​​​​​​式​​​​​​​
vg_free VFree 卷​​​​​​​组​​​​​​​中​​​​​​​剩​​​​​​​余​​​​​​​可​​​​​​​用​​​​​​​空​​​​​​​间​​​​​​​
vg_free_count Free 卷​​​​​​​组​​​​​​​中​​​​​​​可​​​​​​​用​​​​​​​物​​​​​​​理​​​​​​​扩​​​​​​​展​​​​​​​数​​​​​​​目​​​​​​​
vg_name VG 卷​​​​​​​组​​​​​​​名​​​​​​​称​​​​​​​
vg_seqno Seq 代​​​​​​​表​​​​​​​修​​​​​​​正​​​​​​​卷​​​​​​​组​​​​​​​的​​​​​​​数​​​​​​​字​​​​​​​
vg_size VSize 卷​​​​​​​组​​​​​​​大​​​​​​​小​​​​​​​
vg_sysid SYS ID LVM1 系​​​​​​​统​​​​​​​ ID
vg_tags VG Tags 附​​​​​​​加​​​​​​​到​​​​​​​卷​​​​​​​组​​​​​​​中​​​​​​​的​​​​​​​ LVM 标​​​​​​​签​​​​​​​
vg_uuid VG UUID 卷​​​​​​​组​​​​​​​的​​​​​​​ UUID
vgs 命​​​​​​​令​​​​​​​默​​​​​​​认​​​​​​​显​​​​​​​示​​​​​​​以​​​​​​​下​​​​​​​字​​​​​​​段​​​​​​​:vg_name、​​​​​​​pv_count、​​​​​​​lv_count、​​​​​​​snap_count、​​​​​​​vg_attr、​​​​​​​vg_size、​​​​​​​vg_free,并​​​​​​​根​​​​​​​据​​​​​​​ vg_name 排​​​​​​​序​​​​​​​。​​​​​​​
# vgs
  VG     #PV #LV #SN Attr   VSize  VFree
  new_vg   3   1   1 wz--n- 51.42G 51.36G
使​​​​​​​用​​​​​​​带​​​​​​​ -v 参​​​​​​​数​​​​​​​的​​​​​​​ vgs 命​​​​​​​令​​​​​​​向​​​​​​​默​​​​​​​认​​​​​​​显​​​​​​​示​​​​​​​中​​​​​​​添​​​​​​​加​​​​​​​以​​​​​​​下​​​​​​​字​​​​​​​段​​​​​​​:vg_extent_size、​​​​​​​vg_uuid。​​​​​​​
# vgs -v
    Finding all volume groups
    Finding volume group "new_vg"
  VG     Attr   Ext   #PV #LV #SN VSize  VFree  VG UUID
  new_vg wz--n- 4.00M   3   1   1 51.42G 51.36G jxQJ0a-ZKk0-OpMO-0118-nlwO-wwqd-fD5D32

lvs 命​​​​​​​令​​​​​​​

表 4.3 “lvs 显​​​​​​​示​​​​​​​字​​​​​​​段​​​​​​​” lists the display arguments of the lvs command, along with the field name as it appears in the header display and a description of the field.

表 4.3. lvs 显​​​​​​​示​​​​​​​字​​​​​​​段​​​​​​​

参​​​​​​​数​​​​​​​ 标​​​​​​​题​​​​​​​ 描​​​​​​​述​​​​​​​
chunksize
chunk_size
Chunk 快​​​​​​​照​​​​​​​卷​​​​​​​的​​​​​​​单​​​​​​​位​​​​​​​大​​​​​​​小​​​​​​​
copy_percent Copy% 镜​​​​​​​像​​​​​​​卷​​​​​​​的​​​​​​​同​​​​​​​步​​​​​​​化​​​​​​​比​​​​​​​例​​​​​​​,还​​​​​​​可​​​​​​​在​​​​​​​使​​​​​​​用​​​​​​​ pv_move 命​​​​​​​令​​​​​​​移​​​​​​​动​​​​​​​物​​​​​​​理​​​​​​​扩​​​​​​​展​​​​​​​时​​​​​​​使​​​​​​​用​​​​​​​。​​​​​​​
devices Devices 组​​​​​​​成​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​的​​​​​​​基​​​​​​​本​​​​​​​设​​​​​​​备​​​​​​​:物​​​​​​​理​​​​​​​卷​​​​​​​、​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​以​​​​​​​及​​​​​​​起​​​​​​​始​​​​​​​物​​​​​​​理​​​​​​​和​​​​​​​逻​​​​​​​辑​​​​​​​扩​​​​​​​展​​​​​​​
lv_attr Attr 逻​​​​​​​辑​​​​​​​卷​​​​​​​状​​​​​​​态​​​​​​​。​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​属​​​​​​​性​​​​​​​字​​​​​​​节​​​​​​​如​​​​​​​下​​​​​​​:
字​​​​​​​节​​​​​​​ 1:卷​​​​​​​类​​​​​​​型​​​​​​​:镜​​​​​​​像​​​​​​​(m)、​​​​​​​不​​​​​​​带​​​​​​​初​​​​​​​始​​​​​​​同​​​​​​​步​​​​​​​的​​​​​​​镜​​​​​​​像​​​​​​​(M )、​​​​​​​源​​​​​​​(o)、​​​​​​​pvmove(p)、​​​​​​​快​​​​​​​照​​​​​​​(s)、​​​​​​​不​​​​​​​可​​​​​​​用​​​​​​​快​​​​​​​照​​​​​​​(S)、​​​​​​​虚​​​​​​​拟​​​​​​​(v)
字​​​​​​​节​​​​​​​ 2:权​​​​​​​限​​​​​​​:可​​​​​​​写​​​​​​​入​​​​​​​(w),只​​​​​​​读​​​​​​​(r)
字​​​​​​​节​​​​​​​ 3:分​​​​​​​配​​​​​​​策​​​​​​​略​​​​​​​:持​​​​​​​续​​​​​​​(c)、​​​​​​​正​​​​​​​常​​​​​​​(n)、​​​​​​​任​​​​​​​意​​​​​​​(a)、​​​​​​​继​​​​​​​承​​​​​​​(i)。​​​​​​​如​​​​​​​果​​​​​​​在​​​​​​​修​​​​​​​改​​​​​​​分​​​​​​​配​​​​​​​时​​​​​​​锁​​​​​​​定​​​​​​​了​​​​​​​卷​​​​​​​,就​​​​​​​会​​​​​​​显​​​​​​​示​​​​​​​成​​​​​​​大​​​​​​​写​​​​​​​,比​​​​​​​如​​​​​​​在​​​​​​​执​​​​​​​行​​​​​​​ pvmove 命​​​​​​​令​​​​​​​的​​​​​​​时​​​​​​​候​​​​​​​。​​​​​​​
字​​​​​​​节​​​​​​​ 4:固​​​​​​​定​​​​​​​的​​​​​​​副​​​​​​​号​​​​​​​码​​​​​​​(m)
字​​​​​​​节​​​​​​​ 5:激​​​​​​​活​​​​​​​(a)、​​​​​​​暂​​​​​​​停​​​​​​​的​​​​​​​(s)、​​​​​​​不​​​​​​​可​​​​​​​用​​​​​​​快​​​​​​​照​​​​​​​(I)、​​​​​​​不​​​​​​​可​​​​​​​用​​​​​​​暂​​​​​​​停​​​​​​​快​​​​​​​照​​​​​​​(S)、​​​​​​​不​​​​​​​带​​​​​​​表​​​​​​​格​​​​​​​的​​​​​​​映​​​​​​​射​​​​​​​设​​​​​​​备​​​​​​​(d)、​​​​​​​带​​​​​​​未​​​​​​​激​​​​​​​活​​​​​​​表​​​​​​​格​​​​​​​的​​​​​​​映​​​​​​​射​​​​​​​设​​​​​​​备​​​​​​​(i)
字​​​​​​​节​​​​​​​ 6:设​​​​​​​备​​​​​​​开​​​​​​​放​​​​​​​(o)
lv_kernel_major KMaj 逻​​​​​​​辑​​​​​​​卷​​​​​​​的​​​​​​​真​​​​​​​实​​​​​​​主​​​​​​​设​​​​​​​备​​​​​​​号​​​​​​​码​​​​​​​(如​​​​​​​果​​​​​​​是​​​​​​​未​​​​​​​激​​​​​​​活​​​​​​​就​​​​​​​减​​​​​​​ 1)
lv_kernel_minor KMIN 逻​​​​​​​辑​​​​​​​卷​​​​​​​的​​​​​​​真​​​​​​​实​​​​​​​副​​​​​​​设​​​​​​​备​​​​​​​号​​​​​​​码​​​​​​​(如​​​​​​​果​​​​​​​是​​​​​​​未​​​​​​​激​​​​​​​活​​​​​​​就​​​​​​​减​​​​​​​ 1)
lv_major Maj 逻​​​​​​​辑​​​​​​​卷​​​​​​​持​​​​​​​久​​​​​​​的​​​​​​​主​​​​​​​设​​​​​​​备​​​​​​​号​​​​​​​码​​​​​​​(如​​​​​​​果​​​​​​​未​​​​​​​指​​​​​​​定​​​​​​​就​​​​​​​减​​​​​​​ 1)
lv_minor Min 逻​​​​​​​辑​​​​​​​卷​​​​​​​持​​​​​​​久​​​​​​​的​​​​​​​副​​​​​​​设​​​​​​​备​​​​​​​号​​​​​​​码​​​​​​​(如​​​​​​​果​​​​​​​未​​​​​​​指​​​​​​​定​​​​​​​就​​​​​​​减​​​​​​​ 1)
lv_name LV 逻​​​​​​​辑​​​​​​​卷​​​​​​​名​​​​​​​称​​​​​​​
lv_size LSize 逻​​​​​​​辑​​​​​​​卷​​​​​​​的​​​​​​​大​​​​​​​小​​​​​​​
lv_tags LV Tags 附​​​​​​​加​​​​​​​到​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​的​​​​​​​ LV 标​​​​​​​签​​​​​​​
lv_uuid LV UUID 逻​​​​​​​辑​​​​​​​卷​​​​​​​的​​​​​​​ UUID
mirror_log Log 镜​​​​​​​像​​​​​​​分​​​​​​​支​​​​​​​所​​​​​​​在​​​​​​​设​​​​​​​备​​​​​​​
modules Modules 使​​​​​​​用​​​​​​​此​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​符​​​​​​​合​​​​​​​内​​​​​​​核​​​​​​​设​​​​​​​备​​​​​​​映​​​​​​​射​​​​​​​器​​​​​​​目​​​​​​​标​​​​​​​需​​​​​​​要​​​​​​​
move_pv Move 用​​​​​​​ pvmove 命​​​​​​​令​​​​​​​创​​​​​​​建​​​​​​​的​​​​​​​临​​​​​​​时​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​的​​​​​​​源​​​​​​​物​​​​​​​理​​​​​​​卷​​​​​​​
origin Origin 快​​​​​​​照​​​​​​​卷​​​​​​​的​​​​​​​源​​​​​​​设​​​​​​​备​​​​​​​
regionsize
region_size
Region 镜​​​​​​​像​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​的​​​​​​​单​​​​​​​元​​​​​​​大​​​​​​​小​​​​​​​
seg_count #Seg 逻​​​​​​​辑​​​​​​​卷​​​​​​​中​​​​​​​片​​​​​​​段​​​​​​​的​​​​​​​数​​​​​​​目​​​​​​​
seg_size SSize 逻​​​​​​​辑​​​​​​​卷​​​​​​​中​​​​​​​片​​​​​​​段​​​​​​​的​​​​​​​大​​​​​​​小​​​​​​​
seg_start Start 修​​​​​​​正​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​中​​​​​​​的​​​​​​​片​​​​​​​段​​​​​​​
seg_tags Seg Tags 附​​​​​​​加​​​​​​​到​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​片​​​​​​​段​​​​​​​的​​​​​​​ LVM 标​​​​​​​签​​​​​​​
segtype Type 逻​​​​​​​辑​​​​​​​卷​​​​​​​的​​​​​​​片​​​​​​​段​​​​​​​类​​​​​​​型​​​​​​​(例​​​​​​​如​​​​​​​:镜​​​​​​​像​​​​​​​、​​​​​​​条​​​​​​​状​​​​​​​、​​​​​​​线​​​​​​​性​​​​​​​)
snap_percent Snap% 已​​​​​​​经​​​​​​​使​​​​​​​用​​​​​​​的​​​​​​​快​​​​​​​照​​​​​​​卷​​​​​​​的​​​​​​​比​​​​​​​例​​​​​​​
stripes #Str 逻​​​​​​​辑​​​​​​​卷​​​​​​​中​​​​​​​条​​​​​​​带​​​​​​​或​​​​​​​者​​​​​​​镜​​​​​​​像​​​​​​​的​​​​​​​数​​​​​​​目​​​​​​​
stripesize
stripe_size
Stripe 条​​​​​​​状​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​中​​​​​​​条​​​​​​​带​​​​​​​的​​​​​​​单​​​​​​​位​​​​​​​大​​​​​​​小​​​​​​​
lvs 命​​​​​​​令​​​​​​​默​​​​​​​认​​​​​​​显​​​​​​​示​​​​​​​以​​​​​​​下​​​​​​​字​​​​​​​段​​​​​​​:lv_name、​​​​​​​vg_name、​​​​​​​lv_attr、​​​​​​​lv_size、​​​​​​​origin、​​​​​​​snap_percent、​​​​​​​move_pv、​​​​​​​mirror_log、​​​​​​​copy_percent。​​​​​​​默​​​​​​​认​​​​​​​显​​​​​​​示​​​​​​​根​​​​​​​据​​​​​​​卷​​​​​​​组​​​​​​​中​​​​​​​ vg_name 和​​​​​​​ lv_name 排​​​​​​​序​​​​​​​。​​​​​​​
# lvs
  LV         VG     Attr   LSize  Origin Snap%  Move Log Copy%
  lvol0      new_vg owi-a- 52.00M
  newvgsnap1 new_vg swi-a-  8.00M lvol0    0.20
使​​​​​​​用​​​​​​​带​​​​​​​ -v 参​​​​​​​数​​​​​​​的​​​​​​​ lvs 命​​​​​​​令​​​​​​​在​​​​​​​默​​​​​​​认​​​​​​​显​​​​​​​示​​​​​​​结​​​​​​​果​​​​​​​中​​​​​​​添​​​​​​​加​​​​​​​以​​​​​​​下​​​​​​​字​​​​​​​段​​​​​​​:seg_count、​​​​​​​lv_major、​​​​​​​lv_minor、​​​​​​​lv_kernel_major、​​​​​​​lv_kernel_minor、​​​​​​​lv_uuid。​​​​​​​
# lvs -v
    Finding all logical volumes
  LV         VG     #Seg Attr   LSize  Maj Min KMaj KMin Origin Snap%  Move Copy%  Log LV UUID
  lvol0      new_vg    1 owi-a- 52.00M  -1  -1 253  3                                  LBy1Tz-sr23-OjsI-LT03-nHLC-y8XW-EhCl78
  newvgsnap1 new_vg    1 swi-a-  8.00M  -1  -1 253  5    lvol0    0.20                 1ye1OU-1cIu-o79k-20h2-ZGF0-qCJm-CfbsIx
您​​​​​​​可​​​​​​​以​​​​​​​使​​​​​​​用​​​​​​​ lvs 命​​​​​​​令​​​​​​​的​​​​​​​ --segments 参​​​​​​​数​​​​​​​显​​​​​​​示​​​​​​​强​​​​​​​调​​​​​​​片​​​​​​​段​​​​​​​信​​​​​​​息​​​​​​​的​​​​​​​默​​​​​​​认​​​​​​​列​​​​​​​。​​​​​​​当​​​​​​​您​​​​​​​使​​​​​​​用​​​​​​​ segments 参​​​​​​​数​​​​​​​时​​​​​​​,seg 前​​​​​​​缀​​​​​​​是​​​​​​​可​​​​​​​选​​​​​​​的​​​​​​​。​​​​​​​lvs --segments 命​​​​​​​令​​​​​​​默​​​​​​​认​​​​​​​显​​​​​​​示​​​​​​​以​​​​​​​下​​​​​​​字​​​​​​​段​​​​​​​:lv_name、​​​​​​​vg_name、​​​​​​​lv_attr、​​​​​​​stripes、​​​​​​​segtype、​​​​​​​seg_size。​​​​​​​默​​​​​​​认​​​​​​​显​​​​​​​示​​​​​​​根​​​​​​​据​​​​​​​卷​​​​​​​组​​​​​​​的​​​​​​​ vg_name 和​​​​​​​ lv_name 排​​​​​​​序​​​​​​​。​​​​​​​如​​​​​​​果​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​中​​​​​​​有​​​​​​​碎​​​​​​​片​​​​​​​,那​​​​​​​么​​​​​​​会​​​​​​​在​​​​​​​此​​​​​​​命​​​​​​​令​​​​​​​的​​​​​​​输​​​​​​​出​​​​​​​结​​​​​​​果​​​​​​​中​​​​​​​显​​​​​​​示​​​​​​​出​​​​​​​来​​​​​​​。​​​​​​​
# lvs --segments
  LV       VG         Attr   #Str Type   SSize
  LogVol00 VolGroup00 -wi-ao    1 linear  36.62G
  LogVol01 VolGroup00 -wi-ao    1 linear 512.00M
  lv       vg         -wi-a-    1 linear 104.00M
  lv       vg         -wi-a-    1 linear 104.00M
  lv       vg         -wi-a-    1 linear 104.00M
  lv       vg         -wi-a-    1 linear  88.00M
使​​​​​​​用​​​​​​​带​​​​​​​ -v 参​​​​​​​数​​​​​​​的​​​​​​​ lvs --segments 命​​​​​​​令​​​​​​​向​​​​​​​默​​​​​​​认​​​​​​​显​​​​​​​示​​​​​​​中​​​​​​​添​​​​​​​加​​​​​​​以​​​​​​​下​​​​​​​字​​​​​​​段​​​​​​​:seg_start、​​​​​​​stripesize、​​​​​​​chunksize。​​​​​​​
# lvs -v --segments
    Finding all logical volumes
  LV         VG     Attr   Start SSize  #Str Type   Stripe Chunk
  lvol0      new_vg owi-a-    0  52.00M    1 linear     0     0
  newvgsnap1 new_vg swi-a-    0   8.00M    1 linear     0  8.00K
下​​​​​​​面​​​​​​​的​​​​​​​例​​​​​​​子​​​​​​​显​​​​​​​示​​​​​​​在​​​​​​​配​​​​​​​置​​​​​​​了​​​​​​​一​​​​​​​个​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​的​​​​​​​系​​​​​​​统​​​​​​​的​​​​​​​ lvs 命​​​​​​​令​​​​​​​的​​​​​​​默​​​​​​​认​​​​​​​输​​​​​​​出​​​​​​​结​​​​​​​果​​​​​​​以​​​​​​​及​​​​​​​指​​​​​​​定​​​​​​​了​​​​​​​ segments 参​​​​​​​数​​​​​​​的​​​​​​​ lvs 命​​​​​​​令​​​​​​​输​​​​​​​出​​​​​​​结​​​​​​​果​​​​​​​。​​​​​​​
# lvs
  LV    VG     Attr   LSize  Origin Snap%  Move Log Copy%
  lvol0 new_vg -wi-a- 52.00M
# lvs --segments
  LV    VG     Attr   #Str Type   SSize
  lvol0 new_vg -wi-a-    1 linear 52.00M

4.9.3. LVM 报​​​​​​​告​​​​​​​排​​​​​​​序​​​​​​​

通​​​​​​​常​​​​​​​,lvs、​​​​​​​vgs 或​​​​​​​者​​​​​​​ pvs 命​​​​​​​令​​​​​​​的​​​​​​​完​​​​​​​整​​​​​​​输​​​​​​​出​​​​​​​结​​​​​​​果​​​​​​​在​​​​​​​正​​​​​​​确​​​​​​​排​​​​​​​序​​​​​​​和​​​​​​​对​​​​​​​齐​​​​​​​之​​​​​​​前​​​​​​​必​​​​​​​须​​​​​​​在​​​​​​​内​​​​​​​部​​​​​​​生​​​​​​​成​​​​​​​并​​​​​​​保​​​​​​​存​​​​​​​。​​​​​​​您​​​​​​​可​​​​​​​以​​​​​​​指​​​​​​​定​​​​​​​ --unbuffered 参​​​​​​​数​​​​​​​来​​​​​​​尽​​​​​​​快​​​​​​​显​​​​​​​示​​​​​​​未​​​​​​​排​​​​​​​序​​​​​​​的​​​​​​​输​​​​​​​出​​​​​​​。​​​​​​​
要​​​​​​​指​​​​​​​定​​​​​​​另​​​​​​​外​​​​​​​的​​​​​​​列​​​​​​​表​​​​​​​顺​​​​​​​序​​​​​​​进​​​​​​​行​​​​​​​排​​​​​​​序​​​​​​​,请​​​​​​​使​​​​​​​用​​​​​​​任​​​​​​​意​​​​​​​报​​​​​​​告​​​​​​​命​​​​​​​令​​​​​​​的​​​​​​​ -O 参​​​​​​​数​​​​​​​。​​​​​​​在​​​​​​​输​​​​​​​出​​​​​​​中​​​​​​​不​​​​​​​一​​​​​​​定​​​​​​​要​​​​​​​包​​​​​​​含​​​​​​​这​​​​​​​些​​​​​​​输​​​​​​​出​​​​​​​字​​​​​​​段​​​​​​​。​​​​​​​
下​​​​​​​面​​​​​​​的​​​​​​​例​​​​​​​子​​​​​​​显​​​​​​​示​​​​​​​ pvs 命​​​​​​​令​​​​​​​的​​​​​​​输​​​​​​​出​​​​​​​结​​​​​​​果​​​​​​​,包​​​​​​​括​​​​​​​物​​​​​​​理​​​​​​​卷​​​​​​​名​​​​​​​称​​​​​​​、​​​​​​​大​​​​​​​小​​​​​​​和​​​​​​​可​​​​​​​用​​​​​​​空​​​​​​​间​​​​​​​。​​​​​​​
# pvs -o pv_name,pv_size,pv_free
  PV         PSize  PFree
  /dev/sdb1  17.14G 17.14G
  /dev/sdc1  17.14G 17.09G
  /dev/sdd1  17.14G 17.14G
下​​​​​​​面​​​​​​​的​​​​​​​例​​​​​​​子​​​​​​​显​​​​​​​示​​​​​​​相​​​​​​​同​​​​​​​的​​​​​​​输​​​​​​​出​​​​​​​结​​​​​​​果​​​​​​​,但​​​​​​​根​​​​​​​据​​​​​​​可​​​​​​​用​​​​​​​空​​​​​​​间​​​​​​​字​​​​​​​段​​​​​​​排​​​​​​​序​​​​​​​。​​​​​​​
# pvs -o pv_name,pv_size,pv_free -O pv_free
  PV         PSize  PFree
  /dev/sdc1  17.14G 17.09G
  /dev/sdd1  17.14G 17.14G
  /dev/sdb1  17.14G 17.14G
下​​​​​​​面​​​​​​​的​​​​​​​例​​​​​​​子​​​​​​​表​​​​​​​明​​​​​​​您​​​​​​​不​​​​​​​需​​​​​​​要​​​​​​​根​​​​​​​据​​​​​​​您​​​​​​​要​​​​​​​排​​​​​​​序​​​​​​​的​​​​​​​字​​​​​​​段​​​​​​​显​​​​​​​示​​​​​​​。​​​​​​​
# pvs -o pv_name,pv_size -O pv_free
  PV         PSize
  /dev/sdc1  17.14G
  /dev/sdd1  17.14G
  /dev/sdb1  17.14G
要​​​​​​​显​​​​​​​示​​​​​​​逆​​​​​​​向​​​​​​​排​​​​​​​序​​​​​​​,请​​​​​​​在​​​​​​​ -O 参​​​​​​​数​​​​​​​后​​​​​​​您​​​​​​​指​​​​​​​定​​​​​​​的​​​​​​​字​​​​​​​段​​​​​​​前​​​​​​​添​​​​​​​加​​​​​​​ - 符​​​​​​​号​​​​​​​。​​​​​​​
# pvs -o pv_name,pv_size,pv_free -O -pv_free
  PV         PSize  PFree
  /dev/sdd1  17.14G 17.14G
  /dev/sdb1  17.14G 17.14G
  /dev/sdc1  17.14G 17.09G

4.9.4. 指​​​​​​​定​​​​​​​单​​​​​​​位​​​​​​​

要​​​​​​​指​​​​​​​定​​​​​​​ LVM 报​​​​​​​告​​​​​​​显​​​​​​​示​​​​​​​的​​​​​​​单​​​​​​​位​​​​​​​,请​​​​​​​使​​​​​​​用​​​​​​​报​​​​​​​告​​​​​​​命​​​​​​​令​​​​​​​的​​​​​​​ --units 参​​​​​​​数​​​​​​​。​​​​​​​您​​​​​​​可​​​​​​​以​​​​​​​指​​​​​​​定​​​​​​​字​​​​​​​节​​​​​​​(b)、​​​​​​​千​​​​​​​字​​​​​​​节​​​​​​​(k)、​​​​​​​兆​​​​​​​字​​​​​​​节​​​​​​​(m)、​​​​​​​千​​​​​​​兆​​​​​​​字​​​​​​​节​​​​​​​(g)、​​​​​​​兆​​​​​​​兆​​​​​​​字​​​​​​​节​​​​​​​(t)、​​​​​​​艾​​​​​​​字​​​​​​​节​​​​​​​(e)、​​​​​​​拍​​​​​​​字​​​​​​​节​​​​​​​(p)以​​​​​​​及​​​​​​​可​​​​​​​读​​​​​​​。​​​​​​​默​​​​​​​认​​​​​​​显​​​​​​​示​​​​​​​是​​​​​​​可​​​​​​​读​​​​​​​。​​​​​​​您​​​​​​​可​​​​​​​以​​​​​​​通​​​​​​​过​​​​​​​在​​​​​​​ lvm.conf 文​​​​​​​件​​​​​​​的​​​​​​​ global 部​​​​​​​分​​​​​​​设​​​​​​​定​​​​​​​ units 参​​​​​​​数​​​​​​​来​​​​​​​覆​​​​​​​盖​​​​​​​默​​​​​​​认​​​​​​​设​​​​​​​置​​​​​​​。​​​​​​​
下​​​​​​​面​​​​​​​的​​​​​​​例​​​​​​​子​​​​​​​指​​​​​​​定​​​​​​​ pvs 命​​​​​​​令​​​​​​​的​​​​​​​输​​​​​​​出​​​​​​​结​​​​​​​果​​​​​​​以​​​​​​​兆​​​​​​​为​​​​​​​单​​​​​​​位​​​​​​​,而​​​​​​​不​​​​​​​是​​​​​​​默​​​​​​​认​​​​​​​的​​​​​​​千​​​​​​​兆​​​​​​​为​​​​​​​单​​​​​​​位​​​​​​​。​​​​​​​
# pvs --units m
  PV         VG     Fmt  Attr PSize     PFree
  /dev/sda1         lvm2 --   17555.40M 17555.40M
  /dev/sdb1  new_vg lvm2 a-   17552.00M 17552.00M
  /dev/sdc1  new_vg lvm2 a-   17552.00M 17500.00M
  /dev/sdd1  new_vg lvm2 a-   17552.00M 17552.00M
默​​​​​​​认​​​​​​​情​​​​​​​况​​​​​​​下​​​​​​​,单​​​​​​​位​​​​​​​显​​​​​​​示​​​​​​​为​​​​​​​ 2 的​​​​​​​乘​​​​​​​方​​​​​​​(乘​​​​​​​ 1024)。​​​​​​​您​​​​​​​通​​​​​​​过​​​​​​​大​​​​​​​写​​​​​​​单​​​​​​​位​​​​​​​说​​​​​​​明​​​​​​​(B、​​​​​​​K、​​​​​​​M、​​​​​​​G、​​​​​​​T、​​​​​​​H)指​​​​​​​定​​​​​​​将​​​​​​​单​​​​​​​位​​​​​​​显​​​​​​​示​​​​​​​为​​​​​​​乘​​​​​​​ 1000。​​​​​​​
下​​​​​​​面​​​​​​​的​​​​​​​命​​​​​​​令​​​​​​​以​​​​​​​默​​​​​​​认​​​​​​​行​​​​​​​为​​​​​​​,即​​​​​​​乘​​​​​​​ 1024 显​​​​​​​示​​​​​​​输​​​​​​​出​​​​​​​结​​​​​​​果​​​​​​​。​​​​​​​
# pvs
  PV         VG     Fmt  Attr PSize  PFree
  /dev/sdb1  new_vg lvm2 a-   17.14G 17.14G
  /dev/sdc1  new_vg lvm2 a-   17.14G 17.09G
  /dev/sdd1  new_vg lvm2 a-   17.14G 17.14G
下​​​​​​​面​​​​​​​的​​​​​​​命​​​​​​​令​​​​​​​以​​​​​​​乘​​​​​​​ 1000 显​​​​​​​示​​​​​​​输​​​​​​​出​​​​​​​结​​​​​​​果​​​​​​​。​​​​​​​
#  pvs --units G
  PV         VG     Fmt  Attr PSize  PFree
  /dev/sdb1  new_vg lvm2 a-   18.40G 18.40G
  /dev/sdc1  new_vg lvm2 a-   18.40G 18.35G
  /dev/sdd1  new_vg lvm2 a-   18.40G 18.40G
您​​​​​​​还​​​​​​​可​​​​​​​以​​​​​​​指​​​​​​​定​​​​​​​扇​​​​​​​区​​​​​​​(sector,定​​​​​​​义​​​​​​​为​​​​​​​ 512K),或​​​​​​​者​​​​​​​自​​​​​​​定​​​​​​​义​​​​​​​单​​​​​​​位​​​​​​​。​​​​​​​
下​​​​​​​面​​​​​​​的​​​​​​​命​​​​​​​令​​​​​​​以​​​​​​​扇​​​​​​​区​​​​​​​的​​​​​​​数​​​​​​​目​​​​​​​显​​​​​​​示​​​​​​​ pvs 命​​​​​​​令​​​​​​​的​​​​​​​输​​​​​​​出​​​​​​​结​​​​​​​果​​​​​​​。​​​​​​​
# pvs --units s
  PV         VG     Fmt  Attr PSize     PFree
  /dev/sdb1  new_vg lvm2 a-   35946496S 35946496S
  /dev/sdc1  new_vg lvm2 a-   35946496S 35840000S
  /dev/sdd1  new_vg lvm2 a-   35946496S 35946496S
下​​​​​​​面​​​​​​​的​​​​​​​例​​​​​​​子​​​​​​​显​​​​​​​示​​​​​​​了​​​​​​​ pvs 命​​​​​​​令​​​​​​​的​​​​​​​输​​​​​​​出​​​​​​​结​​​​​​​果​​​​​​​,单​​​​​​​位​​​​​​​为​​​​​​​ 4MB。​​​​​​​
# pvs --units 4m
  PV         VG     Fmt  Attr PSize    PFree
  /dev/sdb1  new_vg lvm2 a-   4388.00U 4388.00U
  /dev/sdc1  new_vg lvm2 a-   4388.00U 4375.00U
  /dev/sdd1  new_vg lvm2 a-   4388.00U 4388.00U

第 5 章 LVM 配​​​​​​​置​​​​​​​示​​​​​​​例​​​​​​​

本​​​​​​​章​​​​​​​提​​​​​​​供​​​​​​​了​​​​​​​一​​​​​​​些​​​​​​​基​​​​​​​本​​​​​​​ LVM 配​​​​​​​置​​​​​​​示​​​​​​​例​​​​​​​。​​​​​​​

5.1. 在​​​​​​​三​​​​​​​个​​​​​​​磁​​​​​​​盘​​​​​​​中​​​​​​​创​​​​​​​建​​​​​​​ LVM 逻​​​​​​​辑​​​​​​​卷​​​​​​​

本​​​​​​​示​​​​​​​例​​​​​​​为​​​​​​​创​​​​​​​建​​​​​​​一​​​​​​​个​​​​​​​名​​​​​​​为​​​​​​​ new_logical_volume 的​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​,它​​​​​​​由​​​​​​​磁​​​​​​​盘​​​​​​​ /dev/sda1、​​​​​​​/dev/sdb1 和​​​​​​​ /dev/sdc1 组​​​​​​​成​​​​​​​。​​​​​​​

5.1.1. 创​​​​​​​建​​​​​​​物​​​​​​​理​​​​​​​卷​​​​​​​

要​​​​​​​在​​​​​​​某​​​​​​​个​​​​​​​卷​​​​​​​组​​​​​​​中​​​​​​​使​​​​​​​用​​​​​​​磁​​​​​​​盘​​​​​​​,您​​​​​​​需​​​​​​​要​​​​​​​将​​​​​​​它​​​​​​​们​​​​​​​标​​​​​​​记​​​​​​​为​​​​​​​ LVM 物​​​​​​​理​​​​​​​卷​​​​​​​。​​​​​​​

警告

这​​​​​​​个​​​​​​​命​​​​​​​令​​​​​​​会​​​​​​​破​​​​​​​坏​​​​​​​ /dev/sda1、​​​​​​​/dev/sdb1 和​​​​​​​/dev/sdc1 中​​​​​​​的​​​​​​​所​​​​​​​有​​​​​​​数​​​​​​​据​​​​​​​。​​​​​​​
[root@tng3-1 ~]# pvcreate /dev/sda1 /dev/sdb1 /dev/sdc1
  Physical volume "/dev/sda1" successfully created
  Physical volume "/dev/sdb1" successfully created
  Physical volume "/dev/sdc1" successfully created

5.1.2. 创​​​​​​​建​​​​​​​卷​​​​​​​组​​​​​​​

下​​​​​​​面​​​​​​​的​​​​​​​命​​​​​​​令​​​​​​​可​​​​​​​创​​​​​​​建​​​​​​​卷​​​​​​​组​​​​​​​ new_vol_group。​​​​​​​
[root@tng3-1 ~]# vgcreate new_vol_group /dev/sda1 /dev/sdb1 /dev/sdc1
  Volume group "new_vol_group" successfully created
您​​​​​​​可​​​​​​​以​​​​​​​使​​​​​​​用​​​​​​​ vgs 命​​​​​​​令​​​​​​​来​​​​​​​显​​​​​​​示​​​​​​​新​​​​​​​卷​​​​​​​组​​​​​​​的​​​​​​​属​​​​​​​性​​​​​​​。​​​​​​​
[root@tng3-1 ~]# vgs
  VG            #PV #LV #SN Attr   VSize  VFree
  new_vol_group   3   0   0 wz--n- 51.45G 51.45G

5.1.3. 创​​​​​​​建​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​

下​​​​​​​面​​​​​​​的​​​​​​​命​​​​​​​令​​​​​​​可​​​​​​​在​​​​​​​卷​​​​​​​组​​​​​​​ new_vol_group 中​​​​​​​创​​​​​​​建​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​ new_logical_volume。​​​​​​​本​​​​​​​示​​​​​​​例​​​​​​​创​​​​​​​建​​​​​​​的​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​使​​​​​​​用​​​​​​​了​​​​​​​卷​​​​​​​组​​​​​​​的​​​​​​​ 2GB 容​​​​​​​量​​​​​​​。​​​​​​​
[root@tng3-1 ~]# lvcreate -L2G -n new_logical_volume new_vol_group
  Logical volume "new_logical_volume" created

5.1.4. 创​​​​​​​建​​​​​​​文​​​​​​​件​​​​​​​系​​​​​​​统​​​​​​​

以​​​​​​​下​​​​​​​命​​​​​​​令​​​​​​​在​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​中​​​​​​​创​​​​​​​建​​​​​​​了​​​​​​​一​​​​​​​个​​​​​​​ GFS 文​​​​​​​件​​​​​​​系​​​​​​​统​​​​​​​。​​​​​​​
[root@tng3-1 ~]# gfs_mkfs -plock_nolock -j 1 /dev/new_vol_group/new_logical_volume
This will destroy any data on /dev/new_vol_group/new_logical_volume.

Are you sure you want to proceed? [y/n] y

Device:                    /dev/new_vol_group/new_logical_volume
Blocksize:                 4096
Filesystem Size:           491460
Journals:                  1
Resource Groups:           8
Locking Protocol:          lock_nolock
Lock Table:

Syncing...
All Done
下​​​​​​​面​​​​​​​的​​​​​​​命​​​​​​​令​​​​​​​将​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​挂​​​​​​​载​​​​​​​到​​​​​​​文​​​​​​​件​​​​​​​系​​​​​​​统​​​​​​​并​​​​​​​报​​​​​​​告​​​​​​​磁​​​​​​​盘​​​​​​​空​​​​​​​间​​​​​​​用​​​​​​​量​​​​​​​。​​​​​​​
[root@tng3-1 ~]# mount /dev/new_vol_group/new_logical_volume /mnt
[root@tng3-1 ~]# df
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/new_vol_group/new_logical_volume
                       1965840        20   1965820   1% /mnt

5.2. 创​​​​​​​建​​​​​​​条​​​​​​​状​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​

本​​​​​​​示​​​​​​​例​​​​​​​为​​​​​​​创​​​​​​​建​​​​​​​一​​​​​​​个​​​​​​​名​​​​​​​为​​​​​​​ striped_logical_volume 的​​​​​​​条​​​​​​​状​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​,并​​​​​​​可​​​​​​​在​​​​​​​磁​​​​​​​盘​​​​​​​ /dev/sda1、​​​​​​​/dev/sdb1 和​​​​​​​ /dev/sdc1 间​​​​​​​跨​​​​​​​磁​​​​​​​盘​​​​​​​条​​​​​​​状​​​​​​​分​​​​​​​配​​​​​​​数​​​​​​​据​​​​​​​。​​​​​​​

5.2.1. 创​​​​​​​建​​​​​​​物​​​​​​​理​​​​​​​卷​​​​​​​

将​​​​​​​卷​​​​​​​组​​​​​​​中​​​​​​​您​​​​​​​要​​​​​​​使​​​​​​​用​​​​​​​的​​​​​​​磁​​​​​​​盘​​​​​​​标​​​​​​​记​​​​​​​为​​​​​​​ LVM 物​​​​​​​理​​​​​​​卷​​​​​​​。​​​​​​​

警告

这​​​​​​​个​​​​​​​命​​​​​​​令​​​​​​​会​​​​​​​破​​​​​​​坏​​​​​​​ /dev/sda1、​​​​​​​/dev/sdb1 和​​​​​​​/dev/sdc1 中​​​​​​​的​​​​​​​所​​​​​​​有​​​​​​​数​​​​​​​据​​​​​​​。​​​​​​​
[root@tng3-1 ~]# pvcreate /dev/sda1 /dev/sdb1 /dev/sdc1
  Physical volume "/dev/sda1" successfully created
  Physical volume "/dev/sdb1" successfully created
  Physical volume "/dev/sdc1" successfully created

5.2.2. 创​​​​​​​建​​​​​​​卷​​​​​​​组​​​​​​​

下​​​​​​​面​​​​​​​的​​​​​​​命​​​​​​​令​​​​​​​可​​​​​​​创​​​​​​​建​​​​​​​卷​​​​​​​组​​​​​​​ striped_vol_group。​​​​​​​
[root@tng3-1 ~]# vgcreate striped_vol_group /dev/sda1 /dev/sdb1 /dev/sdc1
  Volume group "striped_vol_group" successfully created
您​​​​​​​可​​​​​​​以​​​​​​​使​​​​​​​用​​​​​​​ vgs 命​​​​​​​令​​​​​​​来​​​​​​​显​​​​​​​示​​​​​​​新​​​​​​​卷​​​​​​​组​​​​​​​的​​​​​​​属​​​​​​​性​​​​​​​。​​​​​​​
[root@tng3-1 ~]# vgs
  VG                #PV #LV #SN Attr   VSize  VFree
  striped_vol_group   3   0   0 wz--n- 51.45G 51.45G

5.2.3. 创​​​​​​​建​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​

下​​​​​​​面​​​​​​​的​​​​​​​命​​​​​​​令​​​​​​​可​​​​​​​在​​​​​​​卷​​​​​​​组​​​​​​​ striped_vol_group 中​​​​​​​创​​​​​​​建​​​​​​​条​​​​​​​状​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​ striped_logical_volume。​​​​​​​本​​​​​​​示​​​​​​​例​​​​​​​创​​​​​​​建​​​​​​​的​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​的​​​​​​​大​​​​​​​小​​​​​​​为​​​​​​​ 2GB,有​​​​​​​三​​​​​​​个​​​​​​​条​​​​​​​带​​​​​​​,每​​​​​​​个​​​​​​​条​​​​​​​带​​​​​​​的​​​​​​​大​​​​​​​小​​​​​​​为​​​​​​​ 4Kb。​​​​​​​
[root@tng3-1 ~]# lvcreate -i3 -I4 -L2G -nstriped_logical_volume striped_vol_group
  Rounding size (512 extents) up to stripe boundary size (513 extents)
  Logical volume "striped_logical_volume" created

5.2.4. 创​​​​​​​建​​​​​​​文​​​​​​​件​​​​​​​系​​​​​​​统​​​​​​​

以​​​​​​​下​​​​​​​命​​​​​​​令​​​​​​​在​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​中​​​​​​​创​​​​​​​建​​​​​​​了​​​​​​​一​​​​​​​个​​​​​​​ GFS 文​​​​​​​件​​​​​​​系​​​​​​​统​​​​​​​。​​​​​​​
[root@tng3-1 ~]#  gfs_mkfs -plock_nolock -j 1 /dev/striped_vol_group/striped_logical_volume
This will destroy any data on /dev/striped_vol_group/striped_logical_volume.

Are you sure you want to proceed? [y/n] y

Device:                    /dev/striped_vol_group/striped_logical_volume
Blocksize:                 4096
Filesystem Size:           492484
Journals:                  1
Resource Groups:           8
Locking Protocol:          lock_nolock
Lock Table:

Syncing...
All Done
下​​​​​​​面​​​​​​​的​​​​​​​命​​​​​​​令​​​​​​​将​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​挂​​​​​​​载​​​​​​​到​​​​​​​文​​​​​​​件​​​​​​​系​​​​​​​统​​​​​​​并​​​​​​​报​​​​​​​告​​​​​​​磁​​​​​​​盘​​​​​​​空​​​​​​​间​​​​​​​用​​​​​​​量​​​​​​​。​​​​​​​
[root@tng3-1 ~]# mount /dev/striped_vol_group/striped_logical_volume /mnt
[root@tng3-1 ~]# df
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/mapper/VolGroup00-LogVol00
                      13902624   1656776  11528232  13% /
/dev/hda1               101086     10787     85080  12% /boot
tmpfs                   127880         0    127880   0% /dev/shm
/dev/striped_vol_group/striped_logical_volume
                       1969936        20   1969916   1% /mnt

5.3. 分​​​​​​​割​​​​​​​卷​​​​​​​组​​​​​​​

在​​​​​​​本​​​​​​​示​​​​​​​例​​​​​​​中​​​​​​​,现​​​​​​​有​​​​​​​卷​​​​​​​组​​​​​​​由​​​​​​​三​​​​​​​个​​​​​​​物​​​​​​​理​​​​​​​卷​​​​​​​组​​​​​​​成​​​​​​​。​​​​​​​如​​​​​​​果​​​​​​​在​​​​​​​物​​​​​​​理​​​​​​​卷​​​​​​​中​​​​​​​有​​​​​​​足​​​​​​​够​​​​​​​的​​​​​​​未​​​​​​​使​​​​​​​用​​​​​​​空​​​​​​​间​​​​​​​,就​​​​​​​可​​​​​​​在​​​​​​​不​​​​​​​添​​​​​​​加​​​​​​​新​​​​​​​磁​​​​​​​盘​​​​​​​的​​​​​​​情​​​​​​​况​​​​​​​下​​​​​​​创​​​​​​​建​​​​​​​新​​​​​​​的​​​​​​​卷​​​​​​​组​​​​​​​。​​​​​​​
在​​​​​​​初​​​​​​​始​​​​​​​设​​​​​​​定​​​​​​​中​​​​​​​,逻​​​​​​​辑​​​​​​​卷​​​​​​​ mylv 是​​​​​​​从​​​​​​​卷​​​​​​​组​​​​​​​ myvol 中​​​​​​​分​​​​​​​割​​​​​​​出​​​​​​​来​​​​​​​的​​​​​​​,它​​​​​​​依​​​​​​​次​​​​​​​包​​​​​​​含​​​​​​​三​​​​​​​个​​​​​​​物​​​​​​​理​​​​​​​卷​​​​​​​ /dev/sda1、​​​​​​​/dev/sdb1 和​​​​​​​ /dev/sdc1。​​​​​​​
完​​​​​​​成​​​​​​​这​​​​​​​个​​​​​​​步​​​​​​​骤​​​​​​​后​​​​​​​,卷​​​​​​​组​​​​​​​ myvg 将​​​​​​​包​​​​​​​含​​​​​​​ /dev/sda1 和​​​​​​​ /dev/sdb1。​​​​​​​第​​​​​​​二​​​​​​​个​​​​​​​卷​​​​​​​组​​​​​​​ yourvg 将​​​​​​​包​​​​​​​含​​​​​​​ /dev/sdc1。​​​​​​​

5.3.1. 确​​​​​​​定​​​​​​​剩​​​​​​​余​​​​​​​空​​​​​​​间​​​​​​​

您​​​​​​​可​​​​​​​以​​​​​​​使​​​​​​​用​​​​​​​ pvscan 命​​​​​​​令​​​​​​​来​​​​​​​确​​​​​​​定​​​​​​​在​​​​​​​卷​​​​​​​组​​​​​​​中​​​​​​​目​​​​​​​前​​​​​​​有​​​​​​​多​​​​​​​少​​​​​​​可​​​​​​​用​​​​​​​的​​​​​​​剩​​​​​​​余​​​​​​​空​​​​​​​间​​​​​​​。​​​​​​​
[root@tng3-1 ~]# pvscan
  PV /dev/sda1   VG myvg   lvm2 [17.15 GB / 0    free]
  PV /dev/sdb1   VG myvg   lvm2 [17.15 GB / 12.15 GB free]
  PV /dev/sdc1  VG myvg   lvm2 [17.15 GB / 15.80 GB free]
  Total: 3 [51.45 GB] / in use: 3 [51.45 GB] / in no VG: 0 [0   ]

5.3.2. 转​​​​​​​移​​​​​​​数​​​​​​​据​​​​​​​

您​​​​​​​可​​​​​​​以​​​​​​​使​​​​​​​用​​​​​​​ pvmove 将​​​​​​​ /dev/sdc1 中​​​​​​​所​​​​​​​有​​​​​​​使​​​​​​​用​​​​​​​的​​​​​​​物​​​​​​​理​​​​​​​扩​​​​​​​展​​​​​​​移​​​​​​​动​​​​​​​到​​​​​​​ /dev/sdb1 中​​​​​​​。​​​​​​​执​​​​​​​行​​​​​​​ pvmove 会​​​​​​​花​​​​​​​一​​​​​​​些​​​​​​​时​​​​​​​候​​​​​​​。​​​​​​​
[root@tng3-1 ~]# pvmove /dev/sdc1 /dev/sdb1
  /dev/sdc1: Moved: 14.7%
  /dev/sdc1: Moved: 30.3%
  /dev/sdc1: Moved: 45.7%
  /dev/sdc1: Moved: 61.0%
  /dev/sdc1: Moved: 76.6%
  /dev/sdc1: Moved: 92.2%
  /dev/sdc1: Moved: 100.0%
转​​​​​​​移​​​​​​​完​​​​​​​数​​​​​​​据​​​​​​​后​​​​​​​,您​​​​​​​可​​​​​​​以​​​​​​​看​​​​​​​到​​​​​​​ /dev/sdc1 中​​​​​​​的​​​​​​​所​​​​​​​有​​​​​​​空​​​​​​​间​​​​​​​都​​​​​​​可​​​​​​​用​​​​​​​了​​​​​​​。​​​​​​​
[root@tng3-1 ~]# pvscan
  PV /dev/sda1   VG myvg   lvm2 [17.15 GB / 0    free]
  PV /dev/sdb1   VG myvg   lvm2 [17.15 GB / 10.80 GB free]
  PV /dev/sdc1   VG myvg   lvm2 [17.15 GB / 17.15 GB free]
  Total: 3 [51.45 GB] / in use: 3 [51.45 GB] / in no VG: 0 [0   ]

5.3.3. 分​​​​​​​割​​​​​​​卷​​​​​​​组​​​​​​​

要​​​​​​​创​​​​​​​建​​​​​​​新​​​​​​​卷​​​​​​​组​​​​​​​ yourvg,请​​​​​​​使​​​​​​​用​​​​​​​ vgsplit 命​​​​​​​令​​​​​​​分​​​​​​​割​​​​​​​卷​​​​​​​组​​​​​​​ myvg。​​​​​​​
在​​​​​​​您​​​​​​​可​​​​​​​以​​​​​​​分​​​​​​​割​​​​​​​卷​​​​​​​组​​​​​​​前​​​​​​​,必​​​​​​​须​​​​​​​使​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​失​​​​​​​活​​​​​​​。​​​​​​​如​​​​​​​果​​​​​​​挂​​​​​​​载​​​​​​​了​​​​​​​文​​​​​​​件​​​​​​​系​​​​​​​统​​​​​​​,您​​​​​​​必​​​​​​​须​​​​​​​在​​​​​​​失​​​​​​​活​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​之​​​​​​​前​​​​​​​卸​​​​​​​载​​​​​​​文​​​​​​​件​​​​​​​系​​​​​​​统​​​​​​​。​​​​​​​
您​​​​​​​可​​​​​​​以​​​​​​​使​​​​​​​用​​​​​​​ lvchange 命​​​​​​​令​​​​​​​或​​​​​​​者​​​​​​​ vgchange 命​​​​​​​令​​​​​​​使​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​失​​​​​​​活​​​​​​​。​​​​​​​以​​​​​​​下​​​​​​​命​​​​​​​令​​​​​​​可​​​​​​​以​​​​​​​使​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​ mylv 失​​​​​​​活​​​​​​​并​​​​​​​从​​​​​​​卷​​​​​​​组​​​​​​​ myvg 中​​​​​​​分​​​​​​​割​​​​​​​出​​​​​​​卷​​​​​​​组​​​​​​​ yourvg,将​​​​​​​物​​​​​​​理​​​​​​​卷​​​​​​​ /dev/sdc1 移​​​​​​​动​​​​​​​到​​​​​​​新​​​​​​​的​​​​​​​卷​​​​​​​组​​​​​​​ yourvg 中​​​​​​​。​​​​​​​
[root@tng3-1 ~]# lvchange -a n /dev/myvg/mylv
[root@tng3-1 ~]# vgsplit myvg yourvg /dev/sdc1
  Volume group "yourvg" successfully split from "myvg"
您​​​​​​​可​​​​​​​以​​​​​​​使​​​​​​​用​​​​​​​ vgs 查​​​​​​​看​​​​​​​两​​​​​​​个​​​​​​​卷​​​​​​​组​​​​​​​的​​​​​​​属​​​​​​​性​​​​​​​。​​​​​​​
[root@tng3-1 ~]# vgs
  VG     #PV #LV #SN Attr   VSize  VFree
  myvg     2   1   0 wz--n- 34.30G 10.80G
  yourvg   1   0   0 wz--n- 17.15G 17.15G

5.3.4. 创​​​​​​​建​​​​​​​新​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​

创​​​​​​​建​​​​​​​新​​​​​​​的​​​​​​​卷​​​​​​​组​​​​​​​后​​​​​​​,您​​​​​​​可​​​​​​​以​​​​​​​创​​​​​​​建​​​​​​​新​​​​​​​的​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​ yourlv。​​​​​​​
[root@tng3-1 ~]# lvcreate -L5G -n yourlv yourvg
  Logical volume "yourlv" created

5.3.5. 生​​​​​​​成​​​​​​​一​​​​​​​个​​​​​​​文​​​​​​​件​​​​​​​系​​​​​​​统​​​​​​​并​​​​​​​挂​​​​​​​载​​​​​​​到​​​​​​​新​​​​​​​的​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​

您​​​​​​​可​​​​​​​以​​​​​​​在​​​​​​​新​​​​​​​的​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​中​​​​​​​生​​​​​​​成​​​​​​​一​​​​​​​个​​​​​​​文​​​​​​​件​​​​​​​系​​​​​​​统​​​​​​​并​​​​​​​挂​​​​​​​载​​​​​​​它​​​​​​​。​​​​​​​
[root@tng3-1 ~]#  gfs_mkfs -plock_nolock -j 1 /dev/yourvg/yourlv
This will destroy any data on /dev/yourvg/yourlv.

Are you sure you want to proceed? [y/n] y

Device:                    /dev/yourvg/yourlv
Blocksize:                 4096
Filesystem Size:           1277816
Journals:                  1
Resource Groups:           20
Locking Protocol:          lock_nolock
Lock Table:

Syncing...
All Done

[root@tng3-1 ~]# mount /dev/yourvg/yourlv /mnt

5.3.6. 激​​​​​​​活​​​​​​​并​​​​​​​挂​​​​​​​载​​​​​​​原​​​​​​​来​​​​​​​的​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​

因​​​​​​​为​​​​​​​您​​​​​​​必​​​​​​​须​​​​​​​使​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​ mylv 失​​​​​​​活​​​​​​​,所​​​​​​​以​​​​​​​您​​​​​​​需​​​​​​​要​​​​​​​在​​​​​​​挂​​​​​​​载​​​​​​​它​​​​​​​之​​​​​​​前​​​​​​​再​​​​​​​次​​​​​​​激​​​​​​​活​​​​​​​它​​​​​​​。​​​​​​​
root@tng3-1 ~]# lvchange -a y mylv

[root@tng3-1 ~]# mount /dev/myvg/mylv /mnt
[root@tng3-1 ~]# df
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/yourvg/yourlv    24507776        32  24507744   1% /mnt
/dev/myvg/mylv        24507776        32  24507744   1% /mnt

5.4. 从​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​中​​​​​​​删​​​​​​​除​​​​​​​磁​​​​​​​盘​​​​​​​

本​​​​​​​示​​​​​​​例​​​​​​​告​​​​​​​诉​​​​​​​您​​​​​​​如​​​​​​​何​​​​​​​从​​​​​​​现​​​​​​​有​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​中​​​​​​​删​​​​​​​除​​​​​​​磁​​​​​​​盘​​​​​​​,您​​​​​​​可​​​​​​​以​​​​​​​替​​​​​​​换​​​​​​​磁​​​​​​​盘​​​​​​​,也​​​​​​​可​​​​​​​以​​​​​​​用​​​​​​​这​​​​​​​个​​​​​​​磁​​​​​​​盘​​​​​​​作​​​​​​​为​​​​​​​不​​​​​​​同​​​​​​​卷​​​​​​​的​​​​​​​一​​​​​​​部​​​​​​​分​​​​​​​。​​​​​​​要​​​​​​​删​​​​​​​除​​​​​​​磁​​​​​​​盘​​​​​​​,您​​​​​​​必​​​​​​​须​​​​​​​首​​​​​​​先​​​​​​​将​​​​​​​ LVM 物​​​​​​​理​​​​​​​卷​​​​​​​中​​​​​​​的​​​​​​​扩​​​​​​​展​​​​​​​移​​​​​​​动​​​​​​​到​​​​​​​不​​​​​​​同​​​​​​​的​​​​​​​磁​​​​​​​盘​​​​​​​或​​​​​​​者​​​​​​​一​​​​​​​组​​​​​​​磁​​​​​​​盘​​​​​​​中​​​​​​​。​​​​​​​

5.4.1. 将​​​​​​​扩​​​​​​​展​​​​​​​移​​​​​​​动​​​​​​​到​​​​​​​现​​​​​​​有​​​​​​​物​​​​​​​理​​​​​​​卷​​​​​​​中​​​​​​​

在​​​​​​​本​​​​​​​示​​​​​​​例​​​​​​​中​​​​​​​,逻​​​​​​​辑​​​​​​​卷​​​​​​​是​​​​​​​在​​​​​​​卷​​​​​​​组​​​​​​​ myvg 中​​​​​​​的​​​​​​​四​​​​​​​个​​​​​​​物​​​​​​​理​​​​​​​卷​​​​​​​中​​​​​​​进​​​​​​​行​​​​​​​分​​​​​​​配​​​​​​​的​​​​​​​。​​​​​​​
[root@tng3-1]# pvs -o+pv_used
  PV         VG   Fmt  Attr PSize  PFree  Used
  /dev/sda1  myvg lvm2 a-   17.15G 12.15G  5.00G
  /dev/sdb1  myvg lvm2 a-   17.15G 12.15G  5.00G
  /dev/sdc1  myvg lvm2 a-   17.15G 12.15G  5.00G
  /dev/sdd1  myvg lvm2 a-   17.15G  2.15G 15.00G
我​​​​​​​们​​​​​​​想​​​​​​​要​​​​​​​移​​​​​​​动​​​​​​​ /dev/sdb1 的​​​​​​​扩​​​​​​​展​​​​​​​,以​​​​​​​便​​​​​​​可​​​​​​​以​​​​​​​将​​​​​​​其​​​​​​​从​​​​​​​卷​​​​​​​组​​​​​​​中​​​​​​​删​​​​​​​除​​​​​​​。​​​​​​​
如​​​​​​​果​​​​​​​在​​​​​​​卷​​​​​​​组​​​​​​​的​​​​​​​其​​​​​​​它​​​​​​​物​​​​​​​理​​​​​​​卷​​​​​​​中​​​​​​​没​​​​​​​有​​​​​​​足​​​​​​​够​​​​​​​的​​​​​​​剩​​​​​​​余​​​​​​​扩​​​​​​​展​​​​​​​,您​​​​​​​可​​​​​​​以​​​​​​​在​​​​​​​您​​​​​​​想​​​​​​​要​​​​​​​删​​​​​​​除​​​​​​​的​​​​​​​设​​​​​​​备​​​​​​​中​​​​​​​执​​​​​​​行​​​​​​​不​​​​​​​带​​​​​​​选​​​​​​​项​​​​​​​的​​​​​​​ pvmove 命​​​​​​​令​​​​​​​,那​​​​​​​么​​​​​​​扩​​​​​​​展​​​​​​​就​​​​​​​会​​​​​​​被​​​​​​​分​​​​​​​配​​​​​​​到​​​​​​​其​​​​​​​它​​​​​​​设​​​​​​​备​​​​​​​中​​​​​​​。​​​​​​​
[root@tng3-1 ~]# pvmove /dev/sdb1
  /dev/sdb1: Moved: 2.0%
 ...
  /dev/sdb1: Moved: 79.2%
 ...
  /dev/sdb1: Moved: 100.0%
完​​​​​​​成​​​​​​​ pvmove 命​​​​​​​令​​​​​​​后​​​​​​​,扩​​​​​​​展​​​​​​​的​​​​​​​分​​​​​​​配​​​​​​​如​​​​​​​下​​​​​​​:
[root@tng3-1]# pvs -o+pv_used
  PV         VG   Fmt  Attr PSize  PFree  Used
  /dev/sda1  myvg lvm2 a-   17.15G  7.15G 10.00G
  /dev/sdb1  myvg lvm2 a-   17.15G 17.15G     0
  /dev/sdc1  myvg lvm2 a-   17.15G 12.15G  5.00G
  /dev/sdd1  myvg lvm2 a-   17.15G  2.15G 15.00G
使​​​​​​​用​​​​​​​ vgreduce 命​​​​​​​令​​​​​​​从​​​​​​​卷​​​​​​​组​​​​​​​中​​​​​​​删​​​​​​​除​​​​​​​物​​​​​​​理​​​​​​​卷​​​​​​​ /dev/sdb1。​​​​​​​
[root@tng3-1 ~]# vgreduce myvg /dev/sdb1
  Removed "/dev/sdb1" from volume group "myvg"
[root@tng3-1 ~]# pvs
  PV         VG   Fmt  Attr PSize  PFree
  /dev/sda1  myvg lvm2 a-   17.15G  7.15G
  /dev/sdb1       lvm2 --   17.15G 17.15G
  /dev/sdc1  myvg lvm2 a-   17.15G 12.15G
  /dev/sdd1  myvg lvm2 a-   17.15G  2.15G
现​​​​​​​在​​​​​​​可​​​​​​​以​​​​​​​物​​​​​​​理​​​​​​​删​​​​​​​除​​​​​​​这​​​​​​​个​​​​​​​磁​​​​​​​盘​​​​​​​或​​​​​​​者​​​​​​​将​​​​​​​其​​​​​​​分​​​​​​​配​​​​​​​给​​​​​​​其​​​​​​​它​​​​​​​用​​​​​​​户​​​​​​​。​​​​​​​

5.4.2. 将​​​​​​​扩​​​​​​​展​​​​​​​移​​​​​​​动​​​​​​​到​​​​​​​新​​​​​​​磁​​​​​​​盘​​​​​​​中​​​​​​​

在​​​​​​​本​​​​​​​示​​​​​​​例​​​​​​​中​​​​​​​,逻​​​​​​​辑​​​​​​​卷​​​​​​​在​​​​​​​卷​​​​​​​组​​​​​​​ myvg 中​​​​​​​按​​​​​​​以​​​​​​​下​​​​​​​方​​​​​​​法​​​​​​​分​​​​​​​配​​​​​​​:
[root@tng3-1]# pvs -o+pv_used
  PV         VG   Fmt  Attr PSize  PFree  Used
  /dev/sda1  myvg lvm2 a-   17.15G  7.15G 10.00G
  /dev/sdb1  myvg lvm2 a-   17.15G 15.15G  2.00G
  /dev/sdc1  myvg lvm2 a-   17.15G 15.15G  2.00G
我​​​​​​​们​​​​​​​想​​​​​​​要​​​​​​​将​​​​​​​ /dev/sdb1> 的​​​​​​​扩​​​​​​​展​​​​​​​移​​​​​​​动​​​​​​​到​​​​​​​新​​​​​​​设​​​​​​​备​​​​​​​ /dev/sdd1 中​​​​​​​。​​​​​​​

5.4.2.1. 创​​​​​​​建​​​​​​​新​​​​​​​物​​​​​​​理​​​​​​​卷​​​​​​​

在​​​​​​​ /dev/sdd1 中​​​​​​​创​​​​​​​建​​​​​​​新​​​​​​​物​​​​​​​理​​​​​​​卷​​​​​​​。​​​​​​​
[root@tng3-1 ~]# pvcreate /dev/sdd1
  Physical volume "/dev/sdd1" successfully created

5.4.2.2. 将​​​​​​​新​​​​​​​物​​​​​​​理​​​​​​​卷​​​​​​​添​​​​​​​加​​​​​​​到​​​​​​​卷​​​​​​​组​​​​​​​中​​​​​​​

将​​​​​​​ /dev/sdd1 添​​​​​​​加​​​​​​​到​​​​​​​现​​​​​​​有​​​​​​​卷​​​​​​​组​​​​​​​ myvg 中​​​​​​​。​​​​​​​
[root@tng3-1 ~]# vgextend myvg /dev/sdd1
  Volume group "myvg" successfully extended
[root@tng3-1]# pvs -o+pv_used
  PV         VG   Fmt  Attr PSize  PFree  Used
  /dev/sda1   myvg lvm2 a-   17.15G  7.15G 10.00G
  /dev/sdb1   myvg lvm2 a-   17.15G 15.15G  2.00G
  /dev/sdc1   myvg lvm2 a-   17.15G 15.15G  2.00G
  /dev/sdd1   myvg lvm2 a-   17.15G 17.15G     0

5.4.2.3. 转​​​​​​​移​​​​​​​数​​​​​​​据​​​​​​​

使​​​​​​​用​​​​​​​ pvmove 将​​​​​​​数​​​​​​​据​​​​​​​从​​​​​​​ /dev/sdb1 转​​​​​​​移​​​​​​​到​​​​​​​ /dev/sdd1 中​​​​​​​。​​​​​​​
[root@tng3-1 ~]# pvmove /dev/sdb1 /dev/sdd1
  /dev/sdb1: Moved: 10.0%
...
  /dev/sdb1: Moved: 79.7%
...
  /dev/sdb1: Moved: 100.0%

[root@tng3-1]# pvs -o+pv_used
  PV          VG   Fmt  Attr PSize  PFree  Used
  /dev/sda1   myvg lvm2 a-   17.15G  7.15G 10.00G
  /dev/sdb1   myvg lvm2 a-   17.15G 17.15G     0
  /dev/sdc1   myvg lvm2 a-   17.15G 15.15G  2.00G
  /dev/sdd1   myvg lvm2 a-   17.15G 15.15G  2.00G

5.4.2.4. 删​​​​​​​除​​​​​​​卷​​​​​​​组​​​​​​​中​​​​​​​的​​​​​​​旧​​​​​​​物​​​​​​​理​​​​​​​卷​​​​​​​

您​​​​​​​将​​​​​​​数​​​​​​​据​​​​​​​从​​​​​​​ /dev/sdb1 中​​​​​​​移​​​​​​​走​​​​​​​后​​​​​​​,您​​​​​​​就​​​​​​​可​​​​​​​以​​​​​​​将​​​​​​​它​​​​​​​从​​​​​​​卷​​​​​​​组​​​​​​​中​​​​​​​删​​​​​​​除​​​​​​​了​​​​​​​。​​​​​​​
[root@tng3-1 ~]# vgreduce myvg /dev/sdb1
  Removed "/dev/sdb1" from volume group "myvg"
现​​​​​​​在​​​​​​​您​​​​​​​可​​​​​​​以​​​​​​​将​​​​​​​这​​​​​​​个​​​​​​​磁​​​​​​​盘​​​​​​​重​​​​​​​新​​​​​​​分​​​​​​​配​​​​​​​给​​​​​​​其​​​​​​​它​​​​​​​卷​​​​​​​组​​​​​​​,或​​​​​​​者​​​​​​​将​​​​​​​其​​​​​​​从​​​​​​​系​​​​​​​统​​​​​​​中​​​​​​​删​​​​​​​除​​​​​​​。​​​​​​​

第 6 章 LVM 故​​​​​​​障​​​​​​​排​​​​​​​除​​​​​​​

本​​​​​​​章​​​​​​​提​​​​​​​供​​​​​​​了​​​​​​​对​​​​​​​不​​​​​​​同​​​​​​​ LVM 问​​​​​​​题​​​​​​​进​​​​​​​行​​​​​​​故​​​​​​​障​​​​​​​排​​​​​​​除​​​​​​​的​​​​​​​操​​​​​​​作​​​​​​​方​​​​​​​法​​​​​​​。​​​​​​​

6.1. 故​​​​​​​障​​​​​​​排​​​​​​​除​​​​​​​诊​​​​​​​断​​​​​​​

如​​​​​​​果​​​​​​​某​​​​​​​个​​​​​​​命​​​​​​​令​​​​​​​没​​​​​​​有​​​​​​​按​​​​​​​照​​​​​​​预​​​​​​​期​​​​​​​执​​​​​​​行​​​​​​​,您​​​​​​​可​​​​​​​以​​​​​​​用​​​​​​​以​​​​​​​下​​​​​​​方​​​​​​​法​​​​​​​收​​​​​​​集​​​​​​​诊​​​​​​​断​​​​​​​信​​​​​​​息​​​​​​​:
  • 使​​​​​​​用​​​​​​​命​​​​​​​令​​​​​​​的​​​​​​​ -v、​​​​​​​-vv、​​​​​​​-vvv 或​​​​​​​者​​​​​​​ -vvvv 选​​​​​​​现​​​​​​​提​​​​​​​高​​​​​​​输​​​​​​​出​​​​​​​信​​​​​​​息​​​​​​​的​​​​​​​详​​​​​​​细​​​​​​​程​​​​​​​度​​​​​​​。​​​​​​​
  • If the problem is related to the logical volume activation, set 'activation = 1' in the 'log' section of the configuration file and run the command with the -vvvv argument. After you have finished examining this output be sure to reset this parameter to 0, to avoid possible problems with the machine locking during low memory situations.
  • 运​​​​​​​行​​​​​​​ lvmdump 命​​​​​​​令​​​​​​​可​​​​​​​为​​​​​​​诊​​​​​​​断​​​​​​​提​​​​​​​供​​​​​​​信​​​​​​​息​​​​​​​转​​​​​​​储​​​​​​​。​​​​​​​有​​​​​​​关​​​​​​​详​​​​​​​情​​​​​​​请​​​​​​​参​​​​​​​考​​​​​​​ lvmdump(8) man page。​​​​​​​
  • 执​​​​​​​行​​​​​​​ lvs -v、​​​​​​​pvs -a 或​​​​​​​者​​​​​​​ dmsetup info -c 命​​​​​​​令​​​​​​​以​​​​​​​获​​​​​​​得​​​​​​​额​​​​​​​外​​​​​​​的​​​​​​​系​​​​​​​统​​​​​​​信​​​​​​​息​​​​​​​。​​​​​​​
  • 检​​​​​​​查​​​​​​​ /etc/lvm/backup 文​​​​​​​件​​​​​​​中​​​​​​​最​​​​​​​后​​​​​​​的​​​​​​​元​​​​​​​数​​​​​​​据​​​​​​​备​​​​​​​份​​​​​​​和​​​​​​​ /etc/lvm/archive 中​​​​​​​的​​​​​​​归​​​​​​​档​​​​​​​版​​​​​​​本​​​​​​​。​​​​​​​
  • 通​​​​​​​过​​​​​​​运​​​​​​​行​​​​​​​ lvm dumpconfig 命​​​​​​​令​​​​​​​检​​​​​​​查​​​​​​​现​​​​​​​有​​​​​​​配​​​​​​​置​​​​​​​信​​​​​​​息​​​​​​​。​​​​​​​
  • 检​​​​​​​查​​​​​​​ /etc/lvm 中​​​​​​​的​​​​​​​ .cache 文​​​​​​​件​​​​​​​来​​​​​​​了​​​​​​​解​​​​​​​哪​​​​​​​些​​​​​​​设​​​​​​​备​​​​​​​中​​​​​​​有​​​​​​​物​​​​​​​理​​​​​​​卷​​​​​​​。​​​​​​​

6.2. 在​​​​​​​失​​​​​​​败​​​​​​​的​​​​​​​设​​​​​​​备​​​​​​​中​​​​​​​显​​​​​​​示​​​​​​​信​​​​​​​息​​​​​​​。​​​​​​​

您​​​​​​​可​​​​​​​以​​​​​​​使​​​​​​​用​​​​​​​ lvs 或​​​​​​​者​​​​​​​ vgs 命​​​​​​​令​​​​​​​的​​​​​​​ -P 选​​​​​​​项​​​​​​​来​​​​​​​显​​​​​​​示​​​​​​​那​​​​​​​些​​​​​​​没​​​​​​​有​​​​​​​出​​​​​​​现​​​​​​​在​​​​​​​输​​​​​​​出​​​​​​​结​​​​​​​果​​​​​​​中​​​​​​​的​​​​​​​失​​​​​​​败​​​​​​​卷​​​​​​​的​​​​​​​信​​​​​​​息​​​​​​​。​​​​​​​该​​​​​​​选​​​​​​​择​​​​​​​甚​​​​​​​至​​​​​​​允​​​​​​​许​​​​​​​一​​​​​​​些​​​​​​​内​​​​​​​部​​​​​​​元​​​​​​​数​​​​​​​据​​​​​​​不​​​​​​​完​​​​​​​全​​​​​​​统​​​​​​​一​​​​​​​时​​​​​​​的​​​​​​​操​​​​​​​作​​​​​​​。​​​​​​​例​​​​​​​如​​​​​​​:如​​​​​​​果​​​​​​​组​​​​​​​成​​​​​​​卷​​​​​​​组​​​​​​​ vg 的​​​​​​​某​​​​​​​个​​​​​​​设​​​​​​​备​​​​​​​失​​​​​​​败​​​​​​​,vgs 命​​​​​​​令​​​​​​​可​​​​​​​能​​​​​​​会​​​​​​​显​​​​​​​示​​​​​​​以​​​​​​​下​​​​​​​输​​​​​​​出​​​​​​​信​​​​​​​息​​​​​​​。​​​​​​​
[root@link-07 tmp]# vgs -o +devices
  Volume group "vg" not found
如​​​​​​​果​​​​​​​您​​​​​​​为​​​​​​​ vgs 指​​​​​​​定​​​​​​​了​​​​​​​ -P 选​​​​​​​项​​​​​​​,那​​​​​​​么​​​​​​​该​​​​​​​卷​​​​​​​组​​​​​​​虽​​​​​​​仍​​​​​​​然​​​​​​​不​​​​​​​可​​​​​​​用​​​​​​​,但​​​​​​​您​​​​​​​可​​​​​​​能​​​​​​​看​​​​​​​到​​​​​​​更​​​​​​​多​​​​​​​有​​​​​​​关​​​​​​​失​​​​​​​败​​​​​​​设​​​​​​​备​​​​​​​的​​​​​​​信​​​​​​​息​​​​​​​。​​​​​​​
[root@link-07 tmp]# vgs -P -o +devices
  Partial mode. Incomplete volume groups will be activated read-only.
  VG   #PV #LV #SN Attr   VSize VFree Devices
  vg     9   2   0 rz-pn- 2.11T 2.07T unknown device(0)
  vg     9   2   0 rz-pn- 2.11T 2.07T unknown device(5120),/dev/sda1(0)
在​​​​​​​这​​​​​​​个​​​​​​​示​​​​​​​例​​​​​​​中​​​​​​​,失​​​​​​​败​​​​​​​的​​​​​​​设​​​​​​​备​​​​​​​导​​​​​​​致​​​​​​​卷​​​​​​​组​​​​​​​中​​​​​​​的​​​​​​​线​​​​​​​性​​​​​​​和​​​​​​​条​​​​​​​状​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​都​​​​​​​失​​​​​​​败​​​​​​​。​​​​​​​不​​​​​​​带​​​​​​​ -P 选​​​​​​​项​​​​​​​的​​​​​​​ lvs 命​​​​​​​令​​​​​​​会​​​​​​​显​​​​​​​示​​​​​​​以​​​​​​​下​​​​​​​输​​​​​​​出​​​​​​​结​​​​​​​果​​​​​​​。​​​​​​​
[root@link-07 tmp]# lvs -a -o +devices
  Volume group "vg" not found
使​​​​​​​用​​​​​​​ -P 选​​​​​​​项​​​​​​​显​​​​​​​示​​​​​​​失​​​​​​​败​​​​​​​的​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​。​​​​​​​
[root@link-07 tmp]# lvs -P -a -o +devices
  Partial mode. Incomplete volume groups will be activated read-only.
  LV     VG   Attr   LSize  Origin Snap%  Move Log Copy%  Devices
  linear vg   -wi-a- 20.00G                               unknown device(0)
  stripe vg   -wi-a- 20.00G                               unknown device(5120),/dev/sda1(0)
下​​​​​​​面​​​​​​​的​​​​​​​例​​​​​​​子​​​​​​​显​​​​​​​示​​​​​​​在​​​​​​​镜​​​​​​​像​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​的​​​​​​​一​​​​​​​支​​​​​​​出​​​​​​​错​​​​​​​时​​​​​​​,带​​​​​​​ -P 选​​​​​​​项​​​​​​​的​​​​​​​ pvs 和​​​​​​​ lvs 命​​​​​​​令​​​​​​​的​​​​​​​输​​​​​​​出​​​​​​​结​​​​​​​果​​​​​​​。​​​​​​​
root@link-08 ~]#  vgs -a -o +devices -P
  Partial mode. Incomplete volume groups will be activated read-only.
  VG    #PV #LV #SN Attr   VSize VFree Devices
  corey   4   4   0 rz-pnc 1.58T 1.34T my_mirror_mimage_0(0),my_mirror_mimage_1(0)
  corey   4   4   0 rz-pnc 1.58T 1.34T /dev/sdd1(0)
  corey   4   4   0 rz-pnc 1.58T 1.34T unknown device(0)
  corey   4   4   0 rz-pnc 1.58T 1.34T /dev/sdb1(0)
[root@link-08 ~]# lvs -a -o +devices -P
  Partial mode. Incomplete volume groups will be activated read-only.
  LV                   VG    Attr   LSize   Origin Snap%  Move Log            Copy%  Devices
  my_mirror            corey mwi-a- 120.00G                    my_mirror_mlog   1.95 my_mirror_mimage_0(0),my_mirror_mimage_1(0)
  [my_mirror_mimage_0] corey iwi-ao 120.00G                                          unknown device(0)
  [my_mirror_mimage_1] corey iwi-ao 120.00G                                          /dev/sdb1(0)
  [my_mirror_mlog]     corey lwi-ao   4.00M                                          /dev/sdd1(0)

6.3. 修​​​​​​​复​​​​​​​ LVM 镜​​​​​​​像​​​​​​​错​​​​​​​误​​​​​​​

这​​​​​​​部​​​​​​​分​​​​​​​提​​​​​​​供​​​​​​​了​​​​​​​一​​​​​​​个​​​​​​​修​​​​​​​复​​​​​​​示​​​​​​​例​​​​​​​,即​​​​​​​ LVM 镜​​​​​​​像​​​​​​​的​​​​​​​一​​​​​​​个​​​​​​​分​​​​​​​支​​​​​​​失​​​​​​​败​​​​​​​,是​​​​​​​因​​​​​​​为​​​​​​​物​​​​​​​理​​​​​​​卷​​​​​​​的​​​​​​​基​​​​​​​本​​​​​​​设​​​​​​​备​​​​​​​死​​​​​​​机​​​​​​​。​​​​​​​当​​​​​​​一​​​​​​​个​​​​​​​镜​​​​​​​像​​​​​​​分​​​​​​​支​​​​​​​失​​​​​​​败​​​​​​​时​​​​​​​,LVM 将​​​​​​​镜​​​​​​​像​​​​​​​卷​​​​​​​转​​​​​​​换​​​​​​​成​​​​​​​线​​​​​​​性​​​​​​​卷​​​​​​​,并​​​​​​​在​​​​​​​没​​​​​​​有​​​​​​​镜​​​​​​​像​​​​​​​冗​​​​​​​余​​​​​​​的​​​​​​​之​​​​​​​前​​​​​​​继​​​​​​​续​​​​​​​进​​​​​​​行​​​​​​​操​​​​​​​作​​​​​​​。​​​​​​​在​​​​​​​那​​​​​​​个​​​​​​​时​​​​​​​候​​​​​​​,您​​​​​​​可​​​​​​​以​​​​​​​在​​​​​​​系​​​​​​​统​​​​​​​中​​​​​​​添​​​​​​​加​​​​​​​一​​​​​​​个​​​​​​​新​​​​​​​的​​​​​​​磁​​​​​​​盘​​​​​​​来​​​​​​​替​​​​​​​换​​​​​​​物​​​​​​​理​​​​​​​设​​​​​​​备​​​​​​​,并​​​​​​​重​​​​​​​建​​​​​​​镜​​​​​​​像​​​​​​​。​​​​​​​
以​​​​​​​下​​​​​​​命​​​​​​​令​​​​​​​创​​​​​​​建​​​​​​​将​​​​​​​用​​​​​​​于​​​​​​​镜​​​​​​​像​​​​​​​的​​​​​​​物​​​​​​​理​​​​​​​卷​​​​​​​。​​​​​​​
[root@link-08 ~]# pvcreate /dev/sd[abcdefgh][12]
  Physical volume "/dev/sda1" successfully created
  Physical volume "/dev/sda2" successfully created
  Physical volume "/dev/sdb1" successfully created
  Physical volume "/dev/sdb2" successfully created
  Physical volume "/dev/sdc1" successfully created
  Physical volume "/dev/sdc2" successfully created
  Physical volume "/dev/sdd1" successfully created
  Physical volume "/dev/sdd2" successfully created
  Physical volume "/dev/sde1" successfully created
  Physical volume "/dev/sde2" successfully created
  Physical volume "/dev/sdf1" successfully created
  Physical volume "/dev/sdf2" successfully created
  Physical volume "/dev/sdg1" successfully created
  Physical volume "/dev/sdg2" successfully created
  Physical volume "/dev/sdh1" successfully created
  Physical volume "/dev/sdh2" successfully created
以​​​​​​​下​​​​​​​命​​​​​​​令​​​​​​​创​​​​​​​建​​​​​​​卷​​​​​​​组​​​​​​​ vg 和​​​​​​​镜​​​​​​​像​​​​​​​卷​​​​​​​ groupfs。​​​​​​​
[root@link-08 ~]# vgcreate vg /dev/sd[abcdefgh][12]
  Volume group "vg" successfully created
[root@link-08 ~]# lvcreate -L 750M -n groupfs -m 1 vg /dev/sda1 /dev/sdb1 /dev/sdc1
  Rounding up size to full physical extent 752.00 MB
  Logical volume "groupfs" created
您​​​​​​​可​​​​​​​以​​​​​​​使​​​​​​​用​​​​​​​ lvs 命​​​​​​​令​​​​​​​确​​​​​​​定​​​​​​​镜​​​​​​​像​​​​​​​卷​​​​​​​、​​​​​​​用​​​​​​​于​​​​​​​镜​​​​​​​像​​​​​​​分​​​​​​​支​​​​​​​的​​​​​​​基​​​​​​​本​​​​​​​设​​​​​​​备​​​​​​​以​​​​​​​及​​​​​​​镜​​​​​​​像​​​​​​​分​​​​​​​支​​​​​​​的​​​​​​​布​​​​​​​局​​​​​​​。​​​​​​​请​​​​​​​注​​​​​​​意​​​​​​​:在​​​​​​​第​​​​​​​一​​​​​​​个​​​​​​​示​​​​​​​例​​​​​​​中​​​​​​​,镜​​​​​​​像​​​​​​​还​​​​​​​没​​​​​​​有​​​​​​​被​​​​​​​完​​​​​​​全​​​​​​​同​​​​​​​步​​​​​​​,您​​​​​​​应​​​​​​​该​​​​​​​在​​​​​​​ Copy% 字​​​​​​​段​​​​​​​显​​​​​​​示​​​​​​​ 100.00 之​​​​​​​后​​​​​​​才​​​​​​​继​​​​​​​续​​​​​​​操​​​​​​​作​​​​​​​。​​​​​​​
[root@link-08 ~]# lvs -a -o +devices
  LV                 VG   Attr   LSize   Origin Snap%  Move Log          Copy% Devices
  groupfs            vg   mwi-a- 752.00M                    groupfs_mlog 21.28 groupfs_mimage_0(0),groupfs_mimage_1(0)
  [groupfs_mimage_0] vg   iwi-ao 752.00M                                       /dev/sda1(0)
  [groupfs_mimage_1] vg   iwi-ao 752.00M                                       /dev/sdb1(0)
  [groupfs_mlog]     vg   lwi-ao   4.00M                                       /dev/sdc1(0)

[root@link-08 ~]# lvs -a -o +devices
  LV                 VG   Attr   LSize   Origin Snap%  Move Log          Copy%  Devices
  groupfs            vg   mwi-a- 752.00M                    groupfs_mlog 100.00 groupfs_mimage_0(0),groupfs_mimage_1(0)
  [groupfs_mimage_0] vg   iwi-ao 752.00M                                        /dev/sda1(0)
  [groupfs_mimage_1] vg   iwi-ao 752.00M                                        /dev/sdb1(0)
  [groupfs_mlog]     vg   lwi-ao   4.00M     i                                  /dev/sdc1(0)
在​​​​​​​这​​​​​​​个​​​​​​​示​​​​​​​例​​​​​​​中​​​​​​​,镜​​​​​​​像​​​​​​​ /dev/sda1 的​​​​​​​主​​​​​​​要​​​​​​​分​​​​​​​支​​​​​​​失​​​​​​​败​​​​​​​。​​​​​​​任​​​​​​​何​​​​​​​对​​​​​​​镜​​​​​​​像​​​​​​​卷​​​​​​​的​​​​​​​写​​​​​​​入​​​​​​​操​​​​​​​作​​​​​​​都​​​​​​​会​​​​​​​导​​​​​​​致​​​​​​​ LVM 去​​​​​​​检​​​​​​​测​​​​​​​失​​​​​​​败​​​​​​​的​​​​​​​镜​​​​​​​像​​​​​​​。​​​​​​​这​​​​​​​个​​​​​​​时​​​​​​​候​​​​​​​,LVM 会​​​​​​​将​​​​​​​镜​​​​​​​像​​​​​​​转​​​​​​​换​​​​​​​成​​​​​​​单​​​​​​​一​​​​​​​线​​​​​​​性​​​​​​​卷​​​​​​​。​​​​​​​在​​​​​​​这​​​​​​​里​​​​​​​,引​​​​​​​起​​​​​​​转​​​​​​​发​​​​​​​的​​​​​​​因​​​​​​​素​​​​​​​是​​​​​​​我​​​​​​​们​​​​​​​执​​​​​​​行​​​​​​​了​​​​​​​ dd 命​​​​​​​令​​​​​​​。​​​​​​​
[root@link-08 ~]# dd if=/dev/zero of=/dev/vg/groupfs count=10
10+0 records in
10+0 records out
您​​​​​​​可​​​​​​​以​​​​​​​使​​​​​​​用​​​​​​​ lvs 命​​​​​​​令​​​​​​​确​​​​​​​定​​​​​​​该​​​​​​​设​​​​​​​备​​​​​​​现​​​​​​​在​​​​​​​已​​​​​​​经​​​​​​​是​​​​​​​线​​​​​​​性​​​​​​​设​​​​​​​备​​​​​​​了​​​​​​​。​​​​​​​因​​​​​​​为​​​​​​​是​​​​​​​失​​​​​​​败​​​​​​​的​​​​​​​磁​​​​​​​盘​​​​​​​,所​​​​​​​以​​​​​​​会​​​​​​​发​​​​​​​生​​​​​​​ I/O 错​​​​​​​误​​​​​​​。​​​​​​​
[root@link-08 ~]# lvs -a -o +devices
  /dev/sda1: read failed after 0 of 2048 at 0: Input/output error
  /dev/sda2: read failed after 0 of 2048 at 0: Input/output error
  LV      VG   Attr   LSize   Origin Snap%  Move Log Copy%  Devices
  groupfs vg   -wi-a- 752.00M                               /dev/sdb1(0)
在​​​​​​​这​​​​​​​里​​​​​​​,您​​​​​​​应​​​​​​​该​​​​​​​仍​​​​​​​然​​​​​​​可​​​​​​​以​​​​​​​使​​​​​​​用​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​,但​​​​​​​没​​​​​​​有​​​​​​​镜​​​​​​​像​​​​​​​冗​​​​​​​余​​​​​​​。​​​​​​​
To rebuild the mirrored volume, you replace the broken drive and recreate the physical volume. If you use the same disk rather than replacing it with a new one, you will see "inconsistent" warnings when you run the pvcreate command.
[root@link-08 ~]# pvcreate /dev/sda[12]
  Physical volume "/dev/sda1" successfully created
  Physical volume "/dev/sda2" successfully created

[root@link-08 ~]# pvscan
  PV /dev/sdb1   VG vg   lvm2 [67.83 GB / 67.10 GB free]
  PV /dev/sdb2   VG vg   lvm2 [67.83 GB / 67.83 GB free]
  PV /dev/sdc1   VG vg   lvm2 [67.83 GB / 67.83 GB free]
  PV /dev/sdc2   VG vg   lvm2 [67.83 GB / 67.83 GB free]
  PV /dev/sdd1   VG vg   lvm2 [67.83 GB / 67.83 GB free]
  PV /dev/sdd2   VG vg   lvm2 [67.83 GB / 67.83 GB free]
  PV /dev/sde1   VG vg   lvm2 [67.83 GB / 67.83 GB free]
  PV /dev/sde2   VG vg   lvm2 [67.83 GB / 67.83 GB free]
  PV /dev/sdf1   VG vg   lvm2 [67.83 GB / 67.83 GB free]
  PV /dev/sdf2   VG vg   lvm2 [67.83 GB / 67.83 GB free]
  PV /dev/sdg1   VG vg   lvm2 [67.83 GB / 67.83 GB free]
  PV /dev/sdg2   VG vg   lvm2 [67.83 GB / 67.83 GB free]
  PV /dev/sdh1   VG vg   lvm2 [67.83 GB / 67.83 GB free]
  PV /dev/sdh2   VG vg   lvm2 [67.83 GB / 67.83 GB free]
  PV /dev/sda1           lvm2 [603.94 GB]
  PV /dev/sda2           lvm2 [603.94 GB]
  Total: 16 [2.11 TB] / in use: 14 [949.65 GB] / in no VG: 2 [1.18 TB]
下​​​​​​​面​​​​​​​您​​​​​​​可​​​​​​​以​​​​​​​使​​​​​​​用​​​​​​​新​​​​​​​的​​​​​​​物​​​​​​​理​​​​​​​卷​​​​​​​来​​​​​​​扩​​​​​​​展​​​​​​​原​​​​​​​来​​​​​​​的​​​​​​​卷​​​​​​​组​​​​​​​。​​​​​​​
[root@link-08 ~]# vgextend vg /dev/sda[12]
  Volume group "vg" successfully extended

[root@link-08 ~]# pvscan
  PV /dev/sdb1   VG vg   lvm2 [67.83 GB / 67.10 GB free]
  PV /dev/sdb2   VG vg   lvm2 [67.83 GB / 67.83 GB free]
  PV /dev/sdc1   VG vg   lvm2 [67.83 GB / 67.83 GB free]
  PV /dev/sdc2   VG vg   lvm2 [67.83 GB / 67.83 GB free]
  PV /dev/sdd1   VG vg   lvm2 [67.83 GB / 67.83 GB free]
  PV /dev/sdd2   VG vg   lvm2 [67.83 GB / 67.83 GB free]
  PV /dev/sde1   VG vg   lvm2 [67.83 GB / 67.83 GB free]
  PV /dev/sde2   VG vg   lvm2 [67.83 GB / 67.83 GB free]
  PV /dev/sdf1   VG vg   lvm2 [67.83 GB / 67.83 GB free]
  PV /dev/sdf2   VG vg   lvm2 [67.83 GB / 67.83 GB free]
  PV /dev/sdg1   VG vg   lvm2 [67.83 GB / 67.83 GB free]
  PV /dev/sdg2   VG vg   lvm2 [67.83 GB / 67.83 GB free]
  PV /dev/sdh1   VG vg   lvm2 [67.83 GB / 67.83 GB free]
  PV /dev/sdh2   VG vg   lvm2 [67.83 GB / 67.83 GB free]
  PV /dev/sda1   VG vg   lvm2 [603.93 GB / 603.93 GB free]
  PV /dev/sda2   VG vg   lvm2 [603.93 GB / 603.93 GB free]
  Total: 16 [2.11 TB] / in use: 16 [2.11 TB] / in no VG: 0 [0   ]
将​​​​​​​线​​​​​​​性​​​​​​​卷​​​​​​​转​​​​​​​换​​​​​​​回​​​​​​​它​​​​​​​原​​​​​​​来​​​​​​​的​​​​​​​镜​​​​​​​像​​​​​​​状​​​​​​​态​​​​​​​。​​​​​​​
[root@link-08 ~]# lvconvert -m 1 /dev/vg/groupfs /dev/sda1 /dev/sdb1 /dev/sdc1
  Logical volume mirror converted.
您​​​​​​​可​​​​​​​以​​​​​​​使​​​​​​​用​​​​​​​ lvs 命​​​​​​​令​​​​​​​确​​​​​​​定​​​​​​​恢​​​​​​​复​​​​​​​到​​​​​​​镜​​​​​​​像​​​​​​​状​​​​​​​态​​​​​​​。​​​​​​​
[root@link-08 ~]# lvs -a -o +devices
  LV                 VG   Attr   LSize   Origin Snap%  Move Log          Copy% Devices
  groupfs            vg   mwi-a- 752.00M                    groupfs_mlog 68.62 groupfs_mimage_0(0),groupfs_mimage_1(0)
  [groupfs_mimage_0] vg   iwi-ao 752.00M                                       /dev/sdb1(0)
  [groupfs_mimage_1] vg   iwi-ao 752.00M                                       /dev/sda1(0)
  [groupfs_mlog]     vg   lwi-ao   4.00M                                       /dev/sdc1(0)

6.4. 修​​​​​​​复​​​​​​​物​​​​​​​理​​​​​​​卷​​​​​​​元​​​​​​​数​​​​​​​据​​​​​​​

如​​​​​​​果​​​​​​​不​​​​​​​小​​​​​​​心​​​​​​​覆​​​​​​​盖​​​​​​​或​​​​​​​者​​​​​​​破​​​​​​​坏​​​​​​​了​​​​​​​卷​​​​​​​组​​​​​​​物​​​​​​​理​​​​​​​卷​​​​​​​元​​​​​​​数​​​​​​​据​​​​​​​区​​​​​​​域​​​​​​​,您​​​​​​​会​​​​​​​看​​​​​​​到​​​​​​​出​​​​​​​错​​​​​​​信​​​​​​​息​​​​​​​显​​​​​​​示​​​​​​​元​​​​​​​数​​​​​​​据​​​​​​​区​​​​​​​域​​​​​​​不​​​​​​​正​​​​​​​确​​​​​​​,或​​​​​​​者​​​​​​​系​​​​​​​统​​​​​​​无​​​​​​​法​​​​​​​使​​​​​​​用​​​​​​​特​​​​​​​定​​​​​​​的​​​​​​​ UUID 找​​​​​​​到​​​​​​​物​​​​​​​理​​​​​​​卷​​​​​​​。​​​​​​​您​​​​​​​可​​​​​​​能​​​​​​​需​​​​​​​要​​​​​​​通​​​​​​​过​​​​​​​在​​​​​​​物​​​​​​​理​​​​​​​卷​​​​​​​的​​​​​​​元​​​​​​​数​​​​​​​据​​​​​​​区​​​​​​​域​​​​​​​写​​​​​​​入​​​​​​​新​​​​​​​的​​​​​​​元​​​​​​​数​​​​​​​据​​​​​​​来​​​​​​​修​​​​​​​复​​​​​​​物​​​​​​​理​​​​​​​卷​​​​​​​数​​​​​​​据​​​​​​​,指​​​​​​​定​​​​​​​相​​​​​​​同​​​​​​​的​​​​​​​ UUID 作​​​​​​​为​​​​​​​丢​​​​​​​失​​​​​​​的​​​​​​​元​​​​​​​数​​​​​​​据​​​​​​​。​​​​​​​

警告

在​​​​​​​正​​​​​​​常​​​​​​​的​​​​​​​ LVM 逻​​​​​​​辑​​​​​​​卷​​​​​​​中​​​​​​​您​​​​​​​应​​​​​​​该​​​​​​​不​​​​​​​会​​​​​​​进​​​​​​​行​​​​​​​这​​​​​​​个​​​​​​​操​​​​​​​作​​​​​​​过​​​​​​​程​​​​​​​。​​​​​​​如​​​​​​​果​​​​​​​您​​​​​​​指​​​​​​​定​​​​​​​了​​​​​​​不​​​​​​​正​​​​​​​确​​​​​​​的​​​​​​​ UUID,您​​​​​​​会​​​​​​​丢​​​​​​​失​​​​​​​您​​​​​​​的​​​​​​​数​​​​​​​据​​​​​​​。​​​​​​​
下​​​​​​​面​​​​​​​的​​​​​​​例​​​​​​​子​​​​​​​显​​​​​​​示​​​​​​​排​​​​​​​序​​​​​​​的​​​​​​​输​​​​​​​出​​​​​​​解​​​​​​​个​​​​​​​,您​​​​​​​可​​​​​​​以​​​​​​​看​​​​​​​到​​​​​​​您​​​​​​​的​​​​​​​元​​​​​​​数​​​​​​​据​​​​​​​是​​​​​​​丢​​​​​​​了​​​​​​​还​​​​​​​是​​​​​​​被​​​​​​​破​​​​​​​坏​​​​​​​了​​​​​​​。​​​​​​​
[root@link-07 backup]# lvs -a -o +devices
  Couldn't find device with uuid 'FmGRh3-zhok-iVI8-7qTD-S5BI-MAEN-NYM5Sk'.
  Couldn't find all physical volumes for volume group VG.
  Couldn't find device with uuid 'FmGRh3-zhok-iVI8-7qTD-S5BI-MAEN-NYM5Sk'.
  Couldn't find all physical volumes for volume group VG.
  ...
通​​​​​​​过​​​​​​​查​​​​​​​看​​​​​​​ /etc/lvm/archive 目​​​​​​​录​​​​​​​,您​​​​​​​可​​​​​​​能​​​​​​​可​​​​​​​以​​​​​​​找​​​​​​​到​​​​​​​被​​​​​​​覆​​​​​​​盖​​​​​​​的​​​​​​​物​​​​​​​理​​​​​​​卷​​​​​​​ UUID。​​​​​​​在​​​​​​​文​​​​​​​件​​​​​​​ VolumeGroupName_xxxx.vg 中​​​​​​​查​​​​​​​找​​​​​​​该​​​​​​​卷​​​​​​​组​​​​​​​最​​​​​​​后​​​​​​​的​​​​​​​有​​​​​​​效​​​​​​​归​​​​​​​档​​​​​​​ LVM 元​​​​​​​数​​​​​​​据​​​​​​​。​​​​​​​
另​​​​​​​外​​​​​​​,您​​​​​​​可​​​​​​​以​​​​​​​找​​​​​​​到​​​​​​​失​​​​​​​活​​​​​​​的​​​​​​​卷​​​​​​​并​​​​​​​设​​​​​​​定​​​​​​​ partial-P)选​​​​​​​项​​​​​​​,这​​​​​​​样​​​​​​​您​​​​​​​就​​​​​​​可​​​​​​​以​​​​​​​找​​​​​​​到​​​​​​​丢​​​​​​​失​​​​​​​的​​​​​​​被​​​​​​​破​​​​​​​坏​​​​​​​的​​​​​​​物​​​​​​​理​​​​​​​卷​​​​​​​的​​​​​​​ UUID。​​​​​​​
[root@link-07 backup]# vgchange -an --partial
  Partial mode. Incomplete volume groups will be activated read-only.
  Couldn't find device with uuid 'FmGRh3-zhok-iVI8-7qTD-S5BI-MAEN-NYM5Sk'.
  Couldn't find device with uuid 'FmGRh3-zhok-iVI8-7qTD-S5BI-MAEN-NYM5Sk'.
  ...
使​​​​​​​用​​​​​​​ pvcreate 的​​​​​​​ --uuid 和​​​​​​​ --restorefile 选​​​​​​​项​​​​​​​恢​​​​​​​复​​​​​​​物​​​​​​​理​​​​​​​卷​​​​​​​。​​​​​​​下​​​​​​​面​​​​​​​的​​​​​​​例​​​​​​​子​​​​​​​使​​​​​​​用​​​​​​​上​​​​​​​述​​​​​​​ UUID FmGRh3-zhok-iVI8-7qTD-S5BI-MAEN-NYM5Sk 将​​​​​​​ /dev/sdh1 设​​​​​​​备​​​​​​​标​​​​​​​记​​​​​​​为​​​​​​​物​​​​​​​理​​​​​​​卷​​​​​​​。​​​​​​​这​​​​​​​个​​​​​​​命​​​​​​​令​​​​​​​使​​​​​​​用​​​​​​​ VG_00050.vg 中​​​​​​​的​​​​​​​元​​​​​​​数​​​​​​​据​​​​​​​信​​​​​​​息​​​​​​​,即​​​​​​​卷​​​​​​​组​​​​​​​ 最​​​​​​​新​​​​​​​的​​​​​​​归​​​​​​​档​​​​​​​元​​​​​​​数​​​​​​​据​​​​​​​恢​​​​​​​复​​​​​​​了​​​​​​​物​​​​​​​理​​​​​​​卷​​​​​​​标​​​​​​​签​​​​​​​。​​​​​​​restorefile 参​​​​​​​数​​​​​​​让​​​​​​​ pvcreate 生​​​​​​​成​​​​​​​一​​​​​​​个​​​​​​​与​​​​​​​卷​​​​​​​组​​​​​​​中​​​​​​​久​​​​​​​的​​​​​​​物​​​​​​​理​​​​​​​卷​​​​​​​兼​​​​​​​容​​​​​​​的​​​​​​​新​​​​​​​物​​​​​​​理​​​​​​​卷​​​​​​​,确​​​​​​​保​​​​​​​新​​​​​​​的​​​​​​​元​​​​​​​数​​​​​​​据​​​​​​​不​​​​​​​会​​​​​​​被​​​​​​​放​​​​​​​在​​​​​​​久​​​​​​​的​​​​​​​物​​​​​​​理​​​​​​​卷​​​​​​​所​​​​​​​做​​​​​​​的​​​​​​​数​​​​​​​据​​​​​​​区​​​​​​​域​​​​​​​(这​​​​​​​有​​​​​​​可​​​​​​​能​​​​​​​发​​​​​​​生​​​​​​​。​​​​​​​例​​​​​​​如​​​​​​​:如​​​​​​​果​​​​​​​原​​​​​​​来​​​​​​​的​​​​​​​ pvcreate 命​​​​​​​令​​​​​​​使​​​​​​​用​​​​​​​了​​​​​​​控​​​​​​​制​​​​​​​元​​​​​​​数​​​​​​​据​​​​​​​放​​​​​​​置​​​​​​​位​​​​​​​置​​​​​​​的​​​​​​​参​​​​​​​数​​​​​​​,或​​​​​​​者​​​​​​​使​​​​​​​用​​​​​​​了​​​​​​​应​​​​​​​用​​​​​​​不​​​​​​​同​​​​​​​默​​​​​​​认​​​​​​​选​​​​​​​项​​​​​​​的​​​​​​​软​​​​​​​件​​​​​​​版​​​​​​​本​​​​​​​创​​​​​​​建​​​​​​​物​​​​​​​理​​​​​​​卷​​​​​​​时​​​​​​​,就​​​​​​​会​​​​​​​发​​​​​​​生​​​​​​​这​​​​​​​种​​​​​​​情​​​​​​​况​​​​​​​)。​​​​​​​pvcreate 命​​​​​​​令​​​​​​​仅​​​​​​​覆​​​​​​​盖​​​​​​​ LVM 元​​​​​​​数​​​​​​​据​​​​​​​区​​​​​​​域​​​​​​​,不​​​​​​​会​​​​​​​影​​​​​​​响​​​​​​​现​​​​​​​有​​​​​​​的​​​​​​​数​​​​​​​据​​​​​​​区​​​​​​​域​​​​​​​。​​​​​​​
[root@link-07 backup]# pvcreate --uuid "FmGRh3-zhok-iVI8-7qTD-S5BI-MAEN-NYM5Sk" --restorefile /etc/lvm/archive/VG_00050.vg /dev/sdh1
  Physical volume "/dev/sdh1" successfully created
You can then use the vgcfgrestore command to restore the volume group's metadata.
[root@link-07 backup]# vgcfgrestore VG
  Restored volume group VG
现​​​​​​​在​​​​​​​您​​​​​​​可​​​​​​​以​​​​​​​显​​​​​​​示​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​。​​​​​​​
[root@link-07 backup]# lvs -a -o +devices
  LV     VG   Attr   LSize   Origin Snap%  Move Log Copy%  Devices
  stripe VG   -wi--- 300.00G                               /dev/sdh1 (0),/dev/sda1(0)
  stripe VG   -wi--- 300.00G                               /dev/sdh1 (34728),/dev/sdb1(0)
下​​​​​​​面​​​​​​​的​​​​​​​命​​​​​​​令​​​​​​​激​​​​​​​活​​​​​​​卷​​​​​​​并​​​​​​​显​​​​​​​示​​​​​​​激​​​​​​​活​​​​​​​的​​​​​​​卷​​​​​​​。​​​​​​​
[root@link-07 backup]# lvchange -ay /dev/VG/stripe
[root@link-07 backup]# lvs -a -o +devices
  LV     VG   Attr   LSize   Origin Snap%  Move Log Copy%  Devices
  stripe VG   -wi-a- 300.00G                               /dev/sdh1 (0),/dev/sda1(0)
  stripe VG   -wi-a- 300.00G                               /dev/sdh1 (34728),/dev/sdb1(0)
如​​​​​​​果​​​​​​​磁​​​​​​​盘​​​​​​​中​​​​​​​的​​​​​​​ LVM 元​​​​​​​数​​​​​​​据​​​​​​​使​​​​​​​用​​​​​​​至​​​​​​​少​​​​​​​覆​​​​​​​盖​​​​​​​了​​​​​​​它​​​​​​​的​​​​​​​数​​​​​​​据​​​​​​​的​​​​​​​空​​​​​​​间​​​​​​​大​​​​​​​小​​​​​​​,这​​​​​​​个​​​​​​​命​​​​​​​令​​​​​​​可​​​​​​​以​​​​​​​恢​​​​​​​复​​​​​​​物​​​​​​​理​​​​​​​卷​​​​​​​。​​​​​​​如​​​​​​​果​​​​​​​覆​​​​​​​盖​​​​​​​元​​​​​​​数​​​​​​​据​​​​​​​的​​​​​​​数​​​​​​​据​​​​​​​超​​​​​​​过​​​​​​​了​​​​​​​元​​​​​​​数​​​​​​​据​​​​​​​区​​​​​​​域​​​​​​​,那​​​​​​​么​​​​​​​就​​​​​​​有​​​​​​​可​​​​​​​能​​​​​​​损​​​​​​​害​​​​​​​到​​​​​​​卷​​​​​​​中​​​​​​​的​​​​​​​数​​​​​​​据​​​​​​​。​​​​​​​您​​​​​​​可​​​​​​​能​​​​​​​可​​​​​​​以​​​​​​​使​​​​​​​用​​​​​​​ fsck 命​​​​​​​令​​​​​​​修​​​​​​​复​​​​​​​那​​​​​​​些​​​​​​​数​​​​​​​据​​​​​​​。​​​​​​​

6.5. 替​​​​​​​换​​​​​​​丢​​​​​​​失​​​​​​​的​​​​​​​物​​​​​​​理​​​​​​​卷​​​​​​​

If a physical volume fails or otherwise needs to be replaced, you can label a new physical volume to replace the one that has been lost in the existing volume group by following the same procedure as you would for recovering physical volume metadata, described in 第 6.4 节 “修​​​​​​​复​​​​​​​物​​​​​​​理​​​​​​​卷​​​​​​​元​​​​​​​数​​​​​​​据​​​​​​​”. You can use the --partial and --verbose arguments of the vgdisplay command to display the UUIDs and sizes of any physical volumes that are no longer present. If you wish to substitute another physical volume of the same size, you can use the pvcreate command with the --restorefile and --uuid arguments to initialize a new device with the same UUID as the missing physical volume. You can then use the vgcfgrestore command to restore the volume group's metadata.

6.6. 从​​​​​​​卷​​​​​​​组​​​​​​​中​​​​​​​删​​​​​​​除​​​​​​​丢​​​​​​​失​​​​​​​的​​​​​​​物​​​​​​​理​​​​​​​卷​​​​​​​。​​​​​​​

如​​​​​​​果​​​​​​​您​​​​​​​丢​​​​​​​失​​​​​​​了​​​​​​​物​​​​​​​理​​​​​​​卷​​​​​​​,您​​​​​​​可​​​​​​​以​​​​​​​用​​​​​​​ vgchange 命​​​​​​​令​​​​​​​的​​​​​​​ --partial 选​​​​​​​项​​​​​​​激​​​​​​​活​​​​​​​卷​​​​​​​组​​​​​​​中​​​​​​​剩​​​​​​​下​​​​​​​的​​​​​​​物​​​​​​​理​​​​​​​卷​​​​​​​。​​​​​​​您​​​​​​​可​​​​​​​以​​​​​​​使​​​​​​​用​​​​​​​ vgreduce 命​​​​​​​令​​​​​​​的​​​​​​​ --removemissing 选​​​​​​​项​​​​​​​删​​​​​​​除​​​​​​​所​​​​​​​有​​​​​​​使​​​​​​​用​​​​​​​卷​​​​​​​组​​​​​​​中​​​​​​​那​​​​​​​些​​​​​​​物​​​​​​​理​​​​​​​卷​​​​​​​的​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​。​​​​​​​
建​​​​​​​议​​​​​​​您​​​​​​​运​​​​​​​行​​​​​​​ vgreduce 命​​​​​​​令​​​​​​​,使​​​​​​​用​​​​​​​ --test 选​​​​​​​项​​​​​​​来​​​​​​​确​​​​​​​定​​​​​​​您​​​​​​​要​​​​​​​破​​​​​​​坏​​​​​​​的​​​​​​​数​​​​​​​据​​​​​​​。​​​​​​​
和​​​​​​​大​​​​​​​多​​​​​​​数​​​​​​​ LVM 操​​​​​​​作​​​​​​​一​​​​​​​样​​​​​​​,vgreduce 命​​​​​​​令​​​​​​​在​​​​​​​某​​​​​​​种​​​​​​​意​​​​​​​义​​​​​​​上​​​​​​​是​​​​​​​可​​​​​​​逆​​​​​​​的​​​​​​​,即​​​​​​​您​​​​​​​立​​​​​​​即​​​​​​​使​​​​​​​用​​​​​​​ vgcfgrestore 命​​​​​​​令​​​​​​​将​​​​​​​卷​​​​​​​组​​​​​​​的​​​​​​​元​​​​​​​数​​​​​​​据​​​​​​​恢​​​​​​​复​​​​​​​到​​​​​​​之​​​​​​​前​​​​​​​的​​​​​​​状​​​​​​​态​​​​​​​。​​​​​​​例​​​​​​​如​​​​​​​:如​​​​​​​果​​​​​​​您​​​​​​​使​​​​​​​用​​​​​​​ vgreduce 命​​​​​​​令​​​​​​​的​​​​​​​ --removemissing 参​​​​​​​数​​​​​​​,而​​​​​​​不​​​​​​​带​​​​​​​ --test 参​​​​​​​数​​​​​​​,您​​​​​​​会​​​​​​​找​​​​​​​到​​​​​​​您​​​​​​​要​​​​​​​保​​​​​​​留​​​​​​​的​​​​​​​已​​​​​​​删​​​​​​​除​​​​​​​的​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​,您​​​​​​​仍​​​​​​​可​​​​​​​用​​​​​​​替​​​​​​​换​​​​​​​物​​​​​​​理​​​​​​​卷​​​​​​​,并​​​​​​​使​​​​​​​用​​​​​​​另​​​​​​​一​​​​​​​个​​​​​​​ vgcfgrestore 命​​​​​​​令​​​​​​​来​​​​​​​将​​​​​​​卷​​​​​​​组​​​​​​​返​​​​​​​回​​​​​​​到​​​​​​​之​​​​​​​前​​​​​​​的​​​​​​​状​​​​​​​态​​​​​​​。​​​​​​​

6.7. 逻​​​​​​​辑​​​​​​​卷​​​​​​​没​​​​​​​有​​​​​​​足​​​​​​​够​​​​​​​的​​​​​​​可​​​​​​​用​​​​​​​扩​​​​​​​展​​​​​​​

You may get the error message "Insufficient free extents" when creating a logical volume when you think you have enough extents based on the output of the vgdisplay or vgs commands. This is because these commands round figures to 2 decimal places to provide human-readable output. To specify exact size, use free physical extent count instead of some multiple of bytes to determine the size of the logical volume.
在​​​​​​​默​​​​​​​认​​​​​​​情​​​​​​​况​​​​​​​下​​​​​​​,vgdisplay 命​​​​​​​令​​​​​​​的​​​​​​​输​​​​​​​出​​​​​​​结​​​​​​​果​​​​​​​提​​​​​​​示​​​​​​​可​​​​​​​用​​​​​​​物​​​​​​​理​​​​​​​扩​​​​​​​展​​​​​​​的​​​​​​​行​​​​​​​。​​​​​​​
# vgdisplay
  --- Volume group ---
  ...
  Free  PE / Size       8780 / 34.30 GB
另​​​​​​​外​​​​​​​,您​​​​​​​可​​​​​​​以​​​​​​​使​​​​​​​用​​​​​​​ vgs 的​​​​​​​ vg_free_count 和​​​​​​​ vg_extent_count 选​​​​​​​项​​​​​​​显​​​​​​​示​​​​​​​可​​​​​​​用​​​​​​​扩​​​​​​​展​​​​​​​和​​​​​​​扩​​​​​​​展​​​​​​​的​​​​​​​总​​​​​​​数​​​​​​​。​​​​​​​
[root@tng3-1 ~]# vgs -o +vg_free_count,vg_extent_count
  VG     #PV #LV #SN Attr   VSize  VFree  Free #Ext
  testvg   2   0   0 wz--n- 34.30G 34.30G 8780 8780
您​​​​​​​有​​​​​​​ 8780 个​​​​​​​可​​​​​​​用​​​​​​​物​​​​​​​理​​​​​​​扩​​​​​​​展​​​​​​​,您​​​​​​​可​​​​​​​以​​​​​​​运​​​​​​​行​​​​​​​以​​​​​​​下​​​​​​​命​​​​​​​令​​​​​​​,使​​​​​​​用​​​​​​​小​​​​​​​写​​​​​​​ l 选​​​​​​​项​​​​​​​使​​​​​​​用​​​​​​​扩​​​​​​​展​​​​​​​而​​​​​​​不​​​​​​​是​​​​​​​字​​​​​​​节​​​​​​​作​​​​​​​为​​​​​​​单​​​​​​​位​​​​​​​:
# lvcreate -l8780 -n testlv testvg
这​​​​​​​样​​​​​​​就​​​​​​​会​​​​​​​使​​​​​​​用​​​​​​​卷​​​​​​​组​​​​​​​中​​​​​​​的​​​​​​​所​​​​​​​有​​​​​​​可​​​​​​​用​​​​​​​扩​​​​​​​展​​​​​​​。​​​​​​​
# vgs -o +vg_free_count,vg_extent_count
  VG     #PV #LV #SN Attr   VSize  VFree Free #Ext
  testvg   2   1   0 wz--n- 34.30G    0     0 8780
Alternately, you can extend the logical volume to use a percentage of the remaining free space in the volume group by using the -l argument of the lvcreate command. For information, see 第 4.4.1.1 节 “创​​​​​​​建​​​​​​​线​​​​​​​性​​​​​​​卷​​​​​​​”.

第 7 章 用​​​​​​​ LVM GUI 进​​​​​​​行​​​​​​​ LVM 管​​​​​​​理​​​​​​​

除​​​​​​​了​​​​​​​命​​​​​​​令​​​​​​​行​​​​​​​界​​​​​​​面​​​​​​​(CLI),LVM 还​​​​​​​提​​​​​​​供​​​​​​​用​​​​​​​来​​​​​​​配​​​​​​​置​​​​​​​ LVM 逻​​​​​​​辑​​​​​​​卷​​​​​​​的​​​​​​​图​​​​​​​形​​​​​​​用​​​​​​​户​​​​​​​界​​​​​​​面​​​​​​​(GUI)。​​​​​​​您​​​​​​​可​​​​​​​以​​​​​​​通​​​​​​​过​​​​​​​输​​​​​​​入​​​​​​​ system-config-lvm 启​​​​​​​用​​​​​​​此​​​​​​​工​​​​​​​具​​​​​​​。​​​​​​​红​​​​​​​帽​​​​​​​企​​​​​​​业​​​​​​​版​​​​​​​ Linux 部​​​​​​​署​​​​​​​指​​​​​​​南​​​​​​​中​​​​​​​关​​​​​​​于​​​​​​​配​​​​​​​置​​​​​​​的​​​​​​​ LVM 的​​​​​​​章​​​​​​​节​​​​​​​提​​​​​​​供​​​​​​​了​​​​​​​使​​​​​​​用​​​​​​​此​​​​​​​工​​​​​​​具​​​​​​​进​​​​​​​行​​​​​​​配​​​​​​​置​​​​​​​的​​​​​​​具​​​​​​​体​​​​​​​步​​​​​​​骤​​​​​​​。​​​​​​​
另​​​​​​​外​​​​​​​,LVM GUI 还​​​​​​​可​​​​​​​作​​​​​​​为​​​​​​​ Conga 管​​​​​​​理​​​​​​​界​​​​​​​面​​​​​​​的​​​​​​​一​​​​​​​部​​​​​​​分​​​​​​​。​​​​​​​有​​​​​​​关​​​​​​​使​​​​​​​用​​​​​​​带​​​​​​​ Conga 的​​​​​​​ LVM GUI 的​​​​​​​信​​​​​​​息​​​​​​​请​​​​​​​参​​​​​​​考​​​​​​​ Conga 的​​​​​​​在​​​​​​​线​​​​​​​帮​​​​​​​助​​​​​​​。​​​​​​​

附录 A. 设​​​​​​​备​​​​​​​映​​​​​​​射​​​​​​​器​​​​​​​(Device Mapper)

设​​​​​​​备​​​​​​​映​​​​​​​射​​​​​​​器​​​​​​​是​​​​​​​一​​​​​​​个​​​​​​​为​​​​​​​卷​​​​​​​管​​​​​​​理​​​​​​​提​​​​​​​供​​​​​​​通​​​​​​​用​​​​​​​构​​​​​​​架​​​​​​​的​​​​​​​内​​​​​​​核​​​​​​​驱​​​​​​​动​​​​​​​程​​​​​​​序​​​​​​​。​​​​​​​它​​​​​​​提​​​​​​​供​​​​​​​可​​​​​​​用​​​​​​​来​​​​​​​创​​​​​​​建​​​​​​​用​​​​​​​作​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​设​​​​​​​备​​​​​​​的​​​​​​​映​​​​​​​射​​​​​​​设​​​​​​​备​​​​​​​的​​​​​​​通​​​​​​​用​​​​​​​方​​​​​​​法​​​​​​​。​​​​​​​它​​​​​​​不​​​​​​​一​​​​​​​定​​​​​​​要​​​​​​​特​​​​​​​别​​​​​​​了​​​​​​​解​​​​​​​卷​​​​​​​组​​​​​​​或​​​​​​​者​​​​​​​元​​​​​​​数​​​​​​​据​​​​​​​格​​​​​​​式​​​​​​​。​​​​​​​
设​​​​​​​备​​​​​​​映​​​​​​​射​​​​​​​器​​​​​​​为​​​​​​​一​​​​​​​组​​​​​​​高​​​​​​​级​​​​​​​技​​​​​​​术​​​​​​​提​​​​​​​供​​​​​​​了​​​​​​​基​​​​​​​础​​​​​​​。​​​​​​​除​​​​​​​ LVM 之​​​​​​​外​​​​​​​,设​​​​​​​备​​​​​​​映​​​​​​​射​​​​​​​器​​​​​​​多​​​​​​​路​​​​​​​径​​​​​​​和​​​​​​​ dmraid 命​​​​​​​令​​​​​​​也​​​​​​​使​​​​​​​用​​​​​​​设​​​​​​​备​​​​​​​映​​​​​​​射​​​​​​​器​​​​​​​。​​​​​​​设​​​​​​​备​​​​​​​映​​​​​​​射​​​​​​​器​​​​​​​的​​​​​​​应​​​​​​​用​​​​​​​程​​​​​​​序​​​​​​​界​​​​​​​面​​​​​​​是​​​​​​​ioctl 系​​​​​​​统​​​​​​​调​​​​​​​用​​​​​​​。​​​​​​​用​​​​​​​户​​​​​​​界​​​​​​​面​​​​​​​是​​​​​​​ dmsetup 命​​​​​​​令​​​​​​​。​​​​​​​
LVM logical volumes are activated using the Device Mapper. Each logical volume is translated into a mapped device. Each segment translates into a line in the mapping table that describes the device. The Device Mapper supports a variety of mapping targets, including linear mapping, striped mapping, and error mapping. So, for example, two disks may be concatenated into one logical volume with a pair of linear mappings, one for each disk. When LVM2 creates a volume, it creates an underlying device-mapper device that can be queried with the dmsetup command. For information about the format of devices in a mapping table, see 第 A.1 节 “设​​​​​​​备​​​​​​​列​​​​​​​表​​​​​​​映​​​​​​​射​​​​​​​”. For information about using the dmsetup command to query a device, see 第 A.2 节 “dmsetup 命​​​​​​​令​​​​​​​”.

A.1. 设​​​​​​​备​​​​​​​列​​​​​​​表​​​​​​​映​​​​​​​射​​​​​​​

映​​​​​​​射​​​​​​​的​​​​​​​设​​​​​​​备​​​​​​​是​​​​​​​由​​​​​​​一​​​​​​​个​​​​​​​列​​​​​​​表​​​​​​​定​​​​​​​义​​​​​​​的​​​​​​​,该​​​​​​​列​​​​​​​表​​​​​​​指​​​​​​​定​​​​​​​如​​​​​​​何​​​​​​​使​​​​​​​用​​​​​​​支​​​​​​​持​​​​​​​的​​​​​​​设​​​​​​​备​​​​​​​列​​​​​​​表​​​​​​​映​​​​​​​射​​​​​​​将​​​​​​​设​​​​​​​备​​​​​​​的​​​​​​​每​​​​​​​个​​​​​​​逻​​​​​​​辑​​​​​​​分​​​​​​​段​​​​​​​行​​​​​​​进​​​​​​​行​​​​​​​匹​​​​​​​配​​​​​​​。​​​​​​​映​​​​​​​射​​​​​​​设​​​​​​​备​​​​​​​的​​​​​​​列​​​​​​​表​​​​​​​由​​​​​​​以​​​​​​​下​​​​​​​格​​​​​​​式​​​​​​​行​​​​​​​组​​​​​​​成​​​​​​​:
start length mapping [mapping_parameters...]
在​​​​​​​设​​​​​​​备​​​​​​​映​​​​​​​射​​​​​​​列​​​​​​​表​​​​​​​的​​​​​​​第​​​​​​​一​​​​​​​行​​​​​​​中​​​​​​​,start 参​​​​​​​数​​​​​​​必​​​​​​​须​​​​​​​等​​​​​​​于​​​​​​​ 0。​​​​​​​某​​​​​​​行​​​​​​​中​​​​​​​的​​​​​​​ start + length 参​​​​​​​数​​​​​​​必​​​​​​​须​​​​​​​与​​​​​​​下​​​​​​​一​​​​​​​行​​​​​​​的​​​​​​​ start 相​​​​​​​等​​​​​​​。​​​​​​​在​​​​​​​映​​​​​​​射​​​​​​​列​​​​​​​表​​​​​​​中​​​​​​​指​​​​​​​定​​​​​​​哪​​​​​​​个​​​​​​​映​​​​​​​射​​​​​​​参​​​​​​​数​​​​​​​取​​​​​​​决​​​​​​​于​​​​​​​在​​​​​​​该​​​​​​​行​​​​​​​中​​​​​​​指​​​​​​​定​​​​​​​的​​​​​​​ mapping 类​​​​​​​型​​​​​​​。​​​​​​​
设​​​​​​​备​​​​​​​映​​​​​​​射​​​​​​​器​​​​​​​中​​​​​​​的​​​​​​​大​​​​​​​小​​​​​​​总​​​​​​​是​​​​​​​以​​​​​​​扇​​​​​​​区​​​​​​​(512 字​​​​​​​节​​​​​​​)为​​​​​​​单​​​​​​​位​​​​​​​指​​​​​​​定​​​​​​​。​​​​​​​
当​​​​​​​将​​​​​​​某​​​​​​​个​​​​​​​设​​​​​​​备​​​​​​​指​​​​​​​定​​​​​​​为​​​​​​​设​​​​​​​备​​​​​​​映​​​​​​​射​​​​​​​器​​​​​​​中​​​​​​​的​​​​​​​映​​​​​​​射​​​​​​​参​​​​​​​数​​​​​​​,它​​​​​​​就​​​​​​​被​​​​​​​该​​​​​​​文​​​​​​​件​​​​​​​系​​​​​​​统​​​​​​​(比​​​​​​​如​​​​​​​ /dev/hda)中​​​​​​​的​​​​​​​设​​​​​​​备​​​​​​​名​​​​​​​称​​​​​​​或​​​​​​​者​​​​​​​主​​​​​​​号​​​​​​​码​​​​​​​和​​​​​​​副​​​​​​​号​​​​​​​码​​​​​​​以​​​​​​​ major:minor 的​​​​​​​格​​​​​​​式​​​​​​​进​​​​​​​行​​​​​​​参​​​​​​​考​​​​​​​。​​​​​​​首​​​​​​​选​​​​​​​ major:minor 格​​​​​​​式​​​​​​​因​​​​​​​为​​​​​​​这​​​​​​​样​​​​​​​可​​​​​​​避​​​​​​​免​​​​​​​查​​​​​​​找​​​​​​​路​​​​​​​径​​​​​​​名​​​​​​​称​​​​​​​。​​​​​​​
以​​​​​​​下​​​​​​​显​​​​​​​示​​​​​​​了​​​​​​​某​​​​​​​设​​​​​​​备​​​​​​​的​​​​​​​映​​​​​​​像​​​​​​​列​​​​​​​表​​​​​​​示​​​​​​​例​​​​​​​。​​​​​​​在​​​​​​​这​​​​​​​个​​​​​​​列​​​​​​​表​​​​​​​中​​​​​​​有​​​​​​​四​​​​​​​个​​​​​​​线​​​​​​​性​​​​​​​对​​​​​​​象​​​​​​​:
0 35258368 linear 8:48 65920
35258368 35258368 linear 8:32 65920
70516736 17694720 linear 8:16 17694976
88211456 17694720 linear 8:16 256
每​​​​​​​行​​​​​​​的​​​​​​​前​​​​​​​两​​​​​​​个​​​​​​​参​​​​​​​数​​​​​​​是​​​​​​​片​​​​​​​段​​​​​​​起​​​​​​​始​​​​​​​块​​​​​​​以​​​​​​​及​​​​​​​该​​​​​​​片​​​​​​​段​​​​​​​的​​​​​​​长​​​​​​​度​​​​​​​。​​​​​​​下​​​​​​​一​​​​​​​个​​​​​​​关​​​​​​​键​​​​​​​字​​​​​​​是​​​​​​​映​​​​​​​射​​​​​​​对​​​​​​​象​​​​​​​,在​​​​​​​此​​​​​​​示​​​​​​​例​​​​​​​中​​​​​​​全​​​​​​​部​​​​​​​是​​​​​​​ linear。​​​​​​​该​​​​​​​行​​​​​​​的​​​​​​​其​​​​​​​余​​​​​​​部​​​​​​​分​​​​​​​包​​​​​​​括​​​​​​​用​​​​​​​于​​​​​​​线​​​​​​​性​​​​​​​对​​​​​​​象​​​​​​​的​​​​​​​参​​​​​​​数​​​​​​​。​​​​​​​
以​​​​​​​下​​​​​​​部​​​​​​​分​​​​​​​描​​​​​​​述​​​​​​​了​​​​​​​以​​​​​​​下​​​​​​​映​​​​​​​射​​​​​​​的​​​​​​​格​​​​​​​式​​​​​​​:
  • 线​​​​​​​性​​​​​​​
  • 条​​​​​​​状​​​​​​​
  • 镜​​​​​​​像​​​​​​​
  • 快​​​​​​​照​​​​​​​以​​​​​​​及​​​​​​​ snapshot-origin
  • 错​​​​​​​误​​​​​​​
  • 零​​​​​​​
  • 多​​​​​​​路​​​​​​​径​​​​​​​
  • 加​​​​​​​密​​​​​​​

A.1.1. 线​​​​​​​性​​​​​​​映​​​​​​​射​​​​​​​对​​​​​​​象​​​​​​​

线​​​​​​​性​​​​​​​映​​​​​​​射​​​​​​​对​​​​​​​象​​​​​​​将​​​​​​​块​​​​​​​的​​​​​​​连​​​​​​​续​​​​​​​行​​​​​​​映​​​​​​​射​​​​​​​到​​​​​​​另​​​​​​​一​​​​​​​个​​​​​​​块​​​​​​​设​​​​​​​备​​​​​​​中​​​​​​​。​​​​​​​线​​​​​​​性​​​​​​​对​​​​​​​象​​​​​​​的​​​​​​​格​​​​​​​式​​​​​​​如​​​​​​​下​​​​​​​:
start length linear device offset
start
虚​​​​​​​拟​​​​​​​设​​​​​​​备​​​​​​​中​​​​​​​的​​​​​​​起​​​​​​​始​​​​​​​块​​​​​​​
length
这​​​​​​​个​​​​​​​片​​​​​​​段​​​​​​​的​​​​​​​长​​​​​​​度​​​​​​​
device
块​​​​​​​设​​​​​​​备​​​​​​​,被​​​​​​​该​​​​​​​文​​​​​​​件​​​​​​​系​​​​​​​统​​​​​​​中​​​​​​​的​​​​​​​设​​​​​​​备​​​​​​​名​​​​​​​称​​​​​​​或​​​​​​​者​​​​​​​主​​​​​​​号​​​​​​​码​​​​​​​和​​​​​​​副​​​​​​​号​​​​​​​码​​​​​​​以​​​​​​​ major:minor 的​​​​​​​格​​​​​​​式​​​​​​​参​​​​​​​考​​​​​​​
offset
该​​​​​​​设​​​​​​​备​​​​​​​中​​​​​​​映​​​​​​​射​​​​​​​的​​​​​​​起​​​​​​​始​​​​​​​误​​​​​​​差​​​​​​​
以​​​​​​​下​​​​​​​示​​​​​​​例​​​​​​​显​​​​​​​示​​​​​​​了​​​​​​​起​​​​​​​始​​​​​​​块​​​​​​​位​​​​​​​于​​​​​​​虚​​​​​​​拟​​​​​​​设​​​​​​​备​​​​​​​ 0,片​​​​​​​段​​​​​​​长​​​​​​​度​​​​​​​为​​​​​​​ 1638400,major:minor 号​​​​​​​码​​​​​​​对​​​​​​​为​​​​​​​ 8:2,起​​​​​​​始​​​​​​​误​​​​​​​差​​​​​​​为​​​​​​​ 41146992 的​​​​​​​线​​​​​​​性​​​​​​​对​​​​​​​象​​​​​​​。​​​​​​​
0 16384000 linear 8:2 41156992
以​​​​​​​下​​​​​​​示​​​​​​​例​​​​​​​是​​​​​​​含​​​​​​​有​​​​​​​在​​​​​​​设​​​​​​​备​​​​​​​ /dev/hda 中​​​​​​​指​​​​​​​定​​​​​​​的​​​​​​​设​​​​​​​备​​​​​​​参​​​​​​​数​​​​​​​的​​​​​​​线​​​​​​​性​​​​​​​对​​​​​​​象​​​​​​​。​​​​​​​
0 20971520 linear /dev/hda 384

A.1.2. 条​​​​​​​状​​​​​​​映​​​​​​​射​​​​​​​对​​​​​​​象​​​​​​​

条​​​​​​​状​​​​​​​映​​​​​​​射​​​​​​​对​​​​​​​象​​​​​​​支​​​​​​​持​​​​​​​所​​​​​​​有​​​​​​​跨​​​​​​​物​​​​​​​理​​​​​​​设​​​​​​​备​​​​​​​的​​​​​​​条​​​​​​​块​​​​​​​。​​​​​​​它​​​​​​​使​​​​​​​用​​​​​​​条​​​​​​​块​​​​​​​数​​​​​​​目​​​​​​​和​​​​​​​成​​​​​​​条​​​​​​​的​​​​​​​组​​​​​​​集​​​​​​​大​​​​​​​小​​​​​​​以​​​​​​​及​​​​​​​设​​​​​​​备​​​​​​​名​​​​​​​称​​​​​​​和​​​​​​​扇​​​​​​​区​​​​​​​对​​​​​​​作​​​​​​​为​​​​​​​参​​​​​​​数​​​​​​​。​​​​​​​条​​​​​​​状​​​​​​​对​​​​​​​象​​​​​​​的​​​​​​​格​​​​​​​式​​​​​​​如​​​​​​​下​​​​​​​:
start length striped #stripes chunk_size device1 offset1 ... deviceN offsetN
每​​​​​​​个​​​​​​​条​​​​​​​块​​​​​​​都​​​​​​​有​​​​​​​一​​​​​​​组​​​​​​​ device 和​​​​​​​ offset 参​​​​​​​数​​​​​​​。​​​​​​​
start
虚​​​​​​​拟​​​​​​​设​​​​​​​备​​​​​​​中​​​​​​​的​​​​​​​起​​​​​​​始​​​​​​​块​​​​​​​
length
这​​​​​​​个​​​​​​​片​​​​​​​段​​​​​​​的​​​​​​​长​​​​​​​度​​​​​​​
#stripes
虚​​​​​​​拟​​​​​​​设​​​​​​​备​​​​​​​的​​​​​​​条​​​​​​​数​​​​​​​
chunk_size
切​​​​​​​换​​​​​​​到​​​​​​​下​​​​​​​一​​​​​​​个​​​​​​​条​​​​​​​之​​​​​​​前​​​​​​​写​​​​​​​入​​​​​​​每​​​​​​​个​​​​​​​条​​​​​​​的​​​​​​​扇​​​​​​​区​​​​​​​数​​​​​​​,必​​​​​​​须​​​​​​​至​​​​​​​少​​​​​​​是​​​​​​​内​​​​​​​核​​​​​​​页​​​​​​​面​​​​​​​大​​​​​​​小​​​​​​​的​​​​​​​两​​​​​​​倍​​​​​​​
device
块​​​​​​​设​​​​​​​备​​​​​​​,可​​​​​​​被​​​​​​​该​​​​​​​文​​​​​​​件​​​​​​​系​​​​​​​统​​​​​​​中​​​​​​​的​​​​​​​设​​​​​​​备​​​​​​​名​​​​​​​称​​​​​​​或​​​​​​​者​​​​​​​主​​​​​​​号​​​​​​​码​​​​​​​和​​​​​​​副​​​​​​​号​​​​​​​码​​​​​​​以​​​​​​​格​​​​​​​式​​​​​​​ major:minor 参​​​​​​​考​​​​​​​。​​​​​​​
offset
该​​​​​​​设​​​​​​​备​​​​​​​中​​​​​​​映​​​​​​​射​​​​​​​的​​​​​​​起​​​​​​​始​​​​​​​误​​​​​​​差​​​​​​​
以​​​​​​​下​​​​​​​示​​​​​​​例​​​​​​​显​​​​​​​示​​​​​​​了​​​​​​​一​​​​​​​个​​​​​​​有​​​​​​​三​​​​​​​个​​​​​​​条​​​​​​​,且​​​​​​​组​​​​​​​集​​​​​​​大​​​​​​​小​​​​​​​为​​​​​​​ 128 的​​​​​​​条​​​​​​​状​​​​​​​对​​​​​​​象​​​​​​​:
0 73728 striped 3 128 8:9 384 8:8 384 8:7 9789824
0
虚​​​​​​​拟​​​​​​​设​​​​​​​备​​​​​​​中​​​​​​​的​​​​​​​起​​​​​​​始​​​​​​​块​​​​​​​
73728
这​​​​​​​个​​​​​​​片​​​​​​​段​​​​​​​的​​​​​​​长​​​​​​​度​​​​​​​
striped 3 128
三​​​​​​​个​​​​​​​设​​​​​​​备​​​​​​​中​​​​​​​组​​​​​​​集​​​​​​​大​​​​​​​小​​​​​​​为​​​​​​​ 128 块​​​​​​​的​​​​​​​条​​​​​​​
8:9
第​​​​​​​一​​​​​​​个​​​​​​​设​​​​​​​备​​​​​​​的​​​​​​​ major:minor 号​​​​​​​码​​​​​​​
384
第​​​​​​​一​​​​​​​个​​​​​​​设​​​​​​​备​​​​​​​中​​​​​​​映​​​​​​​射​​​​​​​的​​​​​​​起​​​​​​​始​​​​​​​误​​​​​​​差​​​​​​​
8:8
第​​​​​​​二​​​​​​​个​​​​​​​设​​​​​​​备​​​​​​​的​​​​​​​ major:minor 号​​​​​​​码​​​​​​​
384
第​​​​​​​二​​​​​​​个​​​​​​​设​​​​​​​备​​​​​​​中​​​​​​​映​​​​​​​射​​​​​​​的​​​​​​​起​​​​​​​始​​​​​​​误​​​​​​​差​​​​​​​
8:7
第​​​​​​​三​​​​​​​个​​​​​​​设​​​​​​​备​​​​​​​的​​​​​​​ major:minor 号​​​​​​​码​​​​​​​
9789824
第​​​​​​​三​​​​​​​个​​​​​​​设​​​​​​​备​​​​​​​中​​​​​​​映​​​​​​​射​​​​​​​的​​​​​​​起​​​​​​​始​​​​​​​误​​​​​​​差​​​​​​​
以​​​​​​​下​​​​​​​示​​​​​​​例​​​​​​​显​​​​​​​示​​​​​​​了​​​​​​​含​​​​​​​有​​​​​​​两​​​​​​​个​​​​​​​ 256KiB 条​​​​​​​,使​​​​​​​用​​​​​​​文​​​​​​​件​​​​​​​系​​​​​​​统​​​​​​​中​​​​​​​的​​​​​​​设​​​​​​​备​​​​​​​名​​​​​​​称​​​​​​​而​​​​​​​不​​​​​​​是​​​​​​​主​​​​​​​号​​​​​​​码​​​​​​​和​​​​​​​副​​​​​​​号​​​​​​​码​​​​​​​指​​​​​​​定​​​​​​​设​​​​​​​备​​​​​​​参​​​​​​​数​​​​​​​的​​​​​​​条​​​​​​​状​​​​​​​对​​​​​​​象​​​​​​​。​​​​​​​
0 65536 striped 2 512 /dev/hda 0 /dev/hdb 0

A.1.3. 镜​​​​​​​像​​​​​​​映​​​​​​​射​​​​​​​对​​​​​​​象​​​​​​​

镜​​​​​​​像​​​​​​​映​​​​​​​射​​​​​​​对​​​​​​​象​​​​​​​支​​​​​​​持​​​​​​​镜​​​​​​​像​​​​​​​的​​​​​​​逻​​​​​​​辑​​​​​​​设​​​​​​​备​​​​​​​。​​​​​​​镜​​​​​​​像​​​​​​​对​​​​​​​象​​​​​​​格​​​​​​​式​​​​​​​如​​​​​​​下​​​​​​​:
start length mirror log_type #logargs logarg1 ... logargN #devs device1 offset1 ... deviceN offsetN
start
虚​​​​​​​拟​​​​​​​设​​​​​​​备​​​​​​​中​​​​​​​的​​​​​​​起​​​​​​​始​​​​​​​块​​​​​​​
length
这​​​​​​​个​​​​​​​片​​​​​​​段​​​​​​​的​​​​​​​长​​​​​​​度​​​​​​​
log_type
可​​​​​​​能​​​​​​​的​​​​​​​日​​​​​​​志​​​​​​​类​​​​​​​型​​​​​​​及​​​​​​​其​​​​​​​参​​​​​​​数​​​​​​​如​​​​​​​下​​​​​​​:
core
镜​​​​​​​像​​​​​​​是​​​​​​​本​​​​​​​地​​​​​​​的​​​​​​​,镜​​​​​​​像​​​​​​​日​​​​​​​志​​​​​​​保​​​​​​​存​​​​​​​在​​​​​​​核​​​​​​​内​​​​​​​存​​​​​​​中​​​​​​​。​​​​​​​这​​​​​​​个​​​​​​​日​​​​​​​志​​​​​​​类​​​​​​​型​​​​​​​有​​​​​​​ 1-3 个​​​​​​​参​​​​​​​数​​​​​​​:
regionsize [[no]sync] [block_on_error]
disk
镜​​​​​​​像​​​​​​​是​​​​​​​本​​​​​​​地​​​​​​​的​​​​​​​,镜​​​​​​​像​​​​​​​日​​​​​​​志​​​​​​​保​​​​​​​存​​​​​​​在​​​​​​​磁​​​​​​​盘​​​​​​​中​​​​​​​。​​​​​​​这​​​​​​​个​​​​​​​日​​​​​​​志​​​​​​​类​​​​​​​型​​​​​​​有​​​​​​​ 2-4 个​​​​​​​参​​​​​​​数​​​​​​​:
logdevice regionsize [[no]sync] [block_on_error]
clustered_core
镜​​​​​​​像​​​​​​​是​​​​​​​群​​​​​​​集​​​​​​​的​​​​​​​,镜​​​​​​​像​​​​​​​日​​​​​​​志​​​​​​​保​​​​​​​存​​​​​​​在​​​​​​​核​​​​​​​内​​​​​​​存​​​​​​​中​​​​​​​。​​​​​​​这​​​​​​​个​​​​​​​日​​​​​​​志​​​​​​​类​​​​​​​型​​​​​​​有​​​​​​​ 2-4 个​​​​​​​参​​​​​​​数​​​​​​​:
regionsize UUID [[no]sync] [block_on_error]
clustered_disk
镜​​​​​​​像​​​​​​​是​​​​​​​群​​​​​​​集​​​​​​​的​​​​​​​,镜​​​​​​​像​​​​​​​日​​​​​​​志​​​​​​​保​​​​​​​存​​​​​​​在​​​​​​​磁​​​​​​​盘​​​​​​​中​​​​​​​。​​​​​​​这​​​​​​​个​​​​​​​日​​​​​​​志​​​​​​​类​​​​​​​型​​​​​​​有​​​​​​​ 3-5 个​​​​​​​参​​​​​​​数​​​​​​​:
logdevice regionsize UUID [[no]sync] [block_on_error]
LVM 保​​​​​​​存​​​​​​​一​​​​​​​个​​​​​​​小​​​​​​​日​​​​​​​志​​​​​​​用​​​​​​​来​​​​​​​跟​​​​​​​踪​​​​​​​与​​​​​​​该​​​​​​​镜​​​​​​​像​​​​​​​或​​​​​​​者​​​​​​​多​​​​​​​个​​​​​​​镜​​​​​​​像​​​​​​​同​​​​​​​步​​​​​​​的​​​​​​​区​​​​​​​域​​​​​​​。​​​​​​​regionsize 参​​​​​​​数​​​​​​​指​​​​​​​定​​​​​​​这​​​​​​​些​​​​​​​区​​​​​​​域​​​​​​​的​​​​​​​大​​​​​​​小​​​​​​​。​​​​​​​
在​​​​​​​群​​​​​​​集​​​​​​​环​​​​​​​境​​​​​​​中​​​​​​​,UUID 参​​​​​​​数​​​​​​​是​​​​​​​与​​​​​​​镜​​​​​​​像​​​​​​​日​​​​​​​志​​​​​​​设​​​​​​​备​​​​​​​关​​​​​​​联​​​​​​​的​​​​​​​特​​​​​​​定​​​​​​​识​​​​​​​别​​​​​​​符​​​​​​​,以​​​​​​​便​​​​​​​可​​​​​​​通​​​​​​​过​​​​​​​该​​​​​​​群​​​​​​​集​​​​​​​维​​​​​​​护​​​​​​​日​​​​​​​志​​​​​​​状​​​​​​​态​​​​​​​。​​​​​​​
The optional [no]sync argument can be used to specify the mirror as "in-sync" or "out-of-sync". The block_on_error argument is used to tell the mirror to respond to errors rather than ignoring them.
#log_args
将​​​​​​​在​​​​​​​映​​​​​​​射​​​​​​​中​​​​​​​指​​​​​​​定​​​​​​​的​​​​​​​日​​​​​​​志​​​​​​​参​​​​​​​数​​​​​​​数​​​​​​​目​​​​​​​
logargs
镜​​​​​​​像​​​​​​​的​​​​​​​日​​​​​​​志​​​​​​​参​​​​​​​数​​​​​​​;提​​​​​​​供​​​​​​​的​​​​​​​日​​​​​​​志​​​​​​​参​​​​​​​数​​​​​​​数​​​​​​​目​​​​​​​是​​​​​​​由​​​​​​​ #log-args 参​​​​​​​数​​​​​​​指​​​​​​​定​​​​​​​的​​​​​​​,且​​​​​​​有​​​​​​​效​​​​​​​日​​​​​​​志​​​​​​​参​​​​​​​数​​​​​​​由​​​​​​​ log_type 参​​​​​​​数​​​​​​​决​​​​​​​定​​​​​​​。​​​​​​​
#devs
镜​​​​​​​像​​​​​​​中​​​​​​​的​​​​​​​分​​​​​​​支​​​​​​​数​​​​​​​目​​​​​​​;为​​​​​​​每​​​​​​​个​​​​​​​分​​​​​​​支​​​​​​​指​​​​​​​定​​​​​​​一​​​​​​​个​​​​​​​设​​​​​​​备​​​​​​​和​​​​​​​一​​​​​​​个​​​​​​​误​​​​​​​差​​​​​​​。​​​​​​​
device
每​​​​​​​个​​​​​​​镜​​​​​​​像​​​​​​​分​​​​​​​支​​​​​​​的​​​​​​​块​​​​​​​设​​​​​​​备​​​​​​​,使​​​​​​​用​​​​​​​该​​​​​​​文​​​​​​​件​​​​​​​系​​​​​​​统​​​​​​​中​​​​​​​的​​​​​​​设​​​​​​​备​​​​​​​名​​​​​​​称​​​​​​​或​​​​​​​者​​​​​​​主​​​​​​​号​​​​​​​码​​​​​​​和​​​​​​​副​​​​​​​号​​​​​​​码​​​​​​​以​​​​​​​ major:minor 的​​​​​​​格​​​​​​​式​​​​​​​参​​​​​​​考​​​​​​​。​​​​​​​每​​​​​​​个​​​​​​​镜​​​​​​​像​​​​​​​分​​​​​​​支​​​​​​​都​​​​​​​有​​​​​​​一​​​​​​​个​​​​​​​块​​​​​​​设​​​​​​​备​​​​​​​和​​​​​​​误​​​​​​​差​​​​​​​,如​​​​​​​ #devs 参​​​​​​​数​​​​​​​中​​​​​​​所​​​​​​​示​​​​​​​。​​​​​​​
offset
设​​​​​​​备​​​​​​​中​​​​​​​映​​​​​​​射​​​​​​​的​​​​​​​起​​​​​​​始​​​​​​​误​​​​​​​差​​​​​​​。​​​​​​​每​​​​​​​个​​​​​​​镜​​​​​​​像​​​​​​​分​​​​​​​支​​​​​​​都​​​​​​​有​​​​​​​一​​​​​​​个​​​​​​​块​​​​​​​设​​​​​​​备​​​​​​​和​​​​​​​误​​​​​​​差​​​​​​​,如​​​​​​​ #devs 参​​​​​​​数​​​​​​​中​​​​​​​所​​​​​​​示​​​​​​​。​​​​​​​
以​​​​​​​下​​​​​​​示​​​​​​​例​​​​​​​显​​​​​​​示​​​​​​​了​​​​​​​某​​​​​​​个​​​​​​​镜​​​​​​​像​​​​​​​日​​​​​​​志​​​​​​​保​​​​​​​存​​​​​​​在​​​​​​​磁​​​​​​​盘​​​​​​​中​​​​​​​的​​​​​​​群​​​​​​​集​​​​​​​镜​​​​​​​像​​​​​​​的​​​​​​​镜​​​​​​​像​​​​​​​映​​​​​​​射​​​​​​​对​​​​​​​象​​​​​​​。​​​​​​​
0 52428800 mirror clustered_disk 4 253:2 1024 UUID block_on_error 3 253:3 0 253:4 0 253:5 0
0
虚​​​​​​​拟​​​​​​​设​​​​​​​备​​​​​​​中​​​​​​​的​​​​​​​起​​​​​​​始​​​​​​​块​​​​​​​
52428800
这​​​​​​​个​​​​​​​片​​​​​​​段​​​​​​​的​​​​​​​长​​​​​​​度​​​​​​​
mirror clustered_disk
日​​​​​​​志​​​​​​​类​​​​​​​型​​​​​​​指​​​​​​​定​​​​​​​其​​​​​​​为​​​​​​​群​​​​​​​集​​​​​​​镜​​​​​​​像​​​​​​​且​​​​​​​镜​​​​​​​像​​​​​​​日​​​​​​​志​​​​​​​保​​​​​​​存​​​​​​​在​​​​​​​磁​​​​​​​盘​​​​​​​中​​​​​​​的​​​​​​​镜​​​​​​​像​​​​​​​对​​​​​​​象​​​​​​​
4
附​​​​​​​带​​​​​​​ 4 个​​​​​​​镜​​​​​​​像​​​​​​​日​​​​​​​志​​​​​​​参​​​​​​​数​​​​​​​
253:2
日​​​​​​​志​​​​​​​设​​​​​​​备​​​​​​​的​​​​​​​ major:minor 号​​​​​​​码​​​​​​​
1024
镜​​​​​​​像​​​​​​​日​​​​​​​志​​​​​​​用​​​​​​​来​​​​​​​跟​​​​​​​踪​​​​​​​哪​​​​​​​些​​​​​​​进​​​​​​​行​​​​​​​同​​​​​​​步​​​​​​​的​​​​​​​区​​​​​​​域​​​​​​​大​​​​​​​小​​​​​​​
UUID
镜​​​​​​​像​​​​​​​日​​​​​​​志​​​​​​​的​​​​​​​ UUID,用​​​​​​​来​​​​​​​通​​​​​​​过​​​​​​​群​​​​​​​集​​​​​​​维​​​​​​​护​​​​​​​日​​​​​​​志​​​​​​​信​​​​​​​息​​​​​​​
block_on_error
镜​​​​​​​像​​​​​​​应​​​​​​​该​​​​​​​响​​​​​​​应​​​​​​​错​​​​​​​误​​​​​​​
3
镜​​​​​​​像​​​​​​​中​​​​​​​的​​​​​​​分​​​​​​​支​​​​​​​
253:3 0 253:4 0 253:5 0
构​​​​​​​成​​​​​​​镜​​​​​​​像​​​​​​​的​​​​​​​每​​​​​​​个​​​​​​​分​​​​​​​支​​​​​​​的​​​​​​​设​​​​​​​备​​​​​​​的​​​​​​​ major:minor 号​​​​​​​码​​​​​​​和​​​​​​​误​​​​​​​差​​​​​​​

A.1.4. 快​​​​​​​照​​​​​​​以​​​​​​​及​​​​​​​ snapshot-origin 映​​​​​​​射​​​​​​​对​​​​​​​象​​​​​​​

当​​​​​​​您​​​​​​​生​​​​​​​成​​​​​​​某​​​​​​​个​​​​​​​卷​​​​​​​的​​​​​​​第​​​​​​​一​​​​​​​个​​​​​​​ LVM 快​​​​​​​照​​​​​​​时​​​​​​​,要​​​​​​​使​​​​​​​用​​​​​​​四​​​​​​​个​​​​​​​设​​​​​​​备​​​​​​​映​​​​​​​射​​​​​​​器​​​​​​​设​​​​​​​备​​​​​​​:
  1. 包​​​​​​​含​​​​​​​源​​​​​​​卷​​​​​​​原​​​​​​​始​​​​​​​映​​​​​​​射​​​​​​​列​​​​​​​表​​​​​​​线​​​​​​​性​​​​​​​映​​​​​​​射​​​​​​​的​​​​​​​设​​​​​​​备​​​​​​​。​​​​​​​
  2. 作​​​​​​​为​​​​​​​源​​​​​​​卷​​​​​​​即​​​​​​​写​​​​​​​即​​​​​​​拷​​​​​​​(copy-on-write,COW)设​​​​​​​备​​​​​​​使​​​​​​​用​​​​​​​的​​​​​​​有​​​​​​​线​​​​​​​性​​​​​​​映​​​​​​​射​​​​​​​的​​​​​​​设​​​​​​​备​​​​​​​;每​​​​​​​次​​​​​​​写​​​​​​​入​​​​​​​时​​​​​​​,会​​​​​​​将​​​​​​​原​​​​​​​始​​​​​​​数​​​​​​​据​​​​​​​保​​​​​​​存​​​​​​​在​​​​​​​每​​​​​​​个​​​​​​​快​​​​​​​照​​​​​​​的​​​​​​​ COW 设​​​​​​​备​​​​​​​中​​​​​​​以​​​​​​​便​​​​​​​保​​​​​​​持​​​​​​​不​​​​​​​更​​​​​​​改​​​​​​​可​​​​​​​见​​​​​​​内​​​​​​​容​​​​​​​(直​​​​​​​到​​​​​​​ COW 设​​​​​​​备​​​​​​​写​​​​​​​满​​​​​​​为​​​​​​​止​​​​​​​)。​​​​​​​
  3. 带​​​​​​​快​​​​​​​照​​​​​​​映​​​​​​​射​​​​​​​合​​​​​​​并​​​​​​​ #1 和​​​​​​​ #2 的​​​​​​​设​​​​​​​备​​​​​​​,它​​​​​​​是​​​​​​​可​​​​​​​见​​​​​​​快​​​​​​​照​​​​​​​卷​​​​​​​
  4. The "original" volume (which uses the device number used by the original source volume), whose table is replaced by a "snapshot-origin" mapping from device #1.
用​​​​​​​来​​​​​​​创​​​​​​​建​​​​​​​这​​​​​​​些​​​​​​​设​​​​​​​备​​​​​​​的​​​​​​​固​​​​​​​定​​​​​​​命​​​​​​​名​​​​​​​方​​​​​​​案​​​​​​​,例​​​​​​​如​​​​​​​:您​​​​​​​可​​​​​​​以​​​​​​​使​​​​​​​用​​​​​​​以​​​​​​​下​​​​​​​命​​​​​​​令​​​​​​​生​​​​​​​成​​​​​​​名​​​​​​​为​​​​​​​ base 的​​​​​​​ LVM 卷​​​​​​​以​​​​​​​及​​​​​​​基​​​​​​​于​​​​​​​该​​​​​​​卷​​​​​​​的​​​​​​​名​​​​​​​为​​​​​​​ snap 快​​​​​​​照​​​​​​​卷​​​​​​​。​​​​​​​
# lvcreate -L 1G -n base volumeGroup
# lvcreate -L 100M --snapshot -n snap volumeGroup/base
这​​​​​​​产​​​​​​​生​​​​​​​四​​​​​​​个​​​​​​​设​​​​​​​备​​​​​​​,您​​​​​​​可​​​​​​​以​​​​​​​使​​​​​​​用​​​​​​​以​​​​​​​下​​​​​​​命​​​​​​​令​​​​​​​浏​​​​​​​览​​​​​​​:
# dmsetup table|grep volumeGroup
volumeGroup-base-real: 0 2097152 linear 8:19 384
volumeGroup-snap-cow: 0 204800 linear 8:19 2097536
volumeGroup-snap: 0 2097152 snapshot 254:11 254:12 P 16
volumeGroup-base: 0 2097152 snapshot-origin 254:11

# ls -lL /dev/mapper/volumeGroup-*
brw-------  1 root root 254, 11 29 ago 18:15 /dev/mapper/volumeGroup-base-real
brw-------  1 root root 254, 12 29 ago 18:15 /dev/mapper/volumeGroup-snap-cow
brw-------  1 root root 254, 13 29 ago 18:15 /dev/mapper/volumeGroup-snap
brw-------  1 root root 254, 10 29 ago 18:14 /dev/mapper/volumeGroup-base
snapshot-origin 对​​​​​​​象​​​​​​​的​​​​​​​格​​​​​​​式​​​​​​​如​​​​​​​下​​​​​​​:
start length snapshot-origin origin
start
虚​​​​​​​拟​​​​​​​设​​​​​​​备​​​​​​​中​​​​​​​的​​​​​​​起​​​​​​​始​​​​​​​块​​​​​​​
length
这​​​​​​​个​​​​​​​片​​​​​​​段​​​​​​​的​​​​​​​长​​​​​​​度​​​​​​​
origin
快​​​​​​​照​​​​​​​基​​​​​​​础​​​​​​​卷​​​​​​​
snapshot-origin 一​​​​​​​般​​​​​​​有​​​​​​​一​​​​​​​个​​​​​​​或​​​​​​​者​​​​​​​多​​​​​​​个​​​​​​​基​​​​​​​于​​​​​​​它​​​​​​​的​​​​​​​快​​​​​​​照​​​​​​​。​​​​​​​会​​​​​​​将​​​​​​​读​​​​​​​取​​​​​​​操​​​​​​​作​​​​​​​直​​​​​​​接​​​​​​​与​​​​​​​后​​​​​​​备​​​​​​​设​​​​​​​备​​​​​​​映​​​​​​​射​​​​​​​。​​​​​​​每​​​​​​​次​​​​​​​写​​​​​​​入​​​​​​​时​​​​​​​,会​​​​​​​将​​​​​​​原​​​​​​​始​​​​​​​数​​​​​​​据​​​​​​​保​​​​​​​存​​​​​​​在​​​​​​​每​​​​​​​个​​​​​​​快​​​​​​​照​​​​​​​的​​​​​​​ COW 设​​​​​​​备​​​​​​​中​​​​​​​以​​​​​​​便​​​​​​​保​​​​​​​持​​​​​​​其​​​​​​​不​​​​​​​更​​​​​​​改​​​​​​​的​​​​​​​可​​​​​​​见​​​​​​​内​​​​​​​容​​​​​​​(直​​​​​​​到​​​​​​​ COW 设​​​​​​​备​​​​​​​写​​​​​​​满​​​​​​​为​​​​​​​止​​​​​​​)。​​​​​​​
快​​​​​​​照​​​​​​​对​​​​​​​象​​​​​​​的​​​​​​​格​​​​​​​式​​​​​​​如​​​​​​​下​​​​​​​:
start length snapshot origin COW-device P|N chunksize
start
虚​​​​​​​拟​​​​​​​设​​​​​​​备​​​​​​​中​​​​​​​的​​​​​​​起​​​​​​​始​​​​​​​块​​​​​​​
length
这​​​​​​​个​​​​​​​片​​​​​​​段​​​​​​​的​​​​​​​长​​​​​​​度​​​​​​​
origin
快​​​​​​​照​​​​​​​基​​​​​​​础​​​​​​​卷​​​​​​​
COW-device
保​​​​​​​存​​​​​​​更​​​​​​​改​​​​​​​组​​​​​​​集​​​​​​​的​​​​​​​设​​​​​​​备​​​​​​​
P|N
P(持​​​​​​​久​​​​​​​)或​​​​​​​者​​​​​​​N(不​​​​​​​持​​​​​​​久​​​​​​​);指​​​​​​​示​​​​​​​快​​​​​​​照​​​​​​​是​​​​​​​否​​​​​​​可​​​​​​​在​​​​​​​重​​​​​​​启​​​​​​​后​​​​​​​保​​​​​​​留​​​​​​​。​​​​​​​对​​​​​​​于​​​​​​​瞬​​​​​​​时​​​​​​​快​​​​​​​照​​​​​​​(N)必​​​​​​​须​​​​​​​将​​​​​​​ less metadata 保​​​​​​​存​​​​​​​在​​​​​​​磁​​​​​​​盘​​​​​​​中​​​​​​​;内​​​​​​​核​​​​​​​可​​​​​​​将​​​​​​​其​​​​​​​保​​​​​​​存​​​​​​​在​​​​​​​内​​​​​​​存​​​​​​​中​​​​​​​。​​​​​​​
chunksize
将​​​​​​​保​​​​​​​存​​​​​​​到​​​​​​​ COW 设​​​​​​​备​​​​​​​中​​​​​​​的​​​​​​​有​​​​​​​数​​​​​​​据​​​​​​​更​​​​​​​改​​​​​​​的​​​​​​​组​​​​​​​集​​​​​​​的​​​​​​​扇​​​​​​​区​​​​​​​的​​​​​​​大​​​​​​​小​​​​​​​
以​​​​​​​下​​​​​​​示​​​​​​​例​​​​​​​显​​​​​​​示​​​​​​​了​​​​​​​起​​​​​​​始​​​​​​​设​​​​​​​备​​​​​​​为​​​​​​​ 254:11 的​​​​​​​ snapshot-origin 对​​​​​​​象​​​​​​​。​​​​​​​
0 2097152 snapshot-origin 254:11
以​​​​​​​下​​​​​​​示​​​​​​​例​​​​​​​显​​​​​​​示​​​​​​​了​​​​​​​起​​​​​​​始​​​​​​​设​​​​​​​备​​​​​​​为​​​​​​​ 254:11、​​​​​​​COW 设​​​​​​​备​​​​​​​为​​​​​​​ 254:12 的​​​​​​​ snapshot-origin 对​​​​​​​象​​​​​​​。​​​​​​​这​​​​​​​个​​​​​​​快​​​​​​​照​​​​​​​设​​​​​​​备​​​​​​​在​​​​​​​重​​​​​​​启​​​​​​​后​​​​​​​仍​​​​​​​然​​​​​​​保​​​​​​​留​​​​​​​,且​​​​​​​保​​​​​​​存​​​​​​​在​​​​​​​ COW 设​​​​​​​备​​​​​​​中​​​​​​​的​​​​​​​数​​​​​​​据​​​​​​​组​​​​​​​集​​​​​​​大​​​​​​​小​​​​​​​为​​​​​​​ 16 个​​​​​​​扇​​​​​​​区​​​​​​​。​​​​​​​
0 2097152 snapshot 254:11 254:12 P 16

A.1.5. 错​​​​​​​误​​​​​​​映​​​​​​​射​​​​​​​对​​​​​​​象​​​​​​​

如​​​​​​​果​​​​​​​有​​​​​​​错​​​​​​​误​​​​​​​映​​​​​​​射​​​​​​​对​​​​​​​象​​​​​​​,任​​​​​​​何​​​​​​​对​​​​​​​映​​​​​​​射​​​​​​​的​​​​​​​扇​​​​​​​区​​​​​​​的​​​​​​​ I/O 操​​​​​​​作​​​​​​​会​​​​​​​失​​​​​​​败​​​​​​​。​​​​​​​
错​​​​​​​误​​​​​​​映​​​​​​​射​​​​​​​可​​​​​​​用​​​​​​​来​​​​​​​进​​​​​​​行​​​​​​​测​​​​​​​试​​​​​​​。​​​​​​​要​​​​​​​测​​​​​​​试​​​​​​​某​​​​​​​个​​​​​​​设​​​​​​​备​​​​​​​在​​​​​​​失​​​​​​​败​​​​​​​后​​​​​​​如​​​​​​​何​​​​​​​动​​​​​​​作​​​​​​​,您​​​​​​​可​​​​​​​以​​​​​​​创​​​​​​​建​​​​​​​一​​​​​​​个​​​​​​​设​​​​​​​备​​​​​​​映​​​​​​​射​​​​​​​,且​​​​​​​在​​​​​​​该​​​​​​​设​​​​​​​备​​​​​​​中​​​​​​​部​​​​​​​有​​​​​​​一​​​​​​​个​​​​​​​坏​​​​​​​扇​​​​​​​区​​​​​​​,或​​​​​​​者​​​​​​​您​​​​​​​可​​​​​​​以​​​​​​​换​​​​​​​出​​​​​​​一​​​​​​​个​​​​​​​镜​​​​​​​像​​​​​​​分​​​​​​​支​​​​​​​并​​​​​​​用​​​​​​​错​​​​​​​误​​​​​​​对​​​​​​​象​​​​​​​替​​​​​​​换​​​​​​​之​​​​​​​。​​​​​​​
错​​​​​​​误​​​​​​​对​​​​​​​象​​​​​​​可​​​​​​​用​​​​​​​于​​​​​​​出​​​​​​​错​​​​​​​的​​​​​​​设​​​​​​​备​​​​​​​,是​​​​​​​一​​​​​​​种​​​​​​​避​​​​​​​免​​​​​​​超​​​​​​​时​​​​​​​或​​​​​​​者​​​​​​​在​​​​​​​实​​​​​​​际​​​​​​​设​​​​​​​备​​​​​​​中​​​​​​​重​​​​​​​试​​​​​​​的​​​​​​​方​​​​​​​法​​​​​​​。​​​​​​​您​​​​​​​在​​​​​​​失​​​​​​​败​​​​​​​时​​​​​​​重​​​​​​​新​​​​​​​部​​​​​​​署​​​​​​​ LVM 元​​​​​​​数​​​​​​​据​​​​​​​时​​​​​​​可​​​​​​​将​​​​​​​其​​​​​​​作​​​​​​​为​​​​​​​中​​​​​​​间​​​​​​​对​​​​​​​象​​​​​​​使​​​​​​​用​​​​​​​。​​​​​​​
错​​​​​​​误​​​​​​​映​​​​​​​射​​​​​​​对​​​​​​​象​​​​​​​除​​​​​​​ start 和​​​​​​​ length 参​​​​​​​数​​​​​​​外​​​​​​​不​​​​​​​使​​​​​​​用​​​​​​​其​​​​​​​它​​​​​​​参​​​​​​​数​​​​​​​。​​​​​​​
以​​​​​​​下​​​​​​​示​​​​​​​例​​​​​​​显​​​​​​​示​​​​​​​的​​​​​​​是​​​​​​​错​​​​​​​误​​​​​​​对​​​​​​​象​​​​​​​。​​​​​​​
0 65536 error

A.1.6. 零​​​​​​​映​​​​​​​射​​​​​​​对​​​​​​​象​​​​​​​

零​​​​​​​映​​​​​​​射​​​​​​​对​​​​​​​象​​​​​​​是​​​​​​​与​​​​​​​ /dev/zero 等​​​​​​​同​​​​​​​的​​​​​​​块​​​​​​​设​​​​​​​备​​​​​​​。​​​​​​​对​​​​​​​这​​​​​​​个​​​​​​​映​​​​​​​射​​​​​​​的​​​​​​​读​​​​​​​取​​​​​​​操​​​​​​​作​​​​​​​会​​​​​​​返​​​​​​​回​​​​​​​零​​​​​​​块​​​​​​​。​​​​​​​写​​​​​​​入​​​​​​​这​​​​​​​个​​​​​​​映​​​​​​​射​​​​​​​的​​​​​​​数​​​​​​​据​​​​​​​会​​​​​​​被​​​​​​​丢​​​​​​​弃​​​​​​​,但​​​​​​​写​​​​​​​入​​​​​​​操​​​​​​​作​​​​​​​会​​​​​​​成​​​​​​​功​​​​​​​。​​​​​​​零​​​​​​​映​​​​​​​射​​​​​​​对​​​​​​​象​​​​​​​除​​​​​​​ start 和​​​​​​​ length 参​​​​​​​数​​​​​​​外​​​​​​​没​​​​​​​有​​​​​​​其​​​​​​​它​​​​​​​参​​​​​​​数​​​​​​​。​​​​​​​
以​​​​​​​下​​​​​​​示​​​​​​​例​​​​​​​显​​​​​​​示​​​​​​​了​​​​​​​一​​​​​​​个​​​​​​​ 16Tb 设​​​​​​​备​​​​​​​的​​​​​​​零​​​​​​​对​​​​​​​象​​​​​​​。​​​​​​​
0 65536 zero

A.1.7. 多​​​​​​​路​​​​​​​径​​​​​​​映​​​​​​​射​​​​​​​对​​​​​​​象​​​​​​​

多​​​​​​​路​​​​​​​径​​​​​​​映​​​​​​​射​​​​​​​对​​​​​​​象​​​​​​​支​​​​​​​持​​​​​​​多​​​​​​​路​​​​​​​径​​​​​​​的​​​​​​​设​​​​​​​备​​​​​​​的​​​​​​​映​​​​​​​射​​​​​​​。​​​​​​​多​​​​​​​路​​​​​​​径​​​​​​​对​​​​​​​象​​​​​​​的​​​​​​​格​​​​​​​式​​​​​​​如​​​​​​​下​​​​​​​:
start length  multipath  #features [feature1 ... featureN] #handlerargs [handlerarg1 ... handlerargN] #pathgroups pathgroup pathgroupargs1 ... pathgroupargsN
每​​​​​​​个​​​​​​​路​​​​​​​径​​​​​​​组​​​​​​​群​​​​​​​都​​​​​​​有​​​​​​​一​​​​​​​组​​​​​​​ pathgroupargs 参​​​​​​​数​​​​​​​。​​​​​​​
start
虚​​​​​​​拟​​​​​​​设​​​​​​​备​​​​​​​中​​​​​​​的​​​​​​​起​​​​​​​始​​​​​​​块​​​​​​​
length
这​​​​​​​个​​​​​​​片​​​​​​​段​​​​​​​的​​​​​​​长​​​​​​​度​​​​​​​
#features
在​​​​​​​那​​​​​​​些​​​​​​​特​​​​​​​性​​​​​​​之​​​​​​​后​​​​​​​是​​​​​​​多​​​​​​​路​​​​​​​径​​​​​​​特​​​​​​​性​​​​​​​的​​​​​​​数​​​​​​​目​​​​​​​。​​​​​​​如​​​​​​​果​​​​​​​这​​​​​​​个​​​​​​​参​​​​​​​数​​​​​​​是​​​​​​​ 0,则​​​​​​​没​​​​​​​有​​​​​​​ feature 参​​​​​​​数​​​​​​​,且​​​​​​​下​​​​​​​一​​​​​​​个​​​​​​​设​​​​​​​备​​​​​​​映​​​​​​​射​​​​​​​参​​​​​​​数​​​​​​​为​​​​​​​ #handlerargs。​​​​​​​目​​​​​​​前​​​​​​​有​​​​​​​一​​​​​​​个​​​​​​​支​​​​​​​持​​​​​​​的​​​​​​​多​​​​​​​路​​​​​​​径​​​​​​​特​​​​​​​性​​​​​​​ queue_if_no_path。​​​​​​​这​​​​​​​说​​​​​​​明​​​​​​​如​​​​​​​果​​​​​​​没​​​​​​​有​​​​​​​路​​​​​​​径​​​​​​​可​​​​​​​用​​​​​​​,则​​​​​​​将​​​​​​​这​​​​​​​个​​​​​​​多​​​​​​​路​​​​​​​径​​​​​​​的​​​​​​​设​​​​​​​备​​​​​​​设​​​​​​​定​​​​​​​为​​​​​​​队​​​​​​​列​​​​​​​ I/O。​​​​​​​
例​​​​​​​如​​​​​​​:如​​​​​​​果​​​​​​​只​​​​​​​在​​​​​​​尝​​​​​​​试​​​​​​​使​​​​​​​用​​​​​​​所​​​​​​​有​​​​​​​路​​​​​​​径​​​​​​​后​​​​​​​将​​​​​​​其​​​​​​​标​​​​​​​记​​​​​​​为​​​​​​​失​​​​​​​败​​​​​​​时​​​​​​​从​​​​​​​才​​​​​​​将​​​​​​​ multipath.conf 文​​​​​​​件​​​​​​​的​​​​​​​ no_path_retry 选​​​​​​​项​​​​​​​设​​​​​​​定​​​​​​​为​​​​​​​只​​​​​​​有​​​​​​​ I/O 操​​​​​​​作​​​​​​​的​​​​​​​队​​​​​​​列​​​​​​​,该​​​​​​​映​​​​​​​射​​​​​​​应​​​​​​​显​​​​​​​示​​​​​​​如​​​​​​​下​​​​​​​除​​​​​​​非​​​​​​​所​​​​​​​有​​​​​​​路​​​​​​​径​​​​​​​检​​​​​​​查​​​​​​​程​​​​​​​序​​​​​​​进​​​​​​​行​​​​​​​的​​​​​​​指​​​​​​​定​​​​​​​检​​​​​​​查​​​​​​​次​​​​​​​数​​​​​​​都​​​​​​​是​​​​​​​失​​​​​​​败​​​​​​​的​​​​​​​。​​​​​​​
0 71014400 multipath 1 queue_if_no_path 0 2 1 round-robin 0 2 1 66:128 \
1000 65:64 1000 round-robin 0 2 1 8:0 1000 67:192 1000
在​​​​​​​所​​​​​​​有​​​​​​​路​​​​​​​径​​​​​​​检​​​​​​​查​​​​​​​程​​​​​​​序​​​​​​​完​​​​​​​成​​​​​​​指​​​​​​​定​​​​​​​数​​​​​​​目​​​​​​​的​​​​​​​检​​​​​​​查​​​​​​​并​​​​​​​失​​​​​​​败​​​​​​​后​​​​​​​,会​​​​​​​出​​​​​​​现​​​​​​​如​​​​​​​下​​​​​​​映​​​​​​​射​​​​​​​。​​​​​​​
0 71014400 multipath 0 0 2 1 round-robin 0 2 1 66:128 1000 65:64 1000 \
round-robin 0 2 1 8:0 1000 67:192 1000
#handlerargs
那​​​​​​​些​​​​​​​参​​​​​​​数​​​​​​​后​​​​​​​是​​​​​​​硬​​​​​​​件​​​​​​​处​​​​​​​理​​​​​​​器​​​​​​​参​​​​​​​数​​​​​​​的​​​​​​​数​​​​​​​目​​​​​​​。​​​​​​​硬​​​​​​​件​​​​​​​处​​​​​​​理​​​​​​​器​​​​​​​指​​​​​​​定​​​​​​​在​​​​​​​切​​​​​​​换​​​​​​​路​​​​​​​径​​​​​​​组​​​​​​​或​​​​​​​者​​​​​​​处​​​​​​​理​​​​​​​ I/O 错​​​​​​​误​​​​​​​时​​​​​​​用​​​​​​​来​​​​​​​执​​​​​​​行​​​​​​​硬​​​​​​​件​​​​​​​特​​​​​​​定​​​​​​​的​​​​​​​动​​​​​​​作​​​​​​​。​​​​​​​如​​​​​​​果​​​​​​​将​​​​​​​其​​​​​​​设​​​​​​​定​​​​​​​为​​​​​​​ 0,那​​​​​​​么​​​​​​​下​​​​​​​一​​​​​​​个​​​​​​​参​​​​​​​数​​​​​​​则​​​​​​​为​​​​​​​ #pathgroups。​​​​​​​
#pathgroups
路​​​​​​​径​​​​​​​组​​​​​​​的​​​​​​​数​​​​​​​目​​​​​​​。​​​​​​​一​​​​​​​个​​​​​​​路​​​​​​​径​​​​​​​组​​​​​​​是​​​​​​​一​​​​​​​组​​​​​​​多​​​​​​​路​​​​​​​径​​​​​​​的​​​​​​​设​​​​​​​备​​​​​​​进​​​​​​​行​​​​​​​负​​​​​​​载​​​​​​​平​​​​​​​衡​​​​​​​的​​​​​​​路​​​​​​​径​​​​​​​。​​​​​​​每​​​​​​​个​​​​​​​路​​​​​​​径​​​​​​​组​​​​​​​都​​​​​​​有​​​​​​​一​​​​​​​组​​​​​​​ pathgroupargs 参​​​​​​​数​​​​​​​。​​​​​​​
pathgroup
下​​​​​​​一​​​​​​​个​​​​​​​要​​​​​​​尝​​​​​​​试​​​​​​​的​​​​​​​路​​​​​​​径​​​​​​​组​​​​​​​。​​​​​​​
pathgroupsargs
每​​​​​​​个​​​​​​​路​​​​​​​径​​​​​​​组​​​​​​​包​​​​​​​括​​​​​​​以​​​​​​​下​​​​​​​参​​​​​​​数​​​​​​​:
pathselector #selectorargs #paths #pathargs device1 ioreqs1 ... deviceN ioreqsN 
路​​​​​​​径​​​​​​​组​​​​​​​中​​​​​​​的​​​​​​​每​​​​​​​个​​​​​​​路​​​​​​​径​​​​​​​都​​​​​​​有​​​​​​​一​​​​​​​组​​​​​​​路​​​​​​​径​​​​​​​参​​​​​​​数​​​​​​​。​​​​​​​
pathselector
指​​​​​​​定​​​​​​​用​​​​​​​来​​​​​​​决​​​​​​​定​​​​​​​使​​​​​​​用​​​​​​​这​​​​​​​个​​​​​​​路​​​​​​​径​​​​​​​组​​​​​​​中​​​​​​​的​​​​​​​哪​​​​​​​个​​​​​​​路​​​​​​​径​​​​​​​进​​​​​​​行​​​​​​​下​​​​​​​一​​​​​​​个​​​​​​​ I/O 操​​​​​​​作​​​​​​​的​​​​​​​算​​​​​​​法​​​​​​​。​​​​​​​
#selectorargs
在​​​​​​​多​​​​​​​路​​​​​​​径​​​​​​​映​​​​​​​射​​​​​​​中​​​​​​​这​​​​​​​个​​​​​​​参​​​​​​​数​​​​​​​后​​​​​​​的​​​​​​​路​​​​​​​径​​​​​​​选​​​​​​​择​​​​​​​程​​​​​​​序​​​​​​​参​​​​​​​数​​​​​​​的​​​​​​​数​​​​​​​目​​​​​​​。​​​​​​​目​​​​​​​前​​​​​​​,这​​​​​​​个​​​​​​​参​​​​​​​数​​​​​​​的​​​​​​​值​​​​​​​总​​​​​​​是​​​​​​​ 0。​​​​​​​
#paths
这​​​​​​​个​​​​​​​路​​​​​​​径​​​​​​​组​​​​​​​中​​​​​​​的​​​​​​​路​​​​​​​径​​​​​​​数​​​​​​​目​​​​​​​。​​​​​​​
#pathargs
在​​​​​​​这​​​​​​​个​​​​​​​组​​​​​​​群​​​​​​​中​​​​​​​为​​​​​​​每​​​​​​​个​​​​​​​路​​​​​​​径​​​​​​​指​​​​​​​定​​​​​​​的​​​​​​​路​​​​​​​径​​​​​​​参​​​​​​​数​​​​​​​数​​​​​​​目​​​​​​​。​​​​​​​目​​​​​​​前​​​​​​​,这​​​​​​​个​​​​​​​数​​​​​​​值​​​​​​​总​​​​​​​是​​​​​​​ 1,即​​​​​​​ ioreqs 参​​​​​​​数​​​​​​​。​​​​​​​
device
该​​​​​​​路​​​​​​​径​​​​​​​的​​​​​​​块​​​​​​​设​​​​​​​备​​​​​​​,使​​​​​​​用​​​​​​​主​​​​​​​号​​​​​​​码​​​​​​​和​​​​​​​副​​​​​​​号​​​​​​​码​​​​​​​以​​​​​​​ major:minor 格​​​​​​​式​​​​​​​参​​​​​​​考​​​​​​​
ioreqs
切​​​​​​​换​​​​​​​到​​​​​​​当​​​​​​​前​​​​​​​组​​​​​​​群​​​​​​​的​​​​​​​下​​​​​​​一​​​​​​​个​​​​​​​路​​​​​​​径​​​​​​​前​​​​​​​路​​​​​​​由​​​​​​​到​​​​​​​这​​​​​​​个​​​​​​​路​​​​​​​径​​​​​​​的​​​​​​​ I/O 请​​​​​​​求​​​​​​​数​​​​​​​目​​​​​​​。​​​​​​​
多​​​​​​​路​​​​​​​径​​​​​​​映​​​​​​​射​​​​​​​对​​​​​​​象​​​​​​​

图 A.1. 多​​​​​​​路​​​​​​​径​​​​​​​映​​​​​​​射​​​​​​​对​​​​​​​象​​​​​​​

以​​​​​​​下​​​​​​​示​​​​​​​例​​​​​​​显​​​​​​​示​​​​​​​对​​​​​​​同​​​​​​​一​​​​​​​个​​​​​​​多​​​​​​​路​​​​​​​径​​​​​​​设​​​​​​​备​​​​​​​的​​​​​​​一​​​​​​​个​​​​​​​纯​​​​​​​故​​​​​​​障​​​​​​​排​​​​​​​除​​​​​​​对​​​​​​​象​​​​​​​定​​​​​​​义​​​​​​​。​​​​​​​在​​​​​​​这​​​​​​​个​​​​​​​对​​​​​​​象​​​​​​​中​​​​​​​有​​​​​​​四​​​​​​​个​​​​​​​路​​​​​​​径​​​​​​​组​​​​​​​,其​​​​​​​中​​​​​​​每​​​​​​​个​​​​​​​路​​​​​​​径​​​​​​​组​​​​​​​只​​​​​​​有​​​​​​​一​​​​​​​个​​​​​​​路​​​​​​​径​​​​​​​,以​​​​​​​便​​​​​​​多​​​​​​​路​​​​​​​径​​​​​​​的​​​​​​​设​​​​​​​备​​​​​​​每​​​​​​​次​​​​​​​只​​​​​​​能​​​​​​​使​​​​​​​用​​​​​​​一​​​​​​​个​​​​​​​路​​​​​​​径​​​​​​​。​​​​​​​
0 71014400 multipath 0 0 4 1 round-robin 0 1 1 66:112 1000 \
round-robin 0 1 1 67:176 1000 round-robin 0 1 1 68:240 1000 \
round-robin 0 1 1 65:48 1000
以​​​​​​​下​​​​​​​示​​​​​​​例​​​​​​​显​​​​​​​示​​​​​​​为​​​​​​​同​​​​​​​一​​​​​​​个​​​​​​​多​​​​​​​路​​​​​​​径​​​​​​​设​​​​​​​备​​​​​​​完​​​​​​​全​​​​​​​展​​​​​​​开​​​​​​​(多​​​​​​​总​​​​​​​线​​​​​​​)对​​​​​​​象​​​​​​​定​​​​​​​义​​​​​​​。​​​​​​​在​​​​​​​这​​​​​​​个​​​​​​​对​​​​​​​象​​​​​​​中​​​​​​​只​​​​​​​有​​​​​​​一​​​​​​​个​​​​​​​路​​​​​​​径​​​​​​​组​​​​​​​,其​​​​​​​中​​​​​​​包​​​​​​​含​​​​​​​所​​​​​​​有​​​​​​​路​​​​​​​径​​​​​​​。​​​​​​​在​​​​​​​这​​​​​​​个​​​​​​​设​​​​​​​定​​​​​​​中​​​​​​​,多​​​​​​​路​​​​​​​径​​​​​​​将​​​​​​​所​​​​​​​有​​​​​​​负​​​​​​​载​​​​​​​平​​​​​​​均​​​​​​​分​​​​​​​配​​​​​​​到​​​​​​​所​​​​​​​有​​​​​​​路​​​​​​​径​​​​​​​中​​​​​​​。​​​​​​​
0 71014400 multipath 0 0 1 1 round-robin 0 4 1 66:112 1000 \
 67:176 1000 68:240 1000 65:48 1000
有​​​​​​​关​​​​​​​多​​​​​​​路​​​​​​​径​​​​​​​的​​​​​​​详​​​​​​​情​​​​​​​请​​​​​​​参​​​​​​​考​​​​​​​《​​​​​​​使​​​​​​​用​​​​​​​设​​​​​​​备​​​​​​​映​​​​​​​射​​​​​​​器​​​​​​​多​​​​​​​路​​​​​​​径​​​​​​​》​​​​​​​文​​​​​​​档​​​​​​​。​​​​​​​

A.1.8. 加​​​​​​​密​​​​​​​映​​​​​​​射​​​​​​​对​​​​​​​象​​​​​​​

加​​​​​​​密​​​​​​​对​​​​​​​象​​​​​​​会​​​​​​​加​​​​​​​密​​​​​​​通​​​​​​​过​​​​​​​指​​​​​​​定​​​​​​​设​​​​​​​备​​​​​​​的​​​​​​​所​​​​​​​有​​​​​​​数​​​​​​​据​​​​​​​。​​​​​​​它​​​​​​​使​​​​​​​用​​​​​​​内​​​​​​​核​​​​​​​ Crypto API。​​​​​​​
加​​​​​​​密​​​​​​​对​​​​​​​象​​​​​​​的​​​​​​​格​​​​​​​式​​​​​​​如​​​​​​​下​​​​​​​:
start length crypt cipher key IV-offset device offset
start
虚​​​​​​​拟​​​​​​​设​​​​​​​备​​​​​​​中​​​​​​​的​​​​​​​起​​​​​​​始​​​​​​​块​​​​​​​
length
这​​​​​​​个​​​​​​​片​​​​​​​段​​​​​​​的​​​​​​​长​​​​​​​度​​​​​​​
cipher
Cipher 包​​​​​​​含​​​​​​​ cipher[-chainmode]-ivmode[:iv options]。​​​​​​​
cipher
可​​​​​​​用​​​​​​​密​​​​​​​码​​​​​​​位​​​​​​​于​​​​​​​ /proc/crypto(例​​​​​​​如​​​​​​​:aes)。​​​​​​​
chainmode
总​​​​​​​是​​​​​​​使​​​​​​​用​​​​​​​ cbc。​​​​​​​不​​​​​​​要​​​​​​​使​​​​​​​用​​​​​​​ ebc,它​​​​​​​不​​​​​​​使​​​​​​​用​​​​​​​初​​​​​​​始​​​​​​​向​​​​​​​量​​​​​​​(IV)。​​​​​​​
ivmode[:iv options]
IV 是​​​​​​​一​​​​​​​个​​​​​​​用​​​​​​​来​​​​​​​区​​​​​​​分​​​​​​​加​​​​​​​密​​​​​​​法​​​​​​​的​​​​​​​初​​​​​​​始​​​​​​​向​​​​​​​量​​​​​​​。​​​​​​​IV 模​​​​​​​式​​​​​​​是​​​​​​​ plain或​​​​​​​者​​​​​​​ essiv:hash。​​​​​​​-plain 的​​​​​​​ ivmode 使​​​​​​​用​​​​​​​扇​​​​​​​区​​​​​​​号​​​​​​​码​​​​​​​(加​​​​​​​ IV 误​​​​​​​差​​​​​​​)作​​​​​​​为​​​​​​​ IV。​​​​​​​-essiv 的​​​​​​​ ivmode 是​​​​​​​一​​​​​​​个​​​​​​​改​​​​​​​进​​​​​​​,可​​​​​​​避​​​​​​​免​​​​​​​水​​​​​​​印​​​​​​​弱​​​​​​​点​​​​​​​
key
加​​​​​​​密​​​​​​​密​​​​​​​钥​​​​​​​,在​​​​​​​ hex 中​​​​​​​提​​​​​​​供​​​​​​​
IV-offset
初​​​​​​​始​​​​​​​向​​​​​​​量​​​​​​​(IV)误​​​​​​​差​​​​​​​
device
块​​​​​​​设​​​​​​​备​​​​​​​,被​​​​​​​该​​​​​​​文​​​​​​​件​​​​​​​系​​​​​​​统​​​​​​​中​​​​​​​的​​​​​​​设​​​​​​​备​​​​​​​名​​​​​​​称​​​​​​​或​​​​​​​者​​​​​​​主​​​​​​​号​​​​​​​码​​​​​​​和​​​​​​​副​​​​​​​号​​​​​​​码​​​​​​​以​​​​​​​ major:minor 的​​​​​​​格​​​​​​​式​​​​​​​参​​​​​​​考​​​​​​​
offset
该​​​​​​​设​​​​​​​备​​​​​​​中​​​​​​​映​​​​​​​射​​​​​​​的​​​​​​​起​​​​​​​始​​​​​​​误​​​​​​​差​​​​​​​
以​​​​​​​下​​​​​​​是​​​​​​​加​​​​​​​密​​​​​​​对​​​​​​​象​​​​​​​示​​​​​​​例​​​​​​​。​​​​​​​
0 2097152 crypt aes-plain 0123456789abcdef0123456789abcdef 0 /dev/hda 0

A.2. dmsetup 命​​​​​​​令​​​​​​​

dmsetup 命​​​​​​​令​​​​​​​是​​​​​​​一​​​​​​​个​​​​​​​用​​​​​​​来​​​​​​​与​​​​​​​设​​​​​​​备​​​​​​​映​​​​​​​射​​​​​​​器​​​​​​​沟​​​​​​​通​​​​​​​的​​​​​​​命​​​​​​​令​​​​​​​行​​​​​​​封​​​​​​​装​​​​​​​器​​​​​​​(wrapper)。​​​​​​​对​​​​​​​于​​​​​​​ LVM 设​​​​​​​备​​​​​​​的​​​​​​​一​​​​​​​般​​​​​​​系​​​​​​​统​​​​​​​信​​​​​​​息​​​​​​​,您​​​​​​​可​​​​​​​发​​​​​​​现​​​​​​​ dmsetup 命​​​​​​​令​​​​​​​的​​​​​​​ info、​​​​​​​ls、​​​​​​​status 和​​​​​​​ deps 选​​​​​​​项​​​​​​​是​​​​​​​有​​​​​​​用​​​​​​​的​​​​​​​,如​​​​​​​以​​​​​​​下​​​​​​​部​​​​​​​分​​​​​​​所​​​​​​​述​​​​​​​。​​​​​​​
有​​​​​​​关​​​​​​​ dmsetup 命​​​​​​​令​​​​​​​的​​​​​​​额​​​​​​​外​​​​​​​选​​​​​​​项​​​​​​​和​​​​​​​功​​​​​​​能​​​​​​​,请​​​​​​​参​​​​​​​考​​​​​​​ dmsetup(8) man page。​​​​​​​

A.2.1. dmsetup info 命​​​​​​​令​​​​​​​

dmsetup info device 命​​​​​​​令​​​​​​​提​​​​​​​供​​​​​​​有​​​​​​​关​​​​​​​设​​​​​​​备​​​​​​​映​​​​​​​射​​​​​​​器​​​​​​​设​​​​​​​备​​​​​​​概​​​​​​​述​​​​​​​。​​​​​​​如​​​​​​​果​​​​​​​您​​​​​​​没​​​​​​​有​​​​​​​指​​​​​​​定​​​​​​​设​​​​​​​备​​​​​​​名​​​​​​​称​​​​​​​,则​​​​​​​输​​​​​​​出​​​​​​​所​​​​​​​余​​​​​​​目​​​​​​​前​​​​​​​配​​​​​​​置​​​​​​​的​​​​​​​设​​​​​​​备​​​​​​​映​​​​​​​射​​​​​​​器​​​​​​​设​​​​​​​备​​​​​​​信​​​​​​​息​​​​​​​。​​​​​​​如​​​​​​​果​​​​​​​您​​​​​​​指​​​​​​​定​​​​​​​了​​​​​​​一​​​​​​​个​​​​​​​设​​​​​​​备​​​​​​​,那​​​​​​​么​​​​​​​这​​​​​​​个​​​​​​​命​​​​​​​令​​​​​​​只​​​​​​​会​​​​​​​生​​​​​​​成​​​​​​​那​​​​​​​个​​​​​​​设​​​​​​​备​​​​​​​的​​​​​​​信​​​​​​​息​​​​​​​。​​​​​​​
dmsetup info 命​​​​​​​令​​​​​​​提​​​​​​​供​​​​​​​以​​​​​​​下​​​​​​​分​​​​​​​类​​​​​​​中​​​​​​​的​​​​​​​信​​​​​​​息​​​​​​​:
Name
该​​​​​​​设​​​​​​​备​​​​​​​的​​​​​​​名​​​​​​​称​​​​​​​。​​​​​​​使​​​​​​​用​​​​​​​以​​​​​​​连​​​​​​​字​​​​​​​符​​​​​​​分​​​​​​​开​​​​​​​的​​​​​​​卷​​​​​​​组​​​​​​​名​​​​​​​称​​​​​​​和​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​名​​​​​​​称​​​​​​​表​​​​​​​示​​​​​​​ LVM 设​​​​​​​备​​​​​​​。​​​​​​​会​​​​​​​将​​​​​​​原​​​​​​​始​​​​​​​名​​​​​​​称​​​​​​​中​​​​​​​的​​​​​​​连​​​​​​​字​​​​​​​符​​​​​​​转​​​​​​​换​​​​​​​成​​​​​​​两​​​​​​​个​​​​​​​连​​​​​​​字​​​​​​​符​​​​​​​。​​​​​​​
State
可​​​​​​​能​​​​​​​的​​​​​​​设​​​​​​​备​​​​​​​状​​​​​​​态​​​​​​​是​​​​​​​ SUSPENDED、​​​​​​​ACTIVE 和​​​​​​​ READ-ONLY。​​​​​​​dmsetup suspend 命​​​​​​​令​​​​​​​将​​​​​​​设​​​​​​​备​​​​​​​状​​​​​​​态​​​​​​​设​​​​​​​定​​​​​​​为​​​​​​​ SUSPENDED。​​​​​​​当​​​​​​​挂​​​​​​​起​​​​​​​某​​​​​​​个​​​​​​​设​​​​​​​备​​​​​​​时​​​​​​​,所​​​​​​​有​​​​​​​到​​​​​​​那​​​​​​​个​​​​​​​设​​​​​​​备​​​​​​​的​​​​​​​ I/O 操​​​​​​​作​​​​​​​都​​​​​​​会​​​​​​​停​​​​​​​止​​​​​​​。​​​​​​​dmsetup resume 命​​​​​​​令​​​​​​​将​​​​​​​设​​​​​​​备​​​​​​​状​​​​​​​态​​​​​​​恢​​​​​​​复​​​​​​​到​​​​​​​ ACTIVE。​​​​​​​
Read Ahead
系​​​​​​​统​​​​​​​对​​​​​​​任​​​​​​​意​​​​​​​正​​​​​​​在​​​​​​​进​​​​​​​行​​​​​​​读​​​​​​​取​​​​​​​操​​​​​​​作​​​​​​​的​​​​​​​打​​​​​​​开​​​​​​​的​​​​​​​文​​​​​​​件​​​​​​​提​​​​​​​前​​​​​​​读​​​​​​​取​​​​​​​的​​​​​​​数​​​​​​​据​​​​​​​块​​​​​​​的​​​​​​​数​​​​​​​目​​​​​​​。​​​​​​​模​​​​​​​热​​​​​​​情​​​​​​​况​​​​​​​下​​​​​​​,内​​​​​​​核​​​​​​​会​​​​​​​自​​​​​​​动​​​​​​​选​​​​​​​择​​​​​​​一​​​​​​​个​​​​​​​合​​​​​​​适​​​​​​​的​​​​​​​值​​​​​​​。​​​​​​​您​​​​​​​可​​​​​​​使​​​​​​​用​​​​​​​ dmsetup 命​​​​​​​令​​​​​​​的​​​​​​​ --readahead 选​​​​​​​项​​​​​​​更​​​​​​​改​​​​​​​这​​​​​​​个​​​​​​​值​​​​​​​。​​​​​​​
Tables present
Possible states for this category are LIVE and INACTIVE. An INACTIVE state indicates that a table has been loaded which will be swapped in when a dmsetup resume command restores a device state to ACTIVE, at which point the table's state becomes LIVE. For information, see the dmsetup man page.
Open count
打​​​​​​​开​​​​​​​参​​​​​​​考​​​​​​​计​​​​​​​数​​​​​​​指​​​​​​​示​​​​​​​该​​​​​​​打​​​​​​​开​​​​​​​该​​​​​​​设​​​​​​​备​​​​​​​的​​​​​​​次​​​​​​​数​​​​​​​。​​​​​​​mount 命​​​​​​​令​​​​​​​会​​​​​​​打​​​​​​​开​​​​​​​一​​​​​​​个​​​​​​​设​​​​​​​备​​​​​​​。​​​​​​​
Event number
The current number of events received. Issuing a dmsetup wait n command allows the user to wait for the n'th event, blocking the call until it is received.
Major, minor
主​​​​​​​设​​​​​​​备​​​​​​​号​​​​​​​码​​​​​​​和​​​​​​​副​​​​​​​设​​​​​​​备​​​​​​​号​​​​​​​码​​​​​​​
Number of targets
组​​​​​​​成​​​​​​​一​​​​​​​个​​​​​​​设​​​​​​​备​​​​​​​的​​​​​​​片​​​​​​​段​​​​​​​数​​​​​​​目​​​​​​​。​​​​​​​例​​​​​​​如​​​​​​​:一​​​​​​​个​​​​​​​跨​​​​​​​越​​​​​​​三​​​​​​​个​​​​​​​磁​​​​​​​盘​​​​​​​的​​​​​​​线​​​​​​​性​​​​​​​设​​​​​​​备​​​​​​​会​​​​​​​有​​​​​​​三​​​​​​​个​​​​​​​对​​​​​​​象​​​​​​​。​​​​​​​由​​​​​​​一​​​​​​​个​​​​​​​磁​​​​​​​盘​​​​​​​起​​​​​​​始​​​​​​​和​​​​​​​结​​​​​​​尾​​​​​​​,而​​​​​​​不​​​​​​​是​​​​​​​中​​​​​​​间​​​​​​​组​​​​​​​成​​​​​​​的​​​​​​​线​​​​​​​性​​​​​​​设​​​​​​​备​​​​​​​有​​​​​​​两​​​​​​​个​​​​​​​设​​​​​​​备​​​​​​​。​​​​​​​
UUID
该​​​​​​​设​​​​​​​备​​​​​​​的​​​​​​​ UUID。​​​​​​​
以​​​​​​​下​​​​​​​是​​​​​​​ dmsetup info 命​​​​​​​令​​​​​​​的​​​​​​​部​​​​​​​分​​​​​​​输​​​​​​​出​​​​​​​示​​​​​​​例​​​​​​​。​​​​​​​
[root@ask-07 ~]# dmsetup info
Name:              testgfsvg-testgfslv1
State:             ACTIVE
Read Ahead:        256
Tables present:    LIVE
Open count:        0
Event number:      0
Major, minor:      253, 2
Number of targets: 2
UUID: LVM-K528WUGQgPadNXYcFrrf9LnPlUMswgkCkpgPIgYzSvigM7SfeWCypddNSWtNzc2N
...
Name:              VolGroup00-LogVol00
State:             ACTIVE
Read Ahead:        256
Tables present:    LIVE
Open count:        1
Event number:      0
Major, minor:      253, 0
Number of targets: 1
UUID: LVM-tOcS1kqFV9drb0X1Vr8sxeYP0tqcrpdegyqj5lZxe45JMGlmvtqLmbLpBcenh2L3

A.2.2. dmsetup ls 命​​​​​​​令​​​​​​​

您​​​​​​​可​​​​​​​以​​​​​​​使​​​​​​​用​​​​​​​ dmsetup ls 命​​​​​​​令​​​​​​​列​​​​​​​出​​​​​​​映​​​​​​​射​​​​​​​的​​​​​​​设​​​​​​​备​​​​​​​的​​​​​​​设​​​​​​​备​​​​​​​名​​​​​​​称​​​​​​​列​​​​​​​表​​​​​​​。​​​​​​​您​​​​​​​可​​​​​​​以​​​​​​​使​​​​​​​用​​​​​​​ dmsetup ls --target target_type 命​​​​​​​令​​​​​​​列​​​​​​​出​​​​​​​至​​​​​​​少​​​​​​​有​​​​​​​一​​​​​​​个​​​​​​​指​​​​​​​定​​​​​​​类​​​​​​​型​​​​​​​的​​​​​​​对​​​​​​​象​​​​​​​的​​​​​​​设​​​​​​​备​​​​​​​。​​​​​​​dmsetup ls 的​​​​​​​其​​​​​​​它​​​​​​​选​​​​​​​项​​​​​​​请​​​​​​​参​​​​​​​考​​​​​​​ dmsetup ls man page。​​​​​​​
以​​​​​​​下​​​​​​​示​​​​​​​例​​​​​​​显​​​​​​​示​​​​​​​列​​​​​​​出​​​​​​​目​​​​​​​前​​​​​​​配​​​​​​​置​​​​​​​的​​​​​​​映​​​​​​​射​​​​​​​设​​​​​​​备​​​​​​​的​​​​​​​设​​​​​​​备​​​​​​​名​​​​​​​称​​​​​​​的​​​​​​​命​​​​​​​令​​​​​​​。​​​​​​​
[root@ask-07 ~]# dmsetup ls
testgfsvg-testgfslv3    (253, 4)
testgfsvg-testgfslv2    (253, 3)
testgfsvg-testgfslv1    (253, 2)
VolGroup00-LogVol01     (253, 1)
VolGroup00-LogVol00     (253, 0)
以​​​​​​​下​​​​​​​示​​​​​​​例​​​​​​​显​​​​​​​示​​​​​​​列​​​​​​​出​​​​​​​目​​​​​​​前​​​​​​​配​​​​​​​置​​​​​​​的​​​​​​​镜​​​​​​​像​​​​​​​映​​​​​​​射​​​​​​​的​​​​​​​设​​​​​​​备​​​​​​​名​​​​​​​称​​​​​​​的​​​​​​​命​​​​​​​令​​​​​​​。​​​​​​​
[root@grant-01 ~]# dmsetup ls --target mirror
lock_stress-grant--02.1722      (253, 34)
lock_stress-grant--01.1720      (253, 18)
lock_stress-grant--03.1718      (253, 52)
lock_stress-grant--02.1716      (253, 40)
lock_stress-grant--03.1713      (253, 47)
lock_stress-grant--02.1709      (253, 23)
lock_stress-grant--01.1707      (253, 8)
lock_stress-grant--01.1724      (253, 14)
lock_stress-grant--03.1711      (253, 27)

A.2.3. dmsetup status 命​​​​​​​令​​​​​​​

dmsetup status device 命​​​​​​​令​​​​​​​提​​​​​​​供​​​​​​​指​​​​​​​定​​​​​​​设​​​​​​​备​​​​​​​中​​​​​​​每​​​​​​​个​​​​​​​对​​​​​​​象​​​​​​​的​​​​​​​状​​​​​​​态​​​​​​​信​​​​​​​息​​​​​​​。​​​​​​​如​​​​​​​果​​​​​​​您​​​​​​​没​​​​​​​有​​​​​​​指​​​​​​​定​​​​​​​设​​​​​​​备​​​​​​​名​​​​​​​称​​​​​​​,输​​​​​​​出​​​​​​​会​​​​​​​是​​​​​​​所​​​​​​​余​​​​​​​目​​​​​​​前​​​​​​​配​​​​​​​置​​​​​​​的​​​​​​​设​​​​​​​备​​​​​​​映​​​​​​​射​​​​​​​器​​​​​​​设​​​​​​​备​​​​​​​信​​​​​​​息​​​​​​​。​​​​​​​您​​​​​​​可​​​​​​​以​​​​​​​使​​​​​​​用​​​​​​​ dmsetup status --target target_type 命​​​​​​​令​​​​​​​列​​​​​​​出​​​​​​​那​​​​​​​些​​​​​​​至​​​​​​​少​​​​​​​有​​​​​​​一​​​​​​​个​​​​​​​指​​​​​​​定​​​​​​​类​​​​​​​型​​​​​​​的​​​​​​​对​​​​​​​象​​​​​​​的​​​​​​​设​​​​​​​备​​​​​​​。​​​​​​​
以​​​​​​​下​​​​​​​示​​​​​​​例​​​​​​​显​​​​​​​示​​​​​​​列​​​​​​​出​​​​​​​在​​​​​​​所​​​​​​​有​​​​​​​目​​​​​​​前​​​​​​​配​​​​​​​置​​​​​​​的​​​​​​​映​​​​​​​射​​​​​​​设​​​​​​​备​​​​​​​中​​​​​​​的​​​​​​​对​​​​​​​象​​​​​​​状​​​​​​​态​​​​​​​的​​​​​​​命​​​​​​​令​​​​​​​。​​​​​​​
[root@ask-07 ~]# dmsetup status
testgfsvg-testgfslv3: 0 312352768 linear 
testgfsvg-testgfslv2: 0 312352768 linear 
testgfsvg-testgfslv1: 0 312352768 linear 
testgfsvg-testgfslv1: 312352768 50331648 linear 
VolGroup00-LogVol01: 0 4063232 linear 
VolGroup00-LogVol00: 0 151912448 linear

A.2.4. dmsetup deps 命​​​​​​​令​​​​​​​

dmsetup deps device 命​​​​​​​令​​​​​​​为​​​​​​​指​​​​​​​定​​​​​​​设​​​​​​​备​​​​​​​的​​​​​​​映​​​​​​​射​​​​​​​列​​​​​​​表​​​​​​​参​​​​​​​考​​​​​​​的​​​​​​​设​​​​​​​备​​​​​​​提​​​​​​​供​​​​​​​(major,minor)对​​​​​​​列​​​​​​​表​​​​​​​。​​​​​​​如​​​​​​​果​​​​​​​您​​​​​​​没​​​​​​​有​​​​​​​指​​​​​​​定​​​​​​​设​​​​​​​备​​​​​​​名​​​​​​​称​​​​​​​,则​​​​​​​输​​​​​​​出​​​​​​​所​​​​​​​有​​​​​​​目​​​​​​​前​​​​​​​配​​​​​​​置​​​​​​​的​​​​​​​设​​​​​​​备​​​​​​​映​​​​​​​射​​​​​​​器​​​​​​​设​​​​​​​备​​​​​​​信​​​​​​​息​​​​​​​。​​​​​​​
以​​​​​​​下​​​​​​​示​​​​​​​例​​​​​​​显​​​​​​​示​​​​​​​列​​​​​​​出​​​​​​​在​​​​​​​所​​​​​​​有​​​​​​​目​​​​​​​前​​​​​​​配​​​​​​​置​​​​​​​的​​​​​​​映​​​​​​​射​​​​​​​设​​​​​​​备​​​​​​​相​​​​​​​依​​​​​​​性​​​​​​​的​​​​​​​命​​​​​​​令​​​​​​​。​​​​​​​
[root@ask-07 ~]# dmsetup deps
testgfsvg-testgfslv3: 1 dependencies    : (8, 16)
testgfsvg-testgfslv2: 1 dependencies    : (8, 16)
testgfsvg-testgfslv1: 1 dependencies    : (8, 16)
VolGroup00-LogVol01: 1 dependencies     : (8, 2)
VolGroup00-LogVol00: 1 dependencies     : (8, 2)
以​​​​​​​下​​​​​​​示​​​​​​​例​​​​​​​显​​​​​​​示​​​​​​​只​​​​​​​列​​​​​​​出​​​​​​​设​​​​​​​备​​​​​​​ lock_stress-grant--02.1722 相​​​​​​​依​​​​​​​性​​​​​​​的​​​​​​​命​​​​​​​令​​​​​​​:
[root@grant-01 ~]# dmsetup deps lock_stress-grant--02.1722
3 dependencies  : (253, 33) (253, 32) (253, 31)

附录 B. LVM 配​​​​​​​置​​​​​​​文​​​​​​​件​​​​​​​

LVM 支​​​​​​​持​​​​​​​多​​​​​​​配​​​​​​​置​​​​​​​文​​​​​​​件​​​​​​​。​​​​​​​在​​​​​​​系​​​​​​​统​​​​​​​启​​​​​​​动​​​​​​​时​​​​​​​,会​​​​​​​从​​​​​​​用​​​​​​​环​​​​​​​境​​​​​​​变​​​​​​​量​​​​​​​ LVM_SYSTEM_DIR 指​​​​​​​定​​​​​​​的​​​​​​​目​​​​​​​录​​​​​​​中​​​​​​​载​​​​​​​入​​​​​​​ lvm.conf 配​​​​​​​置​​​​​​​文​​​​​​​件​​​​​​​,该​​​​​​​变​​​​​​​量​​​​​​​在​​​​​​​ /etc/lvm 中​​​​​​​是​​​​​​​默​​​​​​​认​​​​​​​设​​​​​​​置​​​​​​​。​​​​​​​
lvm.conf 文​​​​​​​件​​​​​​​可​​​​​​​指​​​​​​​定​​​​​​​要​​​​​​​载​​​​​​​入​​​​​​​的​​​​​​​额​​​​​​​外​​​​​​​配​​​​​​​置​​​​​​​文​​​​​​​件​​​​​​​。​​​​​​​后​​​​​​​来​​​​​​​设​​​​​​​定​​​​​​​的​​​​​​​文​​​​​​​件​​​​​​​会​​​​​​​覆​​​​​​​盖​​​​​​​之​​​​​​​前​​​​​​​设​​​​​​​定​​​​​​​的​​​​​​​文​​​​​​​件​​​​​​​。​​​​​​​要​​​​​​​在​​​​​​​载​​​​​​​入​​​​​​​所​​​​​​​有​​​​​​​配​​​​​​​置​​​​​​​文​​​​​​​件​​​​​​​后​​​​​​​显​​​​​​​示​​​​​​​使​​​​​​​用​​​​​​​的​​​​​​​设​​​​​​​定​​​​​​​,请​​​​​​​运​​​​​​​行​​​​​​​ lvm dumpconfig 命​​​​​​​令​​​​​​​。​​​​​​​

B.1. LVM 配​​​​​​​置​​​​​​​文​​​​​​​件​​​​​​​

以​​​​​​​下​​​​​​​是​​​​​​​用​​​​​​​于​​​​​​​ LVM 配​​​​​​​置​​​​​​​的​​​​​​​文​​​​​​​件​​​​​​​:
/etc/lvm/lvm.conf
由​​​​​​​工​​​​​​​具​​​​​​​读​​​​​​​取​​​​​​​的​​​​​​​中​​​​​​​央​​​​​​​配​​​​​​​置​​​​​​​文​​​​​​​件​​​​​​​。​​​​​​​
etc/lvm/lvm_hosttag.conf
For each host tag, an extra configuration file is read if it exists: lvm_hosttag.conf. If that file defines new tags, then further configuration files will be appended to the list of tiles to read in. For information on host tags, see 第 C.2 节 “主​​​​​​​机​​​​​​​标​​​​​​​签​​​​​​​”.
除​​​​​​​了​​​​​​​ LVM 配​​​​​​​置​​​​​​​文​​​​​​​件​​​​​​​之​​​​​​​外​​​​​​​,运​​​​​​​行​​​​​​​ LVM 的​​​​​​​系​​​​​​​统​​​​​​​会​​​​​​​包​​​​​​​含​​​​​​​以​​​​​​​下​​​​​​​可​​​​​​​影​​​​​​​响​​​​​​​ LVM 系​​​​​​​统​​​​​​​设​​​​​​​置​​​​​​​的​​​​​​​文​​​​​​​件​​​​​​​:
/etc/lvm/.cache
设​​​​​​​备​​​​​​​名​​​​​​​称​​​​​​​过​​​​​​​滤​​​​​​​器​​​​​​​缓​​​​​​​存​​​​​​​文​​​​​​​件​​​​​​​(可​​​​​​​配​​​​​​​置​​​​​​​)。​​​​​​​
/etc/lvm/backup/
自​​​​​​​动​​​​​​​卷​​​​​​​组​​​​​​​元​​​​​​​数​​​​​​​据​​​​​​​备​​​​​​​份​​​​​​​目​​​​​​​录​​​​​​​(可​​​​​​​配​​​​​​​置​​​​​​​)。​​​​​​​
/etc/lvm/archive/
自​​​​​​​动​​​​​​​卷​​​​​​​组​​​​​​​元​​​​​​​数​​​​​​​据​​​​​​​归​​​​​​​档​​​​​​​目​​​​​​​录​​​​​​​(可​​​​​​​根​​​​​​​据​​​​​​​目​​​​​​​录​​​​​​​路​​​​​​​径​​​​​​​和​​​​​​​归​​​​​​​档​​​​​​​历​​​​​​​史​​​​​​​记​​​​​​​录​​​​​​​途​​​​​​​径​​​​​​​进​​​​​​​行​​​​​​​配​​​​​​​置​​​​​​​)。​​​​​​​
/var/lock/lvm
在​​​​​​​单​​​​​​​主​​​​​​​机​​​​​​​配​​​​​​​置​​​​​​​这​​​​​​​,锁​​​​​​​定​​​​​​​文​​​​​​​件​​​​​​​可​​​​​​​防​​​​​​​止​​​​​​​平​​​​​​​行​​​​​​​工​​​​​​​具​​​​​​​运​​​​​​​行​​​​​​​时​​​​​​​破​​​​​​​坏​​​​​​​元​​​​​​​数​​​​​​​据​​​​​​​;而​​​​​​​在​​​​​​​群​​​​​​​集​​​​​​​中​​​​​​​,使​​​​​​​用​​​​​​​的​​​​​​​群​​​​​​​集​​​​​​​范​​​​​​​围​​​​​​​的​​​​​​​ DLM。​​​​​​​

B.2. lvm.conf 文​​​​​​​件​​​​​​​示​​​​​​​例​​​​​​​

以​​​​​​​下​​​​​​​是​​​​​​​ lvm.conf 配​​​​​​​置​​​​​​​文​​​​​​​件​​​​​​​示​​​​​​​例​​​​​​​。​​​​​​​这​​​​​​​个​​​​​​​配​​​​​​​置​​​​​​​文​​​​​​​件​​​​​​​是​​​​​​​ RHEL 5.3 发​​​​​​​行​​​​​​​本​​​​​​​的​​​​​​​默​​​​​​​认​​​​​​​文​​​​​​​件​​​​​​​。​​​​​​​如​​​​​​​果​​​​​​​您​​​​​​​的​​​​​​​系​​​​​​​统​​​​​​​运​​​​​​​行​​​​​​​的​​​​​​​是​​​​​​​不​​​​​​​同​​​​​​​的​​​​​​​ RHEL 5 发​​​​​​​行​​​​​​​本​​​​​​​,有​​​​​​​些​​​​​​​默​​​​​​​认​​​​​​​设​​​​​​​置​​​​​​​可​​​​​​​能​​​​​​​不​​​​​​​同​​​​​​​。​​​​​​​
[root@tng3-1 lvm]# cat /etc/lvm/lvm.conf
# This is an example configuration file for the LVM2 system.
# It contains the default settings that would be used if there was no
# /etc/lvm/lvm.conf file.
#
# Refer to 'man lvm.conf' for further information including the file layout.
#
# To put this file in a different directory and override /etc/lvm set
# the environment variable LVM_SYSTEM_DIR before running the tools.


# This section allows you to configure which block devices should
# be used by the LVM system.
devices {

    # Where do you want your volume groups to appear ?
    dir = "/dev"

    # An array of directories that contain the device nodes you wish
    # to use with LVM2.
    scan = [ "/dev" ]

    # If several entries in the scanned directories correspond to the
    # same block device and the tools need to display a name for device,
    # all the pathnames are matched against each item in the following
    # list of regular expressions in turn and the first match is used.
    preferred_names = [ ]

    # Try to avoid using undescriptive /dev/dm-N names, if present.
    # preferred_names = [ "^/dev/mpath/", "^/dev/mapper/mpath", "^/dev/[hs]d" ]

    # A filter that tells LVM2 to only use a restricted set of devices.
    # The filter consists of an array of regular expressions.  These
    # expressions can be delimited by a character of your choice, and
    # prefixed with either an 'a' (for accept) or 'r' (for reject).
    # The first expression found to match a device name determines if
    # the device will be accepted or rejected (ignored).  Devices that
    # don't match any patterns are accepted.

    # Be careful if there there are symbolic links or multiple filesystem 
    # entries for the same device as each name is checked separately against
    # the list of patterns.  The effect is that if any name matches any 'a'
    # pattern, the device is accepted; otherwise if any name matches any 'r'
    # pattern it is rejected; otherwise it is accepted.

    # Don't have more than one filter line active at once: only one gets used.

    # Run vgscan after you change this parameter to ensure that
    # the cache file gets regenerated (see below).
    # If it doesn't do what you expect, check the output of 'vgscan -vvvv'.


    # By default we accept every block device:
    filter = [ "a/.*/" ]

    # Exclude the cdrom drive
    # filter = [ "r|/dev/cdrom|" ]

    # When testing I like to work with just loopback devices:
    # filter = [ "a/loop/", "r/.*/" ]

    # Or maybe all loops and ide drives except hdc:
    # filter =[ "a|loop|", "r|/dev/hdc|", "a|/dev/ide|", "r|.*|" ]

    # Use anchors if you want to be really specific
    # filter = [ "a|^/dev/hda8$|", "r/.*/" ]

    # The results of the filtering are cached on disk to avoid
    # rescanning dud devices (which can take a very long time).
    # By default this cache is stored in the /etc/lvm/cache directory
    # in a file called '.cache'.
    # It is safe to delete the contents: the tools regenerate it.
    # (The old setting 'cache' is still respected if neither of
    # these new ones is present.)
    cache_dir = "/etc/lvm/cache"
    cache_file_prefix = ""

    # You can turn off writing this cache file by setting this to 0.
    write_cache_state = 1

    # Advanced settings.

    # List of pairs of additional acceptable block device types found 
    # in /proc/devices with maximum (non-zero) number of partitions.
    # types = [ "fd", 16 ]

    # If sysfs is mounted (2.6 kernels) restrict device scanning to 
    # the block devices it believes are valid.
    # 1 enables; 0 disables.
    sysfs_scan = 1	

    # By default, LVM2 will ignore devices used as components of
    # software RAID (md) devices by looking for md superblocks.
    # 1 enables; 0 disables.
    md_component_detection = 1

    # By default, if a PV is placed directly upon an md device, LVM2
    # will align its data blocks with the the chunk_size exposed in sysfs.
    # 1 enables; 0 disables.
    md_chunk_alignment = 1

    # If, while scanning the system for PVs, LVM2 encounters a device-mapper
    # device that has its I/O suspended, it waits for it to become accessible.
    # Set this to 1 to skip such devices.  This should only be needed
    # in recovery situations.
    ignore_suspended_devices = 0
}

# This section that allows you to configure the nature of the
# information that LVM2 reports.
log {

    # Controls the messages sent to stdout or stderr.
    # There are three levels of verbosity, 3 being the most verbose.
    verbose = 0

    # Should we send log messages through syslog?
    # 1 is yes; 0 is no.
    syslog = 1

    # Should we log error and debug messages to a file?
    # By default there is no log file.
    #file = "/var/log/lvm2.log"

    # Should we overwrite the log file each time the program is run?
    # By default we append.
    overwrite = 0

    # What level of log messages should we send to the log file and/or syslog?
    # There are 6 syslog-like log levels currently in use - 2 to 7 inclusive.
    # 7 is the most verbose (LOG_DEBUG).
    level = 0
    
    # Format of output messages
    # Whether or not (1 or 0) to indent messages according to their severity
    indent = 1

    # Whether or not (1 or 0) to display the command name on each line output
    command_names = 0

    # A prefix to use before the message text (but after the command name,
    # if selected).  Default is two spaces, so you can see/grep the severity
    # of each message.
    prefix = "  "

    # To make the messages look similar to the original LVM tools use:
    #   indent = 0
    #   command_names = 1
    #   prefix = " -- "

    # Set this if you want log messages during activation.
    # Don't use this in low memory situations (can deadlock).
    # activation = 0
}

# Configuration of metadata backups and archiving.  In LVM2 when we
# talk about a 'backup' we mean making a copy of the metadata for the
# *current* system.  The 'archive' contains old metadata configurations.
# Backups are stored in a human readeable text format.
backup {

    # Should we maintain a backup of the current metadata configuration ?
    # Use 1 for Yes; 0 for No.
    # Think very hard before turning this off!
    backup = 1

    # Where shall we keep it ?
    # Remember to back up this directory regularly!
    backup_dir = "/etc/lvm/backup"

    # Should we maintain an archive of old metadata configurations.
    # Use 1 for Yes; 0 for No.
    # On by default.  Think very hard before turning this off.
    archive = 1

    # Where should archived files go ?
    # Remember to back up this directory regularly!
    archive_dir = "/etc/lvm/archive"
    
    # What is the minimum number of archive files you wish to keep ?
    retain_min = 10

    # What is the minimum time you wish to keep an archive file for ?
    retain_days = 30
}

# Settings for the running LVM2 in shell (readline) mode.
shell {

    # Number of lines of history to store in ~/.lvm_history
    history_size = 100
}


# Miscellaneous global LVM2 settings
global {
    library_dir = "/usr/lib64"
    
    # The file creation mask for any files and directories created.
    # Interpreted as octal if the first digit is zero.
    umask = 077

    # Allow other users to read the files
    #umask = 022

    # Enabling test mode means that no changes to the on disk metadata
    # will be made.  Equivalent to having the -t option on every
    # command.  Defaults to off.
    test = 0

    # Default value for --units argument
    units = "h"

    # Whether or not to communicate with the kernel device-mapper.
    # Set to 0 if you want to use the tools to manipulate LVM metadata 
    # without activating any logical volumes.
    # If the device-mapper kernel driver is not present in your kernel
    # setting this to 0 should suppress the error messages.
    activation = 1

    # If we can't communicate with device-mapper, should we try running 
    # the LVM1 tools?
    # This option only applies to 2.4 kernels and is provided to help you
    # switch between device-mapper kernels and LVM1 kernels.
    # The LVM1 tools need to be installed with .lvm1 suffices
    # e.g. vgscan.lvm1 and they will stop working after you start using
    # the new lvm2 on-disk metadata format.
    # The default value is set when the tools are built.
    # fallback_to_lvm1 = 0

    # The default metadata format that commands should use - "lvm1" or "lvm2".
    # The command line override is -M1 or -M2.
    # Defaults to "lvm1" if compiled in, else "lvm2".
    # format = "lvm1"

    # Location of proc filesystem
    proc = "/proc"

    # Type of locking to use. Defaults to local file-based locking (1).
    # Turn locking off by setting to 0 (dangerous: risks metadata corruption
    # if LVM2 commands get run concurrently).
    # Type 2 uses the external shared library locking_library.
    # Type 3 uses built-in clustered locking.
    locking_type = 3

    # If using external locking (type 2) and initialisation fails,
    # with this set to 1 an attempt will be made to use the built-in
    # clustered locking.
    # If you are using a customised locking_library you should set this to 0.
    fallback_to_clustered_locking = 1

    # If an attempt to initialise type 2 or type 3 locking failed, perhaps
    # because cluster components such as clvmd are not running, with this set
    # to 1 an attempt will be made to use local file-based locking (type 1).
    # If this succeeds, only commands against local volume groups will proceed.
    # Volume Groups marked as clustered will be ignored.
    fallback_to_local_locking = 1

    # Local non-LV directory that holds file-based locks while commands are
    # in progress.  A directory like /tmp that may get wiped on reboot is OK.
    locking_dir = "/var/lock/lvm"

    # Other entries can go here to allow you to load shared libraries
    # e.g. if support for LVM1 metadata was compiled as a shared library use
    #   format_libraries = "liblvm2format1.so" 
    # Full pathnames can be given.

    # Search this directory first for shared libraries.
    #   library_dir = "/lib"

    # The external locking library to load if locking_type is set to 2.
    #   locking_library = "liblvm2clusterlock.so"
}

activation {
    # How to fill in missing stripes if activating an incomplete volume.
    # Using "error" will make inaccessible parts of the device return
    # I/O errors on access.  You can instead use a device path, in which 
    # case, that device will be used to in place of missing stripes.
    # But note that using anything other than "error" with mirrored 
    # or snapshotted volumes is likely to result in data corruption.
    missing_stripe_filler = "error"

    # How much stack (in KB) to reserve for use while devices suspended
    reserved_stack = 256

    # How much memory (in KB) to reserve for use while devices suspended
    reserved_memory = 8192

    # Nice value used while devices suspended
    process_priority = -18

    # If volume_list is defined, each LV is only activated if there is a
    # match against the list.
    #   "vgname" and "vgname/lvname" are matched exactly.
    #   "@tag" matches any tag set in the LV or VG.
    #   "@*" matches if any tag defined on the host is also set in the LV or VG
    #
    # volume_list = [ "vg1", "vg2/lvol1", "@tag1", "@*" ]

    # Size (in KB) of each copy operation when mirroring
    mirror_region_size = 512

    # Setting to use when there is no readahead value stored in the metadata.
    #
    # "none" - Disable readahead.
    # "auto" - Use default value chosen by kernel.
    readahead = "auto"

    # 'mirror_image_fault_policy' and 'mirror_log_fault_policy' define
    # how a device failure affecting a mirror is handled.
    # A mirror is composed of mirror images (copies) and a log.
    # A disk log ensures that a mirror does not need to be re-synced
    # (all copies made the same) every time a machine reboots or crashes.
    #
    # In the event of a failure, the specified policy will be used to
    # determine what happens:
    #
    # "remove" - Simply remove the faulty device and run without it.  If
    #            the log device fails, the mirror would convert to using
    #            an in-memory log.  This means the mirror will not
    #            remember its sync status across crashes/reboots and
    #            the entire mirror will be re-synced.  If a
    #            mirror image fails, the mirror will convert to a
    #            non-mirrored device if there is only one remaining good
    #            copy.
    #
    # "allocate" - Remove the faulty device and try to allocate space on
    #            a new device to be a replacement for the failed device.
    #            Using this policy for the log is fast and maintains the
    #            ability to remember sync state through crashes/reboots.
    #            Using this policy for a mirror device is slow, as it
    #            requires the mirror to resynchronize the devices, but it
    #            will preserve the mirror characteristic of the device.
    #            This policy acts like "remove" if no suitable device and
    #            space can be allocated for the replacement.
    #            Currently this is not implemented properly and behaves
    #            similarly to:
    #
    # "allocate_anywhere" - Operates like "allocate", but it does not
    #            require that the new space being allocated be on a
    #            device is not part of the mirror.  For a log device
    #            failure, this could mean that the log is allocated on
    #            the same device as a mirror device.  For a mirror
    #            device, this could mean that the mirror device is
    #            allocated on the same device as another mirror device.
    #            This policy would not be wise for mirror devices
    #            because it would break the redundant nature of the
    #            mirror.  This policy acts like "remove" if no suitable
    #            device and space can be allocated for the replacement.

    mirror_log_fault_policy = "allocate"
    mirror_device_fault_policy = "remove"
}


####################
# Advanced section #
####################

# Metadata settings
#
# metadata {
    # Default number of copies of metadata to hold on each PV.  0, 1 or 2.
    # You might want to override it from the command line with 0 
    # when running pvcreate on new PVs which are to be added to large VGs.

    # pvmetadatacopies = 1

    # Approximate default size of on-disk metadata areas in sectors.
    # You should increase this if you have large volume groups or
    # you want to retain a large on-disk history of your metadata changes.

    # pvmetadatasize = 255

    # List of directories holding live copies of text format metadata.
    # These directories must not be on logical volumes!
    # It's possible to use LVM2 with a couple of directories here,
    # preferably on different (non-LV) filesystems, and with no other 
    # on-disk metadata (pvmetadatacopies = 0). Or this can be in
    # addition to on-disk metadata areas.
    # The feature was originally added to simplify testing and is not
    # supported under low memory situations - the machine could lock up.
    #
    # Never edit any files in these directories by hand unless you
    # you are absolutely sure you know what you are doing! Use
    # the supplied toolset to make changes (e.g. vgcfgrestore).

    # dirs = [ "/etc/lvm/metadata", "/mnt/disk2/lvm/metadata2" ]
#}

# Event daemon
#
dmeventd {
    # mirror_library is the library used when monitoring a mirror device.
    #
    # "libdevmapper-event-lvm2mirror.so" attempts to recover from
    # failures.  It removes failed devices from a volume group and
    # reconfigures a mirror as necessary. If no mirror library is
    # provided, mirrors are not monitored through dmeventd.

    mirror_library = "libdevmapper-event-lvm2mirror.so"

    # snapshot_library is the library used when monitoring a snapshot device.
    #
    # "libdevmapper-event-lvm2snapshot.so" monitors the filling of
    # snapshots and emits a warning through syslog, when the use of
    # snapshot exceedes 80%. The warning is repeated when 85%, 90% and
    # 95% of the snapshot are filled.

    snapshot_library = "libdevmapper-event-lvm2snapshot.so"
}

附录 C. LVM 对​​​​​​​象​​​​​​​标​​​​​​​签​​​​​​​

LVM 标​​​​​​​签​​​​​​​是​​​​​​​一​​​​​​​个​​​​​​​可​​​​​​​将​​​​​​​有​​​​​​​相​​​​​​​同​​​​​​​类​​​​​​​型​​​​​​​的​​​​​​​ LVM2 对​​​​​​​象​​​​​​​分​​​​​​​成​​​​​​​同​​​​​​​一​​​​​​​组​​​​​​​的​​​​​​​单​​​​​​​词​​​​​​​。​​​​​​​可​​​​​​​将​​​​​​​标​​​​​​​签​​​​​​​附​​​​​​​加​​​​​​​到​​​​​​​对​​​​​​​象​​​​​​​中​​​​​​​,对​​​​​​​象​​​​​​​可​​​​​​​以​​​​​​​是​​​​​​​物​​​​​​​理​​​​​​​卷​​​​​​​、​​​​​​​卷​​​​​​​组​​​​​​​、​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​、​​​​​​​片​​​​​​​段​​​​​​​。​​​​​​​也​​​​​​​可​​​​​​​将​​​​​​​标​​​​​​​签​​​​​​​附​​​​​​​加​​​​​​​到​​​​​​​群​​​​​​​集​​​​​​​配​​​​​​​置​​​​​​​的​​​​​​​主​​​​​​​机​​​​​​​中​​​​​​​。​​​​​​​无​​​​​​​法​​​​​​​为​​​​​​​快​​​​​​​照​​​​​​​添​​​​​​​加​​​​​​​标​​​​​​​签​​​​​​​。​​​​​​​
可​​​​​​​在​​​​​​​命​​​​​​​令​​​​​​​行​​​​​​​的​​​​​​​ PV、​​​​​​​VG 或​​​​​​​者​​​​​​​ LV 参​​​​​​​数​​​​​​​中​​​​​​​赋​​​​​​​予​​​​​​​标​​​​​​​签​​​​​​​。​​​​​​​标​​​​​​​签​​​​​​​应​​​​​​​该​​​​​​​有​​​​​​​ @ 作​​​​​​​为​​​​​​​前​​​​​​​缀​​​​​​​以​​​​​​​避​​​​​​​免​​​​​​​混​​​​​​​淆​​​​​​​。​​​​​​​每​​​​​​​个​​​​​​​标​​​​​​​签​​​​​​​都​​​​​​​可​​​​​​​用​​​​​​​所​​​​​​​有​​​​​​​对​​​​​​​象​​​​​​​都​​​​​​​拥​​​​​​​有​​​​​​​的​​​​​​​标​​​​​​​签​​​​​​​取​​​​​​​代​​​​​​​来​​​​​​​扩​​​​​​​大​​​​​​​范​​​​​​​围​​​​​​​,标​​​​​​​签​​​​​​​的​​​​​​​类​​​​​​​型​​​​​​​根​​​​​​​据​​​​​​​它​​​​​​​在​​​​​​​命​​​​​​​令​​​​​​​行​​​​​​​的​​​​​​​位​​​​​​​置​​​​​​​确​​​​​​​定​​​​​​​。​​​​​​​
LVM 标​​​​​​​签​​​​​​​是​​​​​​​使​​​​​​​用​​​​​​​ [A-Za-z0-9_+.-] 的​​​​​​​字​​​​​​​符​​​​​​​串​​​​​​​,最​​​​​​​长​​​​​​​为​​​​​​​ 128 个​​​​​​​字​​​​​​​符​​​​​​​,它​​​​​​​们​​​​​​​不​​​​​​​可​​​​​​​以​​​​​​​连​​​​​​​字​​​​​​​符​​​​​​​开​​​​​​​始​​​​​​​。​​​​​​​
只​​​​​​​能​​​​​​​为​​​​​​​卷​​​​​​​组​​​​​​​中​​​​​​​的​​​​​​​对​​​​​​​象​​​​​​​添​​​​​​​加​​​​​​​标​​​​​​​签​​​​​​​。​​​​​​​如​​​​​​​果​​​​​​​从​​​​​​​卷​​​​​​​组​​​​​​​中​​​​​​​删​​​​​​​除​​​​​​​物​​​​​​​理​​​​​​​卷​​​​​​​,它​​​​​​​们​​​​​​​就​​​​​​​会​​​​​​​丢​​​​​​​失​​​​​​​它​​​​​​​们​​​​​​​的​​​​​​​标​​​​​​​签​​​​​​​。​​​​​​​这​​​​​​​是​​​​​​​因​​​​​​​为​​​​​​​标​​​​​​​签​​​​​​​是​​​​​​​作​​​​​​​为​​​​​​​卷​​​​​​​组​​​​​​​元​​​​​​​数​​​​​​​据​​​​​​​的​​​​​​​一​​​​​​​部​​​​​​​分​​​​​​​保​​​​​​​存​​​​​​​的​​​​​​​,并​​​​​​​在​​​​​​​删​​​​​​​除​​​​​​​物​​​​​​​理​​​​​​​卷​​​​​​​时​​​​​​​被​​​​​​​删​​​​​​​除​​​​​​​掉​​​​​​​。​​​​​​​无​​​​​​​法​​​​​​​为​​​​​​​快​​​​​​​照​​​​​​​添​​​​​​​加​​​​​​​标​​​​​​​签​​​​​​​。​​​​​​​
以​​​​​​​下​​​​​​​命​​​​​​​令​​​​​​​列​​​​​​​出​​​​​​​所​​​​​​​有​​​​​​​带​​​​​​​ database 标​​​​​​​签​​​​​​​的​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​。​​​​​​​
lvs @database

C.1. 添​​​​​​​加​​​​​​​和​​​​​​​删​​​​​​​除​​​​​​​对​​​​​​​象​​​​​​​标​​​​​​​签​​​​​​​

要​​​​​​​从​​​​​​​物​​​​​​​理​​​​​​​卷​​​​​​​中​​​​​​​添​​​​​​​加​​​​​​​或​​​​​​​者​​​​​​​删​​​​​​​除​​​​​​​标​​​​​​​签​​​​​​​,请​​​​​​​使​​​​​​​用​​​​​​​ pvchange 命​​​​​​​令​​​​​​​的​​​​​​​ --addtag 或​​​​​​​者​​​​​​​ --deltag 选​​​​​​​项​​​​​​​。​​​​​​​
要​​​​​​​从​​​​​​​卷​​​​​​​组​​​​​​​中​​​​​​​添​​​​​​​加​​​​​​​或​​​​​​​者​​​​​​​删​​​​​​​除​​​​​​​标​​​​​​​签​​​​​​​,请​​​​​​​使​​​​​​​用​​​​​​​ vgchange 或​​​​​​​ vgcreate 命​​​​​​​令​​​​​​​的​​​​​​​ --addtag 或​​​​​​​者​​​​​​​ --deltag 选​​​​​​​项​​​​​​​。​​​​​​​
要​​​​​​​在​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​中​​​​​​​添​​​​​​​加​​​​​​​或​​​​​​​者​​​​​​​删​​​​​​​除​​​​​​​标​​​​​​​签​​​​​​​,请​​​​​​​请​​​​​​​使​​​​​​​用​​​​​​​ lvchange 或​​​​​​​ lvcreate 命​​​​​​​令​​​​​​​的​​​​​​​ --addtag 或​​​​​​​者​​​​​​​ --deltag 选​​​​​​​项​​​​​​​。​​​​​​​

C.2. 主​​​​​​​机​​​​​​​标​​​​​​​签​​​​​​​

In a cluster configuration, you can define host tags in the configuration files. If you set hosttags = 1 in the tags section, a host tag is automatically defined using the machine's hostname. This allow you to use a common configuration file which can be replicated on all your machines so they hold identical copies of the file, but the behavior can differ between machines according to the hostname.
对​​​​​​​于​​​​​​​每​​​​​​​个​​​​​​​主​​​​​​​机​​​​​​​标​​​​​​​签​​​​​​​,如​​​​​​​果​​​​​​​存​​​​​​​在​​​​​​​额​​​​​​​外​​​​​​​的​​​​​​​配​​​​​​​置​​​​​​​文​​​​​​​件​​​​​​​ lvm_hosttag.conf,就​​​​​​​会​​​​​​​读​​​​​​​取​​​​​​​它​​​​​​​。​​​​​​​如​​​​​​​果​​​​​​​那​​​​​​​个​​​​​​​文​​​​​​​件​​​​​​​定​​​​​​​义​​​​​​​了​​​​​​​新​​​​​​​的​​​​​​​标​​​​​​​签​​​​​​​,那​​​​​​​么​​​​​​​会​​​​​​​在​​​​​​​要​​​​​​​读​​​​​​​取​​​​​​​的​​​​​​​文​​​​​​​件​​​​​​​列​​​​​​​表​​​​​​​中​​​​​​​添​​​​​​​加​​​​​​​进​​​​​​​一​​​​​​​步​​​​​​​的​​​​​​​配​​​​​​​置​​​​​​​文​​​​​​​件​​​​​​​。​​​​​​​
例​​​​​​​如​​​​​​​:下​​​​​​​面​​​​​​​配​​​​​​​置​​​​​​​文​​​​​​​件​​​​​​​中​​​​​​​的​​​​​​​条​​​​​​​目​​​​​​​总​​​​​​​是​​​​​​​定​​​​​​​义​​​​​​​ tag1,且​​​​​​​在​​​​​​​主​​​​​​​机​​​​​​​名​​​​​​​为​​​​​​​ host1 定​​​​​​​义​​​​​​​ tag2。​​​​​​​
tags { tag1 { }  tag2 { host_list = ["host1"] } }

C.3. 使​​​​​​​用​​​​​​​标​​​​​​​签​​​​​​​控​​​​​​​制​​​​​​​激​​​​​​​活​​​​​​​

您​​​​​​​可​​​​​​​以​​​​​​​在​​​​​​​配​​​​​​​置​​​​​​​文​​​​​​​件​​​​​​​中​​​​​​​指​​​​​​​定​​​​​​​在​​​​​​​那​​​​​​​个​​​​​​​主​​​​​​​机​​​​​​​中​​​​​​​只​​​​​​​应​​​​​​​该​​​​​​​激​​​​​​​活​​​​​​​某​​​​​​​个​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​。​​​​​​​例​​​​​​​如​​​​​​​:下​​​​​​​面​​​​​​​的​​​​​​​条​​​​​​​目​​​​​​​作​​​​​​​为​​​​​​​激​​​​​​​活​​​​​​​请​​​​​​​求​​​​​​​的​​​​​​​过​​​​​​​滤​​​​​​​器​​​​​​​使​​​​​​​用​​​​​​​(比​​​​​​​如​​​​​​​ vgchange -ay),且​​​​​​​只​​​​​​​激​​​​​​​活​​​​​​​ vg1/lvol0 以​​​​​​​及​​​​​​​那​​​​​​​些​​​​​​​在​​​​​​​该​​​​​​​主​​​​​​​机​​​​​​​的​​​​​​​元​​​​​​​数​​​​​​​据​​​​​​​中​​​​​​​带​​​​​​​ database 标​​​​​​​签​​​​​​​的​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​和​​​​​​​卷​​​​​​​组​​​​​​​。​​​​​​​
activation { volume_list = ["vg1/lvol0", "@database" ] }
There is a special match "@*" that causes a match only if any metadata tag matches any host tag on that machine.
另​​​​​​​一​​​​​​​个​​​​​​​例​​​​​​​子​​​​​​​就​​​​​​​是​​​​​​​,考​​​​​​​虑​​​​​​​一​​​​​​​下​​​​​​​,在​​​​​​​哪​​​​​​​里​​​​​​​群​​​​​​​集​​​​​​​中​​​​​​​的​​​​​​​每​​​​​​​一​​​​​​​台​​​​​​​机​​​​​​​器​​​​​​​都​​​​​​​在​​​​​​​配​​​​​​​置​​​​​​​文​​​​​​​件​​​​​​​中​​​​​​​有​​​​​​​以​​​​​​​下​​​​​​​条​​​​​​​目​​​​​​​:
tags { hosttags = 1 }
如​​​​​​​果​​​​​​​您​​​​​​​想​​​​​​​要​​​​​​​只​​​​​​​在​​​​​​​主​​​​​​​机​​​​​​​ db2 中​​​​​​​激​​​​​​​活​​​​​​​ vg1/lvol2,请​​​​​​​执​​​​​​​行​​​​​​​以​​​​​​​下​​​​​​​操​​​​​​​作​​​​​​​:
  1. 可​​​​​​​从​​​​​​​群​​​​​​​集​​​​​​​中​​​​​​​的​​​​​​​任​​​​​​​意​​​​​​​主​​​​​​​机​​​​​​​运​​​​​​​行​​​​​​​ lvchange --addtag @db2 vg1/lvol2。​​​​​​​
  2. 运​​​​​​​行​​​​​​​ lvchange -ay vg1/lvol2。​​​​​​​
这​​​​​​​个​​​​​​​解​​​​​​​决​​​​​​​方​​​​​​​案​​​​​​​包​​​​​​​括​​​​​​​将​​​​​​​主​​​​​​​机​​​​​​​名​​​​​​​保​​​​​​​存​​​​​​​在​​​​​​​卷​​​​​​​组​​​​​​​元​​​​​​​数​​​​​​​据​​​​​​​中​​​​​​​。​​​​​​​

附录 D. LVM 卷​​​​​​​组​​​​​​​元​​​​​​​数​​​​​​​据​​​​​​​

卷​​​​​​​组​​​​​​​的​​​​​​​配​​​​​​​置​​​​​​​详​​​​​​​情​​​​​​​就​​​​​​​是​​​​​​​元​​​​​​​数​​​​​​​据​​​​​​​。​​​​​​​默​​​​​​​认​​​​​​​情​​​​​​​况​​​​​​​是​​​​​​​在​​​​​​​卷​​​​​​​组​​​​​​​的​​​​​​​每​​​​​​​个​​​​​​​物​​​​​​​理​​​​​​​卷​​​​​​​的​​​​​​​元​​​​​​​数​​​​​​​据​​​​​​​区​​​​​​​域​​​​​​​都​​​​​​​会​​​​​​​保​​​​​​​存​​​​​​​一​​​​​​​个​​​​​​​相​​​​​​​同​​​​​​​的​​​​​​​元​​​​​​​数​​​​​​​据​​​​​​​备​​​​​​​份​​​​​​​。​​​​​​​LVM 元​​​​​​​数​​​​​​​据​​​​​​​很​​​​​​​小​​​​​​​,它​​​​​​​以​​​​​​​ ASCII 格​​​​​​​式​​​​​​​保​​​​​​​存​​​​​​​。​​​​​​​
如​​​​​​​果​​​​​​​卷​​​​​​​组​​​​​​​包​​​​​​​含​​​​​​​很​​​​​​​多​​​​​​​物​​​​​​​理​​​​​​​卷​​​​​​​,那​​​​​​​么​​​​​​​有​​​​​​​很​​​​​​​多​​​​​​​元​​​​​​​数​​​​​​​据​​​​​​​的​​​​​​​冗​​​​​​​余​​​​​​​副​​​​​​​本​​​​​​​不​​​​​​​是​​​​​​​很​​​​​​​有​​​​​​​效​​​​​​​。​​​​​​​您​​​​​​​可​​​​​​​以​​​​​​​使​​​​​​​用​​​​​​​ pvcreate 命​​​​​​​令​​​​​​​的​​​​​​​ --metadatacopies 0 选​​​​​​​项​​​​​​​创​​​​​​​建​​​​​​​没​​​​​​​有​​​​​​​任​​​​​​​何​​​​​​​元​​​​​​​数​​​​​​​据​​​​​​​副​​​​​​​本​​​​​​​的​​​​​​​物​​​​​​​理​​​​​​​卷​​​​​​​。​​​​​​​一​​​​​​​旦​​​​​​​您​​​​​​​选​​​​​​​择​​​​​​​了​​​​​​​物​​​​​​​理​​​​​​​卷​​​​​​​将​​​​​​​包​​​​​​​含​​​​​​​的​​​​​​​元​​​​​​​数​​​​​​​据​​​​​​​副​​​​​​​本​​​​​​​的​​​​​​​数​​​​​​​目​​​​​​​,您​​​​​​​将​​​​​​​无​​​​​​​法​​​​​​​修​​​​​​​改​​​​​​​它​​​​​​​。​​​​​​​选​​​​​​​择​​​​​​​零​​​​​​​副​​​​​​​本​​​​​​​将​​​​​​​在​​​​​​​修​​​​​​​改​​​​​​​配​​​​​​​置​​​​​​​时​​​​​​​提​​​​​​​高​​​​​​​更​​​​​​​新​​​​​​​速​​​​​​​度​​​​​​​。​​​​​​​注​​​​​​​意​​​​​​​:虽​​​​​​​然​​​​​​​任​​​​​​​何​​​​​​​时​​​​​​​候​​​​​​​每​​​​​​​个​​​​​​​卷​​​​​​​组​​​​​​​必​​​​​​​须​​​​​​​至​​​​​​​少​​​​​​​包​​​​​​​含​​​​​​​一​​​​​​​个​​​​​​​带​​​​​​​元​​​​​​​数​​​​​​​据​​​​​​​区​​​​​​​域​​​​​​​的​​​​​​​物​​​​​​​理​​​​​​​卷​​​​​​​(除​​​​​​​非​​​​​​​您​​​​​​​使​​​​​​​用​​​​​​​高​​​​​​​级​​​​​​​配​​​​​​​置​​​​​​​设​​​​​​​置​​​​​​​允​​​​​​​许​​​​​​​您​​​​​​​在​​​​​​​文​​​​​​​件​​​​​​​系​​​​​​​统​​​​​​​中​​​​​​​保​​​​​​​存​​​​​​​卷​​​​​​​组​​​​​​​元​​​​​​​数​​​​​​​据​​​​​​​)。​​​​​​​如​​​​​​​果​​​​​​​您​​​​​​​试​​​​​​​图​​​​​​​在​​​​​​​将​​​​​​​来​​​​​​​分​​​​​​​割​​​​​​​卷​​​​​​​组​​​​​​​,那​​​​​​​么​​​​​​​每​​​​​​​个​​​​​​​卷​​​​​​​组​​​​​​​至​​​​​​​少​​​​​​​需​​​​​​​要​​​​​​​一​​​​​​​个​​​​​​​元​​​​​​​数​​​​​​​据​​​​​​​副​​​​​​​本​​​​​​​。​​​​​​​
核​​​​​​​心​​​​​​​元​​​​​​​数​​​​​​​据​​​​​​​以​​​​​​​ ASCII 格​​​​​​​式​​​​​​​保​​​​​​​存​​​​​​​。​​​​​​​元​​​​​​​数​​​​​​​据​​​​​​​区​​​​​​​域​​​​​​​是​​​​​​​一​​​​​​​个​​​​​​​环​​​​​​​形​​​​​​​缓​​​​​​​冲​​​​​​​。​​​​​​​新​​​​​​​的​​​​​​​元​​​​​​​数​​​​​​​据​​​​​​​会​​​​​​​附​​​​​​​加​​​​​​​在​​​​​​​旧​​​​​​​的​​​​​​​元​​​​​​​数​​​​​​​据​​​​​​​之​​​​​​​后​​​​​​​,然​​​​​​​后​​​​​​​会​​​​​​​更​​​​​​​新​​​​​​​开​​​​​​​始​​​​​​​的​​​​​​​指​​​​​​​示​​​​​​​点​​​​​​​。​​​​​​​
您​​​​​​​可​​​​​​​以​​​​​​​使​​​​​​​用​​​​​​​ pvcreate 命​​​​​​​令​​​​​​​ --metadatasize 选​​​​​​​项​​​​​​​指​​​​​​​定​​​​​​​元​​​​​​​数​​​​​​​据​​​​​​​区​​​​​​​域​​​​​​​的​​​​​​​大​​​​​​​小​​​​​​​。​​​​​​​默​​​​​​​认​​​​​​​的​​​​​​​大​​​​​​​小​​​​​​​对​​​​​​​于​​​​​​​有​​​​​​​很​​​​​​​多​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​或​​​​​​​者​​​​​​​物​​​​​​​理​​​​​​​卷​​​​​​​的​​​​​​​卷​​​​​​​组​​​​​​​来​​​​​​​说​​​​​​​太​​​​​​​小​​​​​​​了​​​​​​​。​​​​​​​

D.1. 物​​​​​​​理​​​​​​​卷​​​​​​​标​​​​​​​签​​​​​​​

默​​​​​​​认​​​​​​​情​​​​​​​况​​​​​​​下​​​​​​​,pvcreate 命​​​​​​​令​​​​​​​会​​​​​​​在​​​​​​​第​​​​​​​二​​​​​​​个​​​​​​​ 512 字​​​​​​​节​​​​​​​部​​​​​​​分​​​​​​​放​​​​​​​置​​​​​​​物​​​​​​​理​​​​​​​卷​​​​​​​标​​​​​​​签​​​​​​​。​​​​​​​这​​​​​​​个​​​​​​​标​​​​​​​签​​​​​​​可​​​​​​​选​​​​​​​择​​​​​​​性​​​​​​​地​​​​​​​放​​​​​​​在​​​​​​​前​​​​​​​四​​​​​​​个​​​​​​​部​​​​​​​分​​​​​​​的​​​​​​​任​​​​​​​意​​​​​​​一​​​​​​​个​​​​​​​中​​​​​​​,因​​​​​​​为​​​​​​​扫​​​​​​​描​​​​​​​物​​​​​​​理​​​​​​​卷​​​​​​​标​​​​​​​签​​​​​​​的​​​​​​​ LVM 工​​​​​​​具​​​​​​​会​​​​​​​检​​​​​​​查​​​​​​​前​​​​​​​四​​​​​​​个​​​​​​​部​​​​​​​分​​​​​​​。​​​​​​​物​​​​​​​理​​​​​​​卷​​​​​​​标​​​​​​​签​​​​​​​以​​​​​​​字​​​​​​​符​​​​​​​串​​​​​​​ LABELONE 开​​​​​​​始​​​​​​​。​​​​​​​
物​​​​​​​理​​​​​​​卷​​​​​​​标​​​​​​​签​​​​​​​包​​​​​​​含​​​​​​​:
  • 物​​​​​​​理​​​​​​​卷​​​​​​​ UUID
  • 以​​​​​​​字​​​​​​​节​​​​​​​为​​​​​​​单​​​​​​​位​​​​​​​的​​​​​​​块​​​​​​​设​​​​​​​备​​​​​​​大​​​​​​​小​​​​​​​
  • 数​​​​​​​据​​​​​​​区​​​​​​​域​​​​​​​位​​​​​​​置​​​​​​​的​​​​​​​ NULL 终​​​​​​​止​​​​​​​列​​​​​​​表​​​​​​​
  • 元​​​​​​​数​​​​​​​据​​​​​​​区​​​​​​​域​​​​​​​位​​​​​​​置​​​​​​​的​​​​​​​ NULL 终​​​​​​​止​​​​​​​列​​​​​​​表​​​​​​​
元​​​​​​​数​​​​​​​据​​​​​​​位​​​​​​​置​​​​​​​以​​​​​​​偏​​​​​​​差​​​​​​​和​​​​​​​大​​​​​​​小​​​​​​​(字​​​​​​​节​​​​​​​)形​​​​​​​式​​​​​​​保​​​​​​​存​​​​​​​。​​​​​​​标​​​​​​​签​​​​​​​中​​​​​​​有​​​​​​​大​​​​​​​约​​​​​​​ 15 个​​​​​​​位​​​​​​​置​​​​​​​的​​​​​​​空​​​​​​​间​​​​​​​,但​​​​​​​ LVM 工​​​​​​​具​​​​​​​目​​​​​​​前​​​​​​​仅​​​​​​​使​​​​​​​用​​​​​​​ 3: 这​​​​​​​个​​​​​​​单​​​​​​​数​​​​​​​据​​​​​​​区​​​​​​​域​​​​​​​以​​​​​​​及​​​​​​​最​​​​​​​多​​​​​​​两​​​​​​​个​​​​​​​元​​​​​​​数​​​​​​​据​​​​​​​区​​​​​​​域​​​​​​​。​​​​​​​

D.2. 元​​​​​​​数​​​​​​​据​​​​​​​内​​​​​​​容​​​​​​​

卷​​​​​​​组​​​​​​​元​​​​​​​数​​​​​​​据​​​​​​​包​​​​​​​含​​​​​​​:
  • 何​​​​​​​时​​​​​​​以​​​​​​​及​​​​​​​如​​​​​​​何​​​​​​​创​​​​​​​建​​​​​​​该​​​​​​​卷​​​​​​​组​​​​​​​的​​​​​​​信​​​​​​​息​​​​​​​
  • 卷​​​​​​​组​​​​​​​信​​​​​​​息​​​​​​​:
卷​​​​​​​组​​​​​​​信​​​​​​​息​​​​​​​包​​​​​​​括​​​​​​​:
  • 名​​​​​​​称​​​​​​​和​​​​​​​唯​​​​​​​一​​​​​​​ id
  • 无​​​​​​​论​​​​​​​何​​​​​​​时​​​​​​​更​​​​​​​新​​​​​​​元​​​​​​​数​​​​​​​据​​​​​​​时​​​​​​​增​​​​​​​大​​​​​​​的​​​​​​​版​​​​​​​本​​​​​​​数​​​​​​​目​​​​​​​
  • 任​​​​​​​意​​​​​​​属​​​​​​​性​​​​​​​:读​​​​​​​/写​​​​​​​?可​​​​​​​重​​​​​​​新​​​​​​​定​​​​​​​义​​​​​​​大​​​​​​​小​​​​​​​?
  • 它​​​​​​​可​​​​​​​能​​​​​​​包​​​​​​​含​​​​​​​的​​​​​​​所​​​​​​​有​​​​​​​对​​​​​​​物​​​​​​​理​​​​​​​卷​​​​​​​和​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​数​​​​​​​量​​​​​​​的​​​​​​​管​​​​​​​理​​​​​​​限​​​​​​​制​​​​​​​
  • 扩​​​​​​​展​​​​​​​大​​​​​​​小​​​​​​​(以​​​​​​​扇​​​​​​​区​​​​​​​为​​​​​​​单​​​​​​​位​​​​​​​,大​​​​​​​小​​​​​​​为​​​​​​​ 512 字​​​​​​​节​​​​​​​)
  • 一​​​​​​​个​​​​​​​没​​​​​​​有​​​​​​​排​​​​​​​序​​​​​​​的​​​​​​​物​​​​​​​理​​​​​​​卷​​​​​​​列​​​​​​​表​​​​​​​组​​​​​​​成​​​​​​​卷​​​​​​​组​​​​​​​,每​​​​​​​个​​​​​​​都​​​​​​​带​​​​​​​有​​​​​​​:
    • 它​​​​​​​的​​​​​​​ UUID,用​​​​​​​来​​​​​​​决​​​​​​​定​​​​​​​包​​​​​​​含​​​​​​​它​​​​​​​的​​​​​​​块​​​​​​​设​​​​​​​备​​​​​​​
    • 所​​​​​​​有​​​​​​​属​​​​​​​性​​​​​​​,比​​​​​​​如​​​​​​​物​​​​​​​理​​​​​​​卷​​​​​​​是​​​​​​​否​​​​​​​可​​​​​​​分​​​​​​​配​​​​​​​
    • 在​​​​​​​物​​​​​​​理​​​​​​​卷​​​​​​​中​​​​​​​第​​​​​​​一​​​​​​​个​​​​​​​扩​​​​​​​展​​​​​​​的​​​​​​​开​​​​​​​始​​​​​​​调​​​​​​​节​​​​​​​(在​​​​​​​扇​​​​​​​区​​​​​​​中​​​​​​​)
    • 扩​​​​​​​展​​​​​​​的​​​​​​​数​​​​​​​目​​​​​​​
  • 没​​​​​​​有​​​​​​​配​​​​​​​需​​​​​​​的​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​列​​​​​​​表​​​​​​​,每​​​​​​​个​​​​​​​都​​​​​​​包​​​​​​​含​​​​​​​
    • 排​​​​​​​序​​​​​​​的​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​片​​​​​​​段​​​​​​​列​​​​​​​表​​​​​​​。​​​​​​​每​​​​​​​个​​​​​​​片​​​​​​​段​​​​​​​的​​​​​​​元​​​​​​​数​​​​​​​据​​​​​​​都​​​​​​​包​​​​​​​括​​​​​​​用​​​​​​​于​​​​​​​排​​​​​​​序​​​​​​​的​​​​​​​物​​​​​​​理​​​​​​​卷​​​​​​​片​​​​​​​段​​​​​​​或​​​​​​​者​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​片​​​​​​​段​​​​​​​的​​​​​​​映​​​​​​​射​​​​​​​

D.3. 元​​​​​​​数​​​​​​​据​​​​​​​示​​​​​​​例​​​​​​​

以​​​​​​​下​​​​​​​显​​​​​​​示​​​​​​​了​​​​​​​名​​​​​​​为​​​​​​​ myvg 的​​​​​​​卷​​​​​​​组​​​​​​​的​​​​​​​ LVM 卷​​​​​​​组​​​​​​​元​​​​​​​数​​​​​​​据​​​​​​​示​​​​​​​例​​​​​​​。​​​​​​​
# Generated by LVM2: Tue Jan 30 16:28:15 2007

contents = "Text Format Volume Group"
version = 1

description = "Created *before* executing 'lvextend -L+5G /dev/myvg/mylv /dev/sdc'"

creation_host = "tng3-1"        # Linux tng3-1 2.6.18-8.el5 #1 SMP Fri Jan 26 14:15:21 EST 2007 i686
creation_time = 1170196095      # Tue Jan 30 16:28:15 2007

myvg {
        id = "0zd3UT-wbYT-lDHq-lMPs-EjoE-0o18-wL28X4"
        seqno = 3
        status = ["RESIZEABLE", "READ", "WRITE"]
        extent_size = 8192              # 4 Megabytes
        max_lv = 0
        max_pv = 0

        physical_volumes {

                pv0 {
                        id = "ZBW5qW-dXF2-0bGw-ZCad-2RlV-phwu-1c1RFt"
                        device = "/dev/sda"     # Hint only

                        status = ["ALLOCATABLE"]
                        dev_size = 35964301     # 17.1491 Gigabytes
                        pe_start = 384
                        pe_count = 4390 # 17.1484 Gigabytes
                }

                pv1 {
                        id = "ZHEZJW-MR64-D3QM-Rv7V-Hxsa-zU24-wztY19"
                        device = "/dev/sdb"     # Hint only

                        status = ["ALLOCATABLE"]
                        dev_size = 35964301     # 17.1491 Gigabytes
                        pe_start = 384
                        pe_count = 4390 # 17.1484 Gigabytes
                }

                pv2 {
                        id = "wCoG4p-55Ui-9tbp-VTEA-jO6s-RAVx-UREW0G"
                        device = "/dev/sdc"     # Hint only

                        status = ["ALLOCATABLE"]
                        dev_size = 35964301     # 17.1491 Gigabytes
                        pe_start = 384
                        pe_count = 4390 # 17.1484 Gigabytes
                }

                pv3 {
                        id = "hGlUwi-zsBg-39FF-do88-pHxY-8XA2-9WKIiA"
                        device = "/dev/sdd"     # Hint only

                        status = ["ALLOCATABLE"]
                        dev_size = 35964301     # 17.1491 Gigabytes
                        pe_start = 384
                        pe_count = 4390 # 17.1484 Gigabytes
                }
        }
        logical_volumes {

                mylv {
                        id = "GhUYSF-qVM3-rzQo-a6D2-o0aV-LQet-Ur9OF9"
                        status = ["READ", "WRITE", "VISIBLE"]
                        segment_count = 2

                        segment1 {
                                start_extent = 0
                                extent_count = 1280     # 5 Gigabytes

                                type = "striped"
                                stripe_count = 1        # linear

                                stripes = [
                                        "pv0", 0
                                ]
                        }
                        segment2 {
                                start_extent = 1280
                                extent_count = 1280     # 5 Gigabytes

                                type = "striped"
                                stripe_count = 1        # linear

                                stripes = [
                                        "pv1", 0
                                ]
                        }
                }
        }
}

附录 E. 修​​​​​​​订​​​​​​​记​​​​​​​录​​​​​​​

修订历史
修订 3-6.4002013-10-31Rüdiger Landmann
Rebuild with publican 4.0.0
修订 3-62012-07-18Anthony Towns
Rebuild for Publican 3.0
修订 1.0-0Thu Jan 29 2009

索引

A

activating logical volumes
individual nodes,在​​​​​​​群​​​​​​​集​​​​​​​的​​​​​​​独​​​​​​​立​​​​​​​节​​​​​​​点​​​​​​​中​​​​​​​激​​​​​​​活​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​
activating volume groups,激​​​​​​​活​​​​​​​和​​​​​​​失​​​​​​​活​​​​​​​卷​​​​​​​组​​​​​​​
individual nodes,激​​​​​​​活​​​​​​​和​​​​​​​失​​​​​​​活​​​​​​​卷​​​​​​​组​​​​​​​
local node only,激​​​​​​​活​​​​​​​和​​​​​​​失​​​​​​​活​​​​​​​卷​​​​​​​组​​​​​​​
administrative procedures,LVM 管​​​​​​​理​​​​​​​总​​​​​​​览​​​​​​​
allocation
policy,创​​​​​​​建​​​​​​​卷​​​​​​​组​​​​​​​
preventing,防​​​​​​​止​​​​​​​在​​​​​​​物​​​​​​​理​​​​​​​卷​​​​​​​中​​​​​​​进​​​​​​​行​​​​​​​分​​​​​​​配​​​​​​​
archive file,逻​​​​​​​辑​​​​​​​卷​​​​​​​备​​​​​​​份​​​​​​​备​​​​​​​份​​​​​​​卷​​​​​​​组​​​​​​​元​​​​​​​数​​​​​​​据​​​​​​​

C

cache file
building,为​​​​​​​卷​​​​​​​组​​​​​​​扫​​​​​​​描​​​​​​​磁​​​​​​​盘​​​​​​​来​​​​​​​建​​​​​​​立​​​​​​​缓​​​​​​​存​​​​​​​文​​​​​​​件​​​​​​​
cluster environment,群​​​​​​​集​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​管​​​​​​​理​​​​​​​器​​​​​​​(CLVM)在​​​​​​​群​​​​​​​集​​​​​​​中​​​​​​​创​​​​​​​建​​​​​​​ LVM 卷​​​​​​​
CLVM
definition,群​​​​​​​集​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​管​​​​​​​理​​​​​​​器​​​​​​​(CLVM)
clvmd daemon,群​​​​​​​集​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​管​​​​​​​理​​​​​​​器​​​​​​​(CLVM)
command line units,使​​​​​​​用​​​​​​​ CLI 命​​​​​​​令​​​​​​​
configuration examples,LVM 配​​​​​​​置​​​​​​​示​​​​​​​例​​​​​​​
creating
logical volume,创​​​​​​​建​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​
logical volume, example,在​​​​​​​三​​​​​​​个​​​​​​​磁​​​​​​​盘​​​​​​​中​​​​​​​创​​​​​​​建​​​​​​​ LVM 逻​​​​​​​辑​​​​​​​卷​​​​​​​
LVM volumes in a cluster,在​​​​​​​群​​​​​​​集​​​​​​​中​​​​​​​创​​​​​​​建​​​​​​​ LVM 卷​​​​​​​
physical volumes,创​​​​​​​建​​​​​​​物​​​​​​​理​​​​​​​卷​​​​​​​
striped logical volume, example,创​​​​​​​建​​​​​​​条​​​​​​​状​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​
volume group, clustered,在​​​​​​​群​​​​​​​集​​​​​​​中​​​​​​​创​​​​​​​建​​​​​​​卷​​​​​​​组​​​​​​​
volume groups,创​​​​​​​建​​​​​​​卷​​​​​​​组​​​​​​​
creating LVM volumes
overview,创​​​​​​​建​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​总​​​​​​​览​​​​​​​

D

data relocation, online,在​​​​​​​线​​​​​​​数​​​​​​​据​​​​​​​重​​​​​​​定​​​​​​​位​​​​​​​
deactivating volume groups,激​​​​​​​活​​​​​​​和​​​​​​​失​​​​​​​活​​​​​​​卷​​​​​​​组​​​​​​​
exclusive on one node,激​​​​​​​活​​​​​​​和​​​​​​​失​​​​​​​活​​​​​​​卷​​​​​​​组​​​​​​​
local node only,激​​​​​​​活​​​​​​​和​​​​​​​失​​​​​​​活​​​​​​​卷​​​​​​​组​​​​​​​
device numbers
major,持​​​​​​​久​​​​​​​的​​​​​​​设​​​​​​​备​​​​​​​号​​​​​​​码​​​​​​​
minor,持​​​​​​​久​​​​​​​的​​​​​​​设​​​​​​​备​​​​​​​号​​​​​​​码​​​​​​​
persistent,持​​​​​​​久​​​​​​​的​​​​​​​设​​​​​​​备​​​​​​​号​​​​​​​码​​​​​​​
device path names,使​​​​​​​用​​​​​​​ CLI 命​​​​​​​令​​​​​​​
device scan filters,用​​​​​​​过​​​​​​​滤​​​​​​​器​​​​​​​控​​​​​​​制​​​​​​​ LVM 设​​​​​​​备​​​​​​​扫​​​​​​​描​​​​​​​
device size, maximum,创​​​​​​​建​​​​​​​卷​​​​​​​组​​​​​​​
device special file directory,创​​​​​​​建​​​​​​​卷​​​​​​​组​​​​​​​
display
sorting output,LVM 报​​​​​​​告​​​​​​​排​​​​​​​序​​​​​​​
displaying
logical volumes,显​​​​​​​示​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​lvs 命​​​​​​​令​​​​​​​
physical volumes,显​​​​​​​示​​​​​​​物​​​​​​​理​​​​​​​卷​​​​​​​pvs 命​​​​​​​令​​​​​​​
volume groups,显​​​​​​​示​​​​​​​卷​​​​​​​组​​​​​​​vgs 命​​​​​​​令​​​​​​​

L

linear logical volume
converting to mirrored,修​​​​​​​改​​​​​​​镜​​​​​​​像​​​​​​​卷​​​​​​​配​​​​​​​置​​​​​​​
creation,创​​​​​​​建​​​​​​​线​​​​​​​性​​​​​​​卷​​​​​​​
definition,线​​​​​​​性​​​​​​​卷​​​​​​​
logging,日​​​​​​​志​​​​​​​
logical volume
administration, general,逻​​​​​​​辑​​​​​​​卷​​​​​​​管​​​​​​​理​​​​​​​
changing parameters,修​​​​​​​改​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​组​​​​​​​的​​​​​​​参​​​​​​​数​​​​​​​
creation,创​​​​​​​建​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​
creation example,在​​​​​​​三​​​​​​​个​​​​​​​磁​​​​​​​盘​​​​​​​中​​​​​​​创​​​​​​​建​​​​​​​ LVM 逻​​​​​​​辑​​​​​​​卷​​​​​​​
definition,逻​​​​​​​辑​​​​​​​卷​​​​​​​LVM 逻​​​​​​​辑​​​​​​​卷​​​​​​​
displaying,显​​​​​​​示​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​为​​​​​​​ LVM 自​​​​​​​定​​​​​​​义​​​​​​​报​​​​​​​告​​​​​​​lvs 命​​​​​​​令​​​​​​​
exclusive access,在​​​​​​​群​​​​​​​集​​​​​​​的​​​​​​​独​​​​​​​立​​​​​​​节​​​​​​​点​​​​​​​中​​​​​​​激​​​​​​​活​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​
extending,增​​​​​​​大​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​
growing,增​​​​​​​大​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​
linear,创​​​​​​​建​​​​​​​线​​​​​​​性​​​​​​​卷​​​​​​​
local access,在​​​​​​​群​​​​​​​集​​​​​​​的​​​​​​​独​​​​​​​立​​​​​​​节​​​​​​​点​​​​​​​中​​​​​​​激​​​​​​​活​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​
lvs display arguments,lvs 命​​​​​​​令​​​​​​​
mirrored,创​​​​​​​建​​​​​​​镜​​​​​​​像​​​​​​​卷​​​​​​​
reducing,缩​​​​​​​小​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​
removing,删​​​​​​​除​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​
renaming,重​​​​​​​新​​​​​​​命​​​​​​​名​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​
resizing,重​​​​​​​新​​​​​​​设​​​​​​​定​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​大​​​​​​​小​​​​​​​
shrinking,缩​​​​​​​小​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​
snapshot,创​​​​​​​建​​​​​​​快​​​​​​​照​​​​​​​卷​​​​​​​
striped,创​​​​​​​建​​​​​​​条​​​​​​​状​​​​​​​卷​​​​​​​
lvchange command,修​​​​​​​改​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​组​​​​​​​的​​​​​​​参​​​​​​​数​​​​​​​
lvconvert command,修​​​​​​​改​​​​​​​镜​​​​​​​像​​​​​​​卷​​​​​​​配​​​​​​​置​​​​​​​
lvcreate command,创​​​​​​​建​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​
lvdisplay command,显​​​​​​​示​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​
lvextend command,增​​​​​​​大​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​
LVM
architecture overview,LVM 构​​​​​​​架​​​​​​​总​​​​​​​览​​​​​​​
clustered,群​​​​​​​集​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​管​​​​​​​理​​​​​​​器​​​​​​​(CLVM)
components,LVM 构​​​​​​​架​​​​​​​总​​​​​​​览​​​​​​​LVM 组​​​​​​​成​​​​​​​
custom report format,为​​​​​​​ LVM 自​​​​​​​定​​​​​​​义​​​​​​​报​​​​​​​告​​​​​​​
directory structure,创​​​​​​​建​​​​​​​卷​​​​​​​组​​​​​​​
help,使​​​​​​​用​​​​​​​ CLI 命​​​​​​​令​​​​​​​
history,LVM 构​​​​​​​架​​​​​​​总​​​​​​​览​​​​​​​
label,物​​​​​​​理​​​​​​​卷​​​​​​​
logging,日​​​​​​​志​​​​​​​
logical volume administration,逻​​​​​​​辑​​​​​​​卷​​​​​​​管​​​​​​​理​​​​​​​
physical volume administration,物​​​​​​​理​​​​​​​卷​​​​​​​管​​​​​​​理​​​​​​​
physical volume, definition,物​​​​​​​理​​​​​​​卷​​​​​​​
volume group, definition,卷​​​​​​​组​​​​​​​
LVM1,LVM 构​​​​​​​架​​​​​​​总​​​​​​​览​​​​​​​
LVM2,LVM 构​​​​​​​架​​​​​​​总​​​​​​​览​​​​​​​
lvmdiskscan command,扫​​​​​​​描​​​​​​​块​​​​​​​设​​​​​​​备​​​​​​​
lvreduce command,重​​​​​​​新​​​​​​​设​​​​​​​定​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​大​​​​​​​小​​​​​​​缩​​​​​​​小​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​
lvremove command,删​​​​​​​除​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​
lvrename command,重​​​​​​​新​​​​​​​命​​​​​​​名​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​
lvs command,为​​​​​​​ LVM 自​​​​​​​定​​​​​​​义​​​​​​​报​​​​​​​告​​​​​​​lvs 命​​​​​​​令​​​​​​​
display arguments,lvs 命​​​​​​​令​​​​​​​
lvscan command,显​​​​​​​示​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​

P

partition type, setting,设​​​​​​​定​​​​​​​分​​​​​​​区​​​​​​​类​​​​​​​型​​​​​​​
partitions
multiple,一​​​​​​​个​​​​​​​磁​​​​​​​盘​​​​​​​中​​​​​​​有​​​​​​​多​​​​​​​个​​​​​​​分​​​​​​​区​​​​​​​
path names,使​​​​​​​用​​​​​​​ CLI 命​​​​​​​令​​​​​​​
persistent device numbers,持​​​​​​​久​​​​​​​的​​​​​​​设​​​​​​​备​​​​​​​号​​​​​​​码​​​​​​​
physical extent
preventing allocation,防​​​​​​​止​​​​​​​在​​​​​​​物​​​​​​​理​​​​​​​卷​​​​​​​中​​​​​​​进​​​​​​​行​​​​​​​分​​​​​​​配​​​​​​​
physical volume
adding to a volume group,在​​​​​​​卷​​​​​​​组​​​​​​​中​​​​​​​添​​​​​​​加​​​​​​​物​​​​​​​理​​​​​​​卷​​​​​​​
administration, general,物​​​​​​​理​​​​​​​卷​​​​​​​管​​​​​​​理​​​​​​​
creating,创​​​​​​​建​​​​​​​物​​​​​​​理​​​​​​​卷​​​​​​​
definition,物​​​​​​​理​​​​​​​卷​​​​​​​
display,pvs 命​​​​​​​令​​​​​​​
displaying,显​​​​​​​示​​​​​​​物​​​​​​​理​​​​​​​卷​​​​​​​为​​​​​​​ LVM 自​​​​​​​定​​​​​​​义​​​​​​​报​​​​​​​告​​​​​​​
illustration,LVM Physical Volume Layout
initializing,初​​​​​​​始​​​​​​​化​​​​​​​物​​​​​​​理​​​​​​​卷​​​​​​​
layout,LVM Physical Volume Layout
pvs display arguments,pvs 命​​​​​​​令​​​​​​​
recovery,替​​​​​​​换​​​​​​​丢​​​​​​​失​​​​​​​的​​​​​​​物​​​​​​​理​​​​​​​卷​​​​​​​
removing,删​​​​​​​除​​​​​​​物​​​​​​​理​​​​​​​卷​​​​​​​
removing from volume group,从​​​​​​​卷​​​​​​​组​​​​​​​中​​​​​​​删​​​​​​​除​​​​​​​物​​​​​​​理​​​​​​​卷​​​​​​​
removing lost volume,从​​​​​​​卷​​​​​​​组​​​​​​​中​​​​​​​删​​​​​​​除​​​​​​​丢​​​​​​​失​​​​​​​的​​​​​​​物​​​​​​​理​​​​​​​卷​​​​​​​。​​​​​​​
resizing,重​​​​​​​新​​​​​​​设​​​​​​​置​​​​​​​物​​​​​​​理​​​​​​​卷​​​​​​​大​​​​​​​小​​​​​​​
pvdisplay command,显​​​​​​​示​​​​​​​物​​​​​​​理​​​​​​​卷​​​​​​​
pvmove command,在​​​​​​​线​​​​​​​数​​​​​​​据​​​​​​​重​​​​​​​定​​​​​​​位​​​​​​​
pvremove command,删​​​​​​​除​​​​​​​物​​​​​​​理​​​​​​​卷​​​​​​​
pvresize command,重​​​​​​​新​​​​​​​设​​​​​​​置​​​​​​​物​​​​​​​理​​​​​​​卷​​​​​​​大​​​​​​​小​​​​​​​
pvs command,为​​​​​​​ LVM 自​​​​​​​定​​​​​​​义​​​​​​​报​​​​​​​告​​​​​​​
display arguments,pvs 命​​​​​​​令​​​​​​​
pvscan command,显​​​​​​​示​​​​​​​物​​​​​​​理​​​​​​​卷​​​​​​​

R

removing
disk from a logical volume,从​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​中​​​​​​​删​​​​​​​除​​​​​​​磁​​​​​​​盘​​​​​​​
logical volume,删​​​​​​​除​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​
physical volumes,删​​​​​​​除​​​​​​​物​​​​​​​理​​​​​​​卷​​​​​​​
renaming
logical volume,重​​​​​​​新​​​​​​​命​​​​​​​名​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​
volume group,重​​​​​​​命​​​​​​​名​​​​​​​卷​​​​​​​组​​​​​​​
report format, LVM devices,为​​​​​​​ LVM 自​​​​​​​定​​​​​​​义​​​​​​​报​​​​​​​告​​​​​​​
resizing
logical volume,重​​​​​​​新​​​​​​​设​​​​​​​定​​​​​​​逻​​​​​​​辑​​​​​​​卷​​​​​​​大​​​​​​​小​​​​​​​
physical volume,重​​​​​​​新​​​​​​​设​​​​​​​置​​​​​​​物​​​​​​​理​​​​​​​卷​​​​​​​大​​​​​​​小​​​​​​​

V

verbose output,使​​​​​​​用​​​​​​​ CLI 命​​​​​​​令​​​​​​​
vgcfbackup command,备​​​​​​​份​​​​​​​卷​​​​​​​组​​​​​​​元​​​​​​​数​​​​​​​据​​​​​​​
vgcfrestore command,备​​​​​​​份​​​​​​​卷​​​​​​​组​​​​​​​元​​​​​​​数​​​​​​​据​​​​​​​
vgchange command,修​​​​​​​改​​​​​​​卷​​​​​​​组​​​​​​​参​​​​​​​数​​​​​​​
vgcreate command,创​​​​​​​建​​​​​​​卷​​​​​​​组​​​​​​​在​​​​​​​群​​​​​​​集​​​​​​​中​​​​​​​创​​​​​​​建​​​​​​​卷​​​​​​​组​​​​​​​
vgdisplay command,显​​​​​​​示​​​​​​​卷​​​​​​​组​​​​​​​
vgexport command,将​​​​​​​卷​​​​​​​组​​​​​​​移​​​​​​​动​​​​​​​到​​​​​​​其​​​​​​​它​​​​​​​系​​​​​​​统​​​​​​​中​​​​​​​
vgextend command,在​​​​​​​卷​​​​​​​组​​​​​​​中​​​​​​​添​​​​​​​加​​​​​​​物​​​​​​​理​​​​​​​卷​​​​​​​
vgimport command,将​​​​​​​卷​​​​​​​组​​​​​​​移​​​​​​​动​​​​​​​到​​​​​​​其​​​​​​​它​​​​​​​系​​​​​​​统​​​​​​​中​​​​​​​
vgmerge command,合​​​​​​​并​​​​​​​卷​​​​​​​组​​​​​​​
vgmknodes command,重​​​​​​​新​​​​​​​创​​​​​​​建​​​​​​​卷​​​​​​​组​​​​​​​目​​​​​​​录​​​​​​​
vgreduce command,从​​​​​​​卷​​​​​​​组​​​​​​​中​​​​​​​删​​​​​​​除​​​​​​​物​​​​​​​理​​​​​​​卷​​​​​​​
vgrename command,重​​​​​​​命​​​​​​​名​​​​​​​卷​​​​​​​组​​​​​​​
vgs command,为​​​​​​​ LVM 自​​​​​​​定​​​​​​​义​​​​​​​报​​​​​​​告​​​​​​​
display arguments,vgs 命​​​​​​​令​​​​​​​
vgscan command,为​​​​​​​卷​​​​​​​组​​​​​​​扫​​​​​​​描​​​​​​​磁​​​​​​​盘​​​​​​​来​​​​​​​建​​​​​​​立​​​​​​​缓​​​​​​​存​​​​​​​文​​​​​​​件​​​​​​​
vgsplit command,分​​​​​​​割​​​​​​​卷​​​​​​​组​​​​​​​
volume group
activating,激​​​​​​​活​​​​​​​和​​​​​​​失​​​​​​​活​​​​​​​卷​​​​​​​组​​​​​​​
administration, general,卷​​​​​​​组​​​​​​​管​​​​​​​理​​​​​​​
changing parameters,修​​​​​​​改​​​​​​​卷​​​​​​​组​​​​​​​参​​​​​​​数​​​​​​​
combining,合​​​​​​​并​​​​​​​卷​​​​​​​组​​​​​​​
creating,创​​​​​​​建​​​​​​​卷​​​​​​​组​​​​​​​
creating in a cluster,在​​​​​​​群​​​​​​​集​​​​​​​中​​​​​​​创​​​​​​​建​​​​​​​卷​​​​​​​组​​​​​​​
deactivating,激​​​​​​​活​​​​​​​和​​​​​​​失​​​​​​​活​​​​​​​卷​​​​​​​组​​​​​​​
definition,卷​​​​​​​组​​​​​​​
displaying,显​​​​​​​示​​​​​​​卷​​​​​​​组​​​​​​​为​​​​​​​ LVM 自​​​​​​​定​​​​​​​义​​​​​​​报​​​​​​​告​​​​​​​vgs 命​​​​​​​令​​​​​​​
extending,在​​​​​​​卷​​​​​​​组​​​​​​​中​​​​​​​添​​​​​​​加​​​​​​​物​​​​​​​理​​​​​​​卷​​​​​​​
growing,在​​​​​​​卷​​​​​​​组​​​​​​​中​​​​​​​添​​​​​​​加​​​​​​​物​​​​​​​理​​​​​​​卷​​​​​​​
merging,合​​​​​​​并​​​​​​​卷​​​​​​​组​​​​​​​
moving between systems,将​​​​​​​卷​​​​​​​组​​​​​​​移​​​​​​​动​​​​​​​到​​​​​​​其​​​​​​​它​​​​​​​系​​​​​​​统​​​​​​​中​​​​​​​
reducing,从​​​​​​​卷​​​​​​​组​​​​​​​中​​​​​​​删​​​​​​​除​​​​​​​物​​​​​​​理​​​​​​​卷​​​​​​​
removing,删​​​​​​​除​​​​​​​卷​​​​​​​组​​​​​​​
renaming,重​​​​​​​命​​​​​​​名​​​​​​​卷​​​​​​​组​​​​​​​
shrinking,从​​​​​​​卷​​​​​​​组​​​​​​​中​​​​​​​删​​​​​​​除​​​​​​​物​​​​​​​理​​​​​​​卷​​​​​​​
splitting,分​​​​​​​割​​​​​​​卷​​​​​​​组​​​​​​​
example procedure,分​​​​​​​割​​​​​​​卷​​​​​​​组​​​​​​​
vgs display arguments,vgs 命​​​​​​​令​​​​​​​

法律通告

Copyright © 2009 Red Hat Inc..
This document is licensed by Red Hat under the Creative Commons Attribution-ShareAlike 3.0 Unported License. If you distribute this document, or a modified version of it, you must provide attribution to Red Hat, Inc. and provide a link to the original. If the document is modified, all Red Hat trademarks must be removed.
Red Hat, as the licensor of this document, waives the right to enforce, and agrees not to assert, Section 4d of CC-BY-SA to the fullest extent permitted by applicable law.
Red Hat, Red Hat Enterprise Linux, the Shadowman logo, JBoss, OpenShift, Fedora, the Infinity logo, and RHCE are trademarks of Red Hat, Inc., registered in the United States and other countries.
Linux® is the registered trademark of Linus Torvalds in the United States and other countries.
Java® is a registered trademark of Oracle and/or its affiliates.
XFS® is a trademark of Silicon Graphics International Corp. or its subsidiaries in the United States and/or other countries.
MySQL® is a registered trademark of MySQL AB in the United States, the European Union and other countries.
Node.js® is an official trademark of Joyent. Red Hat Software Collections is not formally related to or endorsed by the official Joyent Node.js open source or commercial project.
The OpenStack® Word Mark and OpenStack logo are either registered trademarks/service marks or trademarks/service marks of the OpenStack Foundation, in the United States and other countries and are used with the OpenStack Foundation's permission. We are not affiliated with, endorsed or sponsored by the OpenStack Foundation, or the OpenStack community.
All other trademarks are the property of their respective owners.

为了尽快向用户提供最新的信息,本文档可能会包括由机器自动从英文原文翻译的内容。如需更多信息,请参阅此说明。