Menu Close

Red Hat Training

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

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 節, “建​​​​​​​立​​​​​​​線​​​​​​​性​​​​​​​卷​​​​​​​冊​​​​​​​”.