root@localhost ~]# pv
pvchange pvcreate pvmove pvresize pvscan
pvck pvdisplay pvremove pvs
创建物理卷:选择自己要创建的分区
[root@localhost ~]# pvcreate /dev/sdb{1,2,3} //用sdb1,sdb2,sdb3三个分区来创建物理卷
Physical volume "/dev/sdb1" successfully created.
Physical volume "/dev/sdb2" successfully created.
Physical volume "/dev/sdb3" successfully created.
简单查看物理卷:
[root@localhost ~]# pvs
PV VG Fmt Attr PSize PFree
/dev/sdb1 lvm2 --- 512.00m 512.00m
/dev/sdb2 lvm2 --- 512.00m 512.00m
/dev/sdb3 lvm2 --- 1023.00m 1023.00m
详细查看:
[root@localhost ~]# pvdisplay
"/dev/sdb1" is a new physical volume of "512.00 MiB"
--- NEW Physical volume ---
PV Name /dev/sdb1
VG Name
PV Size 512.00 MiB
Allocatable NO
PE Size 0
Total PE 0
Free PE 0
Allocated PE 0
PV UUID 413TpT-NC3F-ch3r-3xsy-TW10-P3Rr-qT6dm5
"/dev/sdb3" is a new physical volume of "1023.00 MiB"
--- NEW Physical volume ---
PV Name /dev/sdb3
VG Name
PV Size 1023.00 MiB
Allocatable NO
PE Size 0
Total PE 0
Free PE 0
Allocated PE 0
PV UUID DDu25l-PBlg-sRJY-qgl1-Io3s-ezmj-KVuZCT
"/dev/sdb2" is a new physical volume of "512.00 MiB"
--- NEW Physical volume ---
PV Name /dev/sdb2
VG Name
PV Size 512.00 MiB
Allocatable NO
PE Size 0
Total PE 0
Free PE 0
Allocated PE 0
PV UUID Z5QKKi-RoKG-MZ1b-ed3s-Ibgg-eyAr-PDK0kV
----------------------------------------------------------------------------------------
PE(physical extent):物理区域是物理卷中可用于分配的最小存储单元,物理区域大小在建立卷组时指定,一旦确定不能更改,同一卷组所有物理卷的物理区域大小需一致,新的pv加入到vg后,pe的大小自动更改为vg中定义的pe大小。
LE(logical extent):逻辑区域是逻辑卷中可用于分配的最小存储单元,逻辑区域的大小取决于逻辑卷所在卷组中的物理区域的大小。
卷组描述区域:卷组描述区域存在于每个物理卷中,用于描述物理卷本身、物理卷所属卷组、卷组中逻辑卷、逻辑卷中物理区域的分配等所有信息,它是在使用pvcreate建立物理卷时建立的。
3、创建卷组:vg系列命令
[root@localhost ~]# vg
vgcfgbackup vgconvert vgextend vgmknodes vgs
vgcfgrestore vgcreate vgimport vgreduce vgscan
vgchange vgdisplay vgimportclone vgremove vgsplit
vgck vgexport vgmerge vgrename
创建卷组,名字可以随意起