migratepv可以很方便地把LV从源PV迁移到目标PV,但如果是条带LV,则没那么容易了。
条带LV跨多PV,因migratepv每次只能对一个具体的PV进行操作,而且目标PV不能同时是源PV;因此我们可以加入新PV到VG中,然后分开迁移,每次只针对一个PV进行migratepv即。
以下是测试实例
# lslv -l slv
slv:N/A
PV COPIES IN BAND DISTRIBUTION
hdisk0 002:000:000 0% 002:000:000:000:000
hdisk1 002:000:000 100% 000:002:000:000:000
# lslv slv
LOGICAL VOLUME: slv VOLUME GROUP: rootvg
LV IDENTIFIER: 005c57bf00004c0000000129b3280cb0.11 PERMISSION: read/write
VG STATE: active/complete LV STATE: closed/syncd
TYPE: jfs WRITE VERIFY: off
MAX LPs: 512 PP SIZE: 64 megabyte(s)
COPIES: 1 SCHED POLICY: striped
LPs: 4 PPs: 4
STALE PPs: 0 BB POLICY: relocatable
INTER-POLICY: maximum RELOCATABLE: no
INTRA-POLICY: middle UPPER BOUND: 2
MOUNT POINT: N/A LABEL: None
MIRROR WRITE CONSISTENCY: on/ACTIVE
EACH LP COPY ON A SEPARATE PV ?: yes (superstrict)
Serialize IO ?: NO
STRIPE WIDTH: 2
STRIPE SIZE: 8K
# migratepv -l slv hdisk0 hdisk1
0516-1244 migratepv: Destination physical volume hdisk1 contains
partitions of the logical volume slv.
0516-812 migratepv: Warning, migratepv did not completely succeed;
all physical partitions have not been moved off the PV.
# lspv
hdisk0 0004248ff72a949f rootvg active
hdisk1 0004248ff76aef39 rootvg active
hdisk2 0004248ff76b1f4b None
# extendvg rootvg hdisk2
0516-1398 extendvg: The physical volume hdisk2, appears to belong to
another volume group. Use the force option to add this physical volume
to a volume group.
0516-792 extendvg: Unable to extend volume group.
# extendvg -f rootvg hdisk2
# lspv
hdisk0 0004248ff72a949f rootvg active
hdisk1 0004248ff76aef39 rootvg active
hdisk2 0004248ff76b1f4b rootvg active
# migratepv -l slv hdisk0 hdisk2
# lslv -l slv
slv:N/A
PV COPIES IN BAND DISTRIBUTION
hdisk2 002:000:000 100% 000:002:000:000:000
hdisk1 002:000:000 100% 000:002:000:000:000
如果有HDISK4,那么把它加入ROOTVG中后,可以利用以上办法把存放在HDISK1中的slv迁移到HDISK4上
阅读(6715) | 评论(0) | 转发(1) |