1

I have following case: Server with 4 disks - devices /dev/sdb - /dev/sde.

Each of these disks is physical volume, and all of them are within single volume group.

In this volume group, I have single logical volume, that spans across all 4 disks.

Now, I want to migrate it to larger disks. I added 4 new drives (/dev/sdf - /dev/sdi), and will move data.

Normally I would:

pvmove /dev/sdb /dev/sdf

wait for it to finish

pvmove /dev/sdc /dev/sdg

wait for it to finish

pvmove /dev/sde /dev/sdi

The question is - can I safely run all 4 pvmoves at the same time, without waiting for each of them to finish?

2
  • yes, you can use pvmove -b to put the process in backgroud
    – c4f4t0r
    May 5, 2015 at 16:29
  • No, you actually can't.
    – eijeze
    May 6, 2015 at 17:52

2 Answers 2

2

Answer for reference.

No, you can't. Or rather - you can, safely, but it will not work.

Running 2nd pvmove for the same lv, will end up with:

Skipping locked LV lv
Skipping mirror LV pvmove0
All data on source PV skipped. It contains locked, hidden or non-top level LVs only.
No data to move for vg

You have to wait for the first one to finish before moving 2nd.

0

the man page says you can,

   You  can run more than one pvmove at once provided they are moving data
   off different SourcePhysicalVolumes, but additional pvmoves will ignore
   any  Logical  Volumes  already in the process of being changed, so some
   data might not get moved.

however, if your LV spans PV's then no, you get the lock problems shown above. A way around this is to specify the LV to move, instead of the pv.

ie. pvmove lv_name pv_source pv_dest

which should avoid locks. You cannot parallelize the same LV tho.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .