Skip to contentSkip to conversation

pvmove to smaller PVs

linux-lvm Fredrik Tolf 4 participants 7 messages Apr 5, 2006 – Apr 27, 2006

lore
Share & tools
lore
#0 lore raw

I'm trying to use pvmove to move data from a 300 GB S-ATA disk onto four, smaller 120 GB IDE disks. However, pvmove tells me that it cannot allocate enough contiguous PEs to fit 300 GB, like this:

# pvmove /dev/sde1
  Insufficient contiguous allocatable extents (28617) for logical volume
pvmove0: 71541 required
  Unable to allocate temporary LV for pvmove.

I can, of course, understand that it can't find contiguous PEs corresponding to 300 GB, but I don't understand why it should need it to be contiguous. Can pvmove not just divide that storage into three "partitions", each fitting on one 120 GB disk, and move them? Is there a way for me to tell it to do so?

I seem to be able to use something like "pvmove /dev/sde1:0-28616" to tell pvmove manually to do this for me, but this poses a small problem for me, as not all of the data on the disks I want to move from are allocated where I know them to be. This particular disk is fully allocated, so that I know what I could do with that syntax, but is there really no way to tell pvmove to do this automatically? It just seems kind of strange to me.

Fredrik Tolf

#1 lore raw
Quoted 1 line · Fredrik Tolf

Can pvmove not just divide that storage into three "partitions",

There's no logic to do that yet. It can only move complete sets of contiguous extents.

Quoted 1 line

Is there a way for me to tell it to do so?

As you found: break up contiguous extents explicitly on the command line by telling it to move smaller parts that it can handle.

Use '--alloc anywhere' if you need to move data within a single PV.

Alasdair

Signature · 1 line
[email protected]
#2 lore raw

I'm no expert, mostly just a lurker on this list, but couldn't you SoftRAID the 4 120GB's together then PV move the 300GB to the logical disk?

Quoted 25 lines · Alasdair G Kergon
Quoted 1 line · Fredrik Tolf

Can pvmove not just divide that storage into three "partitions",

There's no logic to do that yet. It can only move complete sets of contiguous extents.

Quoted 1 line

Is there a way for me to tell it to do so?

As you found: break up contiguous extents explicitly on the command line by telling it to move smaller parts that it can handle.

Use '--alloc anywhere' if you need to move data within a single PV.

Alasdair
--
[email protected]

_______________________________________________
linux-lvm mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/linux-lvm
read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/

#3 lore raw
In reply to Alasdair G Kergon
Quoted 11 lines · Alasdair G Kergon
Quoted 1 line · Fredrik Tolf

Can pvmove not just divide that storage into three "partitions",

There's no logic to do that yet. It can only move complete sets of contiguous extents.

Quoted 1 line

Is there a way for me to tell it to do so?

As you found: break up contiguous extents explicitly on the command line by telling it to move smaller parts that it can handle.

I see. I guess I'll just have to do that then. It's not *that* bad, after all. :)

However, is there a "canonical" way to check where PEs have been allocated inside PVs? I think I can check /etc/lvm/backup/vgname. I'm just getting the feeling that that's kind of ugly.

Thanks for your reply!

Fredrik Tolf

#4 lore raw
Quoted 2 lines · Fredrik Tolf

However, is there a "canonical" way to check where PEs have been allocated inside PVs?

lvs -o+devices
gives start PEs in parentheses

Alasdair

Signature · 1 line
[email protected]
#5 lore raw
Quoted 6 lines · Alasdair G Kergon
Quoted 2 lines · Fredrik Tolf

However, is there a "canonical" way to check where PEs have been allocated inside PVs?

lvs -o+devices
gives start PEs in parentheses

Oh, cool. Thanks!

Fredrik Tolf

#6 lore raw
In reply to Alasdair G Kergon
Quoted 11 lines · Alasdair G Kergon
Quoted 1 line · Fredrik Tolf

Can pvmove not just divide that storage into three "partitions",

There's no logic to do that yet. It can only move complete sets of contiguous extents.

Quoted 1 line

Is there a way for me to tell it to do so?

As you found: break up contiguous extents explicitly on the command line by telling it to move smaller parts that it can handle.

I run into the same problem: I got a hw-raid controller and merged all my individual disks into a raid5. Thus I got one big PV instead of several small one. After moving back and forth some lvs, my PV gets more and more fragmented. Thus I have to instruct pvmove explicitly which fragments have to move.

The pvmove manpage explains shortly how pvmove works: Segments to to move are added to a temporary 'pvmove' lv, but it seems lvmove won't split any source segment into smaller pieces to fit into any target segment. I may explicitly express source segments (using :PE-PE), but this also becomes complicated if my source PV is fragmented, too. Even if I do so, it is not clear to me, how to express such a fragmented pvmove with a single command. Else I have to perform lots of single pvmoves and have to wait for each to become ready?

Dieter.