前两天在T2拿了一台新
服务器,操作系统是Xen Server 5.6
,默认情况下,他们将/dev/sda3和/dev/sdb2加到同一个LVM卷组,做为Xen Sever的Local Storage
。但是因为实际应用需要,我需要将两个卷分开,操作步骤如下
。
1、首先用vgdisplay查看LVM卷组名(VG Name)
[root@xen9 ~]# vgdisplay
— Volume group —
VG Name VG_XenStorage-96cb10ab-23a5-5f94-5ef0-a51e89905d71
System ID
Format lvm2
Metadata Areas 2
Metadata Sequence No 4
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 1
Open LV 0
Max PV 0
Cur PV 2
Act PV 2
VG Size 874.65 GB
PE Size 4.00 MB
Total PE 223910
Alloc PE / Size 1 / 4.00 MB
Free PE / Size 223909 / 874.64 GB
VG UUID 3efDeW-TvHK-dh66-yiFO-ljlV-5tS2-GaDYh2
2、用pvdisplay查看物理卷的具体情况
[root@xen9 ~]# pvdisplay
— Physical volume —
PV Name /dev/sda3
VG Name VG_XenStorage-96cb10ab-23a5-5f94-5ef0-a51e89905d71
PV Size 457.76 GB / not usable 6.62 MB
Allocatable yes
PE Size (KByte) 4096
Total PE 117183
Free PE 117182
Allocated PE 1
PV UUID mGXYYK-OoM1-8ZRB-ilP0-h4CH-H4EV-pMcXzs
— Physical volume —
PV Name /dev/sdb2
VG Name VG_XenStorage-96cb10ab-23a5-5f94-5ef0-a51e89905d71
PV Size 416.92 GB / not usable 22.51 MB
Allocatable yes
PE Size (KByte) 4096
Total PE 106727
Free PE 106727
Allocated PE 0
PV UUID s98dhd-bQ9o-XNcK-5Py8-6BgG-dzJw-wCvbo4
3、用vgreduce指令将/dev/sdb2从当前卷组中删除
[root@xen9 ~]# vgreduce VG_XenStorage-96cb10ab-23a5-5f94-5ef0-a51e89905d71 /dev/sdb2
Removed “/dev/sdb2″ from volume group “VG_XenStorage-96cb10ab-23a5-5f94-5ef0-a51e
4、用pvremove将/dev/hdb2的pv标记去除
[root@xen9 ~]# pvremove /dev/sdb2
Labels on physical volume “/dev/sdb2″ successfully wiped
5、再用pvdisplay查看物理卷的情况时,你会发现只有一个物理卷了。
[root@xen9 ~]# pvdisplay
— Physical volume —
PV Name /dev/sda3
VG Name VG_XenStorage-96cb10ab-23a5-5f94-5ef0-a51e89905d71
PV Size 457.76 GB / not usable 6.62 MB
Allocatable yes
PE Size (KByte) 4096
Total PE 117183