5.转移数据
[root@ www.linuxidc.com ~]# pvmove /dev/sda7 /dev/sda9
/dev/sda7: Moved: 100.0%
查看物理卷详情,对比上面数据
[root@ www.linuxidc.com ~]# pvdisplay
--- Physical volume ---
PV Name /dev/sda7
VG Name testvg
PV Size 1.87 GB / not usable 1.96 MB
Allocatable yes
PE Size (KByte) 4096
Total PE 478
Free PE 478
Allocated PE 0
PV UUID pJxudP-iM6G-BNbv-Nx0a-cDqM-FAw1-51WeDz
--- Physical volume ---
PV Name /dev/sda8
VG Name testvg
PV Size 1.87 GB / not usable 1.96 MB
Allocatable yes
PE Size (KByte) 4096
Total PE 478
Free PE 478
Allocated PE 0
PV UUID 7fOpr3-5cEC-1Gph-BmnY-Zj2I-UZo8-JwcUAW
--- Physical volume ---
PV Name /dev/sda9
VG Name testvg
PV Size 1.87 GB / not usable 1.96 MB
Allocatable yes
PE Size (KByte) 4096
Total PE 478
Free PE 468
Allocated PE 10
PV UUID xxNAtZ-a3RO-lN9D-UN1X-atq2-p5q9-HyEO8a
6.把/dev/sda7从卷组中移除
[root@ www.linuxidc.com ~]# vgreduce testvg /dev/sda7
Removed "/dev/sda7" from volume group "testvg"
7.查看卷组容量
[root@ www.linuxidc.com ~]# vgdisplay
--- Volume group ---
VG Name testvg
System ID
Format lvm2
Metadata Areas 2
Metadata Sequence No 11
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 1
Open LV 1
Max PV 0
Cur PV 2
Act PV 2
VG Size 3.73 GB
PE Size 4.00 MB
Total PE 956
Alloc PE / Size 10 / 40.00 MB
Free PE / Size 946 / 3.70 GB
VG UUID UJrKI9-NSrt-vhV8-iwoR-pN7i-MhQp-PxPcPr
/dev/sda7已移除
8.把dev/sda7从物理卷中移除
[root@ www.linuxidc.com ~]# pvremove /dev/sda7
Labels on physical volume "/dev/sda7" successfully wiped
[root@ www.linuxidc.com ~]# pvdisplay
--- Physical volume ---
PV Name /dev/sda8
VG Name testvg
PV Size 1.87 GB / not usable 1.96 MB
Allocatable yes
PE Size (KByte) 4096
Total PE 478
Free PE 478
Allocated PE 0
PV UUID 7fOpr3-5cEC-1Gph-BmnY-Zj2I-UZo8-JwcUAW
--- Physical volume ---
PV Name /dev/sda9
VG Name testvg
PV Size 1.87 GB / not usable 1.96 MB
Allocatable yes
PE Size (KByte) 4096
Total PE 478
Free PE 468
Allocated PE 10
PV UUID xxNAtZ-a3RO-lN9D-UN1X-atq2-p5q9-HyEO8a
OK
