# pvcreate /dev/sdc Physical volume"/dev/sdc" successfully created
请注意:
上面的命令将删除磁盘 /dev/sdc 上的所有数据。
物理磁盘可以直接添加到 LVM 物理卷中,而不是磁盘分区。
使用 pvdisplay 命令来显示你所创建的物理卷:
1 2 3 4 5 6 7 8 9 10 11 12 13 14
# pvdisplay /dev/sdc
"/dev/sdc" is a new physical volume of "10.00 GiB" --- NEW Physical volume --- PV Name /dev/sdc VG Name PV Size10.00 GiB Allocatable NO PE Size0 Total PE 0 Free PE 0 Allocated PE 0 PV UUID 69d9dd18-36be-4631-9ebb-78f05fe3217f
# vgdisplay vg01 --- Volume group --- VG Name vg01 System ID Format lvm2 Metadata Areas 2 Metadata Sequence No 1 VG Access read/write VG Status resizable MAX LV 0 Cur LV 0 Open LV 0 Max PV 0 Cur PV 2 Act PV 2 VG Size14.99 GiB PE Size4.00 MiB Total PE 3840 Alloc PE / Size1280 / 4.99 Free PE / Size2560 / 9.99 GiB VG UUID d17e3c31-e2c9-4f11-809c-94a549bc43b7
如何扩展逻辑卷?
使用以下命令增加现有逻辑卷大小。
逻辑卷扩展(lvextend)的常用语法:
1 2
lvextend [要增加的额外空间][现有逻辑卷名称]
使用下面的命令将现有的逻辑卷增加 10GB:
1 2 3 4 5
# lvextend -L +10G /dev/mapper/vg01-lv002 Rounding size to boundary between physical extents: 5.90 GiB Size of logical volume vg01/lv002 changed from 5.00 GiB (1280 extents) to 15.00 GiB (3840 extents). Logical volume var successfully resized