Red Hat Training

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

4.4.9. 延​​​​​​​伸​​​​​​​等​​​​​​​量​​​​​​​的​​​​​​​卷​​​​​​​冊​​​​​​​

若​​​​​​​要​​​​​​​增​​​​​​​加​​​​​​​等​​​​​​​量​​​​​​​邏​​​​​​​輯​​​​​​​卷​​​​​​​冊​​​​​​​的​​​​​​​大​​​​​​​小​​​​​​​,用​​​​​​​來​​​​​​​製​​​​​​​作​​​​​​​支​​​​​​​援​​​​​​​ stripe 的​​​​​​​卷​​​​​​​冊​​​​​​​群​​​​​​​組​​​​​​​的​​​​​​​基​​​​​​​本​​​​​​​實​​​​​​​體​​​​​​​卷​​​​​​​冊​​​​​​​上​​​​​​​就​​​​​​​必​​​​​​​須​​​​​​​要​​​​​​​有​​​​​​​足​​​​​​​夠​​​​​​​的​​​​​​​空​​​​​​​間​​​​​​​。​​​​​​​比​​​​​​​方​​​​​​​說​​​​​​​,若​​​​​​​您​​​​​​​有​​​​​​​個​​​​​​​雙​​​​​​​向​​​​​​​的​​​​​​​ stripe 而​​​​​​​它​​​​​​​使​​​​​​​用​​​​​​​了​​​​​​​所​​​​​​​有​​​​​​​的​​​​​​​卷​​​​​​​冊​​​​​​​群​​​​​​​組​​​​​​​,新​​​​​​​增​​​​​​​一​​​​​​​個​​​​​​​單​​​​​​​獨​​​​​​​的​​​​​​​實​​​​​​​體​​​​​​​卷​​​​​​​冊​​​​​​​至​​​​​​​卷​​​​​​​冊​​​​​​​群​​​​​​​組​​​​​​​將​​​​​​​無​​​​​​​法​​​​​​​讓​​​​​​​您​​​​​​​延​​​​​​​伸​​​​​​​該​​​​​​​ stripe。​​​​​​​您​​​​​​​必​​​​​​​須​​​​​​​要​​​​​​​新​​​​​​​增​​​​​​​至​​​​​​​少​​​​​​​兩​​​​​​​個​​​​​​​實​​​​​​​體​​​​​​​卷​​​​​​​冊​​​​​​​至​​​​​​​卷​​​​​​​冊​​​​​​​群​​​​​​​組​​​​​​​中​​​​​​​。​​​​​​​
比​​​​​​​方​​​​​​​說​​​​​​​,請​​​​​​​參​​​​​​​考​​​​​​​一​​​​​​​個​​​​​​​包​​​​​​​含​​​​​​​著​​​​​​​兩​​​​​​​個​​​​​​​基​​​​​​​本​​​​​​​實​​​​​​​體​​​​​​​卷​​​​​​​冊​​​​​​​的​​​​​​​卷​​​​​​​冊​​​​​​​群​​​​​​​組​​​​​​​ 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
在​​​​​​​此​​​​​​​情​​​​​​​況​​​​​​​下​​​​​​​,您​​​​​​​無​​​​​​​法​​​​​​​將​​​​​​​等​​​​​​​量​​​​​​​邏​​​​​​​輯​​​​​​​卷​​​​​​​冊​​​​​​​延​​​​​​​伸​​​​​​​為​​​​​​​整​​​​​​​個​​​​​​​卷​​​​​​​冊​​​​​​​群​​​​​​​組​​​​​​​的​​​​​​​大​​​​​​​小​​​​​​​,因​​​​​​​為​​​​​​​需​​​​​​​要​​​​​​​兩​​​​​​​個​​​​​​​基​​​​​​​本​​​​​​​的​​​​​​​裝​​​​​​​置​​​​​​​才​​​​​​​可​​​​​​​ stripe 資​​​​​​​料​​​​​​​。​​​​​​​
# 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
若​​​​​​​要​​​​​​​延​​​​​​​伸​​​​​​​等​​​​​​​量​​​​​​​的​​​​​​​邏​​​​​​​輯​​​​​​​卷​​​​​​​冊​​​​​​​,請​​​​​​​新​​​​​​​增​​​​​​​另​​​​​​​一​​​​​​​個​​​​​​​實​​​​​​​體​​​​​​​卷​​​​​​​冊​​​​​​​,然​​​​​​​後​​​​​​​再​​​​​​​延​​​​​​​伸​​​​​​​邏​​​​​​​輯​​​​​​​卷​​​​​​​冊​​​​​​​。​​​​​​​在​​​​​​​此​​​​​​​範​​​​​​​例​​​​​​​中​​​​​​​,在​​​​​​​新​​​​​​​增​​​​​​​了​​​​​​​兩​​​​​​​個​​​​​​​實​​​​​​​體​​​​​​​卷​​​​​​​冊​​​​​​​至​​​​​​​卷​​​​​​​冊​​​​​​​群​​​​​​​組​​​​​​​之​​​​​​​後​​​​​​​,我​​​​​​​們​​​​​​​便​​​​​​​可​​​​​​​將​​​​​​​邏​​​​​​​輯​​​​​​​卷​​​​​​​冊​​​​​​​延​​​​​​​伸​​​​​​​為​​​​​​​卷​​​​​​​冊​​​​​​​群​​​​​​​組​​​​​​​的​​​​​​​完​​​​​​​整​​​​​​​大​​​​​​​小​​​​​​​。​​​​​​​
# 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
在​​​​​​​您​​​​​​​沒​​​​​​​有​​​​​​​足​​​​​​​夠​​​​​​​的​​​​​​​基​​​​​​​本​​​​​​​實​​​​​​​體​​​​​​​裝​​​​​​​置​​​​​​​來​​​​​​​延​​​​​​​伸​​​​​​​等​​​​​​​量​​​​​​​邏​​​​​​​輯​​​​​​​卷​​​​​​​冊​​​​​​​的​​​​​​​情​​​​​​​況​​​​​​​下​​​​​​​,若​​​​​​​延​​​​​​​伸​​​​​​​沒​​​​​​​有​​​​​​​被​​​​​​​ stripe 無​​​​​​​所​​​​​​​謂​​​​​​​的​​​​​​​話​​​​​​​,您​​​​​​​依​​​​​​​然​​​​​​​還​​​​​​​是​​​​​​​能​​​​​​​夠​​​​​​​延​​​​​​​伸​​​​​​​該​​​​​​​卷​​​​​​​冊​​​​​​​,而​​​​​​​這​​​​​​​將​​​​​​​有​​​​​​​可​​​​​​​能​​​​​​​造​​​​​​​成​​​​​​​效​​​​​​​能​​​​​​​上​​​​​​​的​​​​​​​不​​​​​​​一​​​​​​​致​​​​​​​。​​​​​​​當​​​​​​​增​​​​​​​加​​​​​​​邏​​​​​​​輯​​​​​​​卷​​​​​​​冊​​​​​​​的​​​​​​​空​​​​​​​間​​​​​​​時​​​​​​​,預​​​​​​​設​​​​​​​的​​​​​​​作​​​​​​​業​​​​​​​就​​​​​​​是​​​​​​​使​​​​​​​用​​​​​​​和​​​​​​​現​​​​​​​有​​​​​​​邏​​​​​​​輯​​​​​​​卷​​​​​​​冊​​​​​​​的​​​​​​​最​​​​​​​後​​​​​​​一​​​​​​​個​​​​​​​區​​​​​​​段​​​​​​​相​​​​​​​同​​​​​​​的​​​​​​​ striping 參​​​​​​​數​​​​​​​,不​​​​​​​過​​​​​​​您​​​​​​​可​​​​​​​將​​​​​​​這​​​​​​​些​​​​​​​參​​​​​​​數​​​​​​​置​​​​​​​換​​​​​​​掉​​​​​​​。​​​​​​​下​​​​​​​列​​​​​​​範​​​​​​​例​​​​​​​在​​​​​​​初​​​​​​​始​​​​​​​的​​​​​​​ 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