Queries Regarding MigratePV

We have 3PVs, now we want to migrate it to new 2PVs.

OLD PVS

hdisk1 ---- /u01
hdisk2 ------ /u01
hdisk 3 ----- /u02, /u01

new PVs

hdisk4 ---- Free
hdisk5 ---- Free

I check man, it doesn't say anything about offline/online thing, do i need downtime to migrate pv ? also, what i saw i can migrate single lv as well from one pv to another, will it use the free PPs or can overwrite old data.

Edit:

Ok Found Answer, No Downtime required. Now only one question left.

Can I use Following command, when hdisk5 already containing some data?

migratepv �l lvu01 hdisk3 hdisk5

As you figured out there is NO downtime required.

To answer your second questions, yes you can use the command, but make sure that data of lv lvu01 is not exceeding the free total size of hdisk5 , if it is exceeding then add hdisk4 to the command (after hdisk5).

Hope this helps.

1 Like

I think it will be easier not to use migratepv. I suggest the following procedure.

  • Add the disk(s) to the VG.
  • Now create LV-copies for the LVs/FSes in question, where the copy resides on the new disk(s). This is easily done using "chlv".
  • Issue a "syncvg", wait until it has finished.
  • Remove the copies of the LVs residing on the disks you want to free. This is also one "chlv"

I hope this helps.

bakunin

1 Like

Thanks guys, let's hope things goes fine today.

I forgot to say: if you want to migrate all LVs you can simplify things further by using "mirrorvg" instead of mirroring the single LVs.

I hope this helps.

bakunin

There is no need to mirror, sync unmirror. Simply:-

extendvg vgname hdisk4 hdisk5
migratepv hdisk1 hdisk4 hdisk5
migratepv hdisk2 hdisk4 hdisk5
migratepv hdisk3 hdisk4 hdisk5
reducevg vgname hdisk1 hdisk2 hdisk3

The migratepv command will take a while to run in each case, but the OS will permit RW access all the time to the LVs as they move.

I hope that this helps,

Robin
Liverpool/Blackburn
UK

1 Like

It is true, you can do it this way and it surely will work. Still, if you use "migratepv" PPs are moved serially - one after the other. Using "mirrorvg" works in parallel (and possibly background, see the "-S" option) which can speed things up, especially when SAN disks are involved.

I hope this helps.

bakunin

1 Like