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