今天用migratepv 来实现 不同disk 建的数据迁移,还是很成功的,步骤如下:
migratepv test:
step1: add one disk into the datavg:
extendvg -f rootvg hdisk3
(when you finish the test, please use command : "reducevg -d rootvg hdisk3" to remove the disk)
step2: create one new lv in hdisk3:
Add a Logical Volume
Type or select values in entry fields.
Press Enter AFTER making all desired changes.
[Entry Fields]
Logical volume NAME [lv_test]
* VOLUME GROUP name rootvg
* Number of LOGICAL PARTITIONS [1] #
PHYSICAL VOLUME names [hdisk3] +
Logical volume TYPE [jfs2] +
POSITION on physical volume outer_middle +
RANGE of physical volumes minimum +
MAXIMUM NUMBER of PHYSICAL VOLUMES [] #
to use for allocation
Number of COPIES of each logical 1 +
partition
Mirror Write Consistency? active +
Allocate each logical partition copy yes +
on a SEPARATE physical volume?
RELOCATE the logical volume during reorganization? yes +
Logical volume LABEL []
MAXIMUM NUMBER of LOGICAL PARTITIONS [512] #
Enable BAD BLOCK relocation? yes +
SCHEDULING POLICY for writing/reading parallel +
logical partition copies
Enable WRITE VERIFY? no +
File containing ALLOCATION MAP []
Stripe Size? [Not Striped] +
Serialize IO? no +
root@a05scpgapp01/>lspv -l hdisk3
hdisk3:
LV NAME LPs PPs DISTRIBUTION MOUNT POINT
lv_test 1 1 00..01..00..00..00 N/A
----------------
take a look at the lv in current hdisk:
root@a05scpgapp01/>lspv -l hdisk1
hdisk1:
LV NAME LPs PPs DISTRIBUTION MOUNT POINT
hd4 80 80 65..00..01..00..14 /
hd2 80 80 00..00..80..00..00 /usr
hd6 24 24 00..16..00..00..08 N/A
hd8 1 1 00..00..01..00..00 N/A
hd1 96 96 00..29..01..00..66 /home
hd10opt 80 80 44..00..01..35..00 /opt
hd9var 120 120 00..45..01..74..00 /var
hd3 40 40 00..16..24..00..00 /tmp
hd5 1 1 01..00..00..00..00 N/A
fwdump 3 3 00..03..00..00..00 /var/adm/ras/platform
root@a05scpgapp01/>lspv -l hdisk3
hdisk3:
LV NAME LPs PPs DISTRIBUTION MOUNT POINT
lv_test 1 1 00..01..00..00..00 N/A
step3:
execute the command:
root@a05scpgapp01/>migratepv -l lv_test hdisk3 hdisk1
root@a05scpgapp01/>lspv -l hdisk3 (you will see there is no LV in hdisk3)
root@a05scpgapp01/>lspv -l hdisk1
hdisk1:
LV NAME LPs PPs DISTRIBUTION MOUNT POINT
hd4 80 80 65..00..01..00..14 /
hd2 80 80 00..00..80..00..00 /usr
hd6 24 24 00..16..00..00..08 N/A
hd8 1 1 00..00..01..00..00 N/A
hd1 96 96 00..29..01..00..66 /home
hd10opt 80 80 44..00..01..35..00 /opt
hd9var 120 120 00..45..01..74..00 /var
hd3 40 40 00..16..24..00..00 /tmp
hd5 1 1 01..00..00..00..00 N/A
fwdump 3 3 00..03..00..00..00 /var/adm/ras/platform
lv_test 1 1 00..00..00..00..01 N/A
summary:
the process is :
first do the morror, sercond do the lv migration, finally remove the lv from source disk.
收起