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 节 “创建线性卷”.