# pvmove problem

## gondoi

Ok, I'm having some trouble moving some data off of a partition.

Here is my setup.. I have a 120G drive partitions are as follow:

hdb1 <-- extended ~60G

 - hdb5 10G

 - hdb6 10G

 - hdb7 10G

 - hdb8 10G

 - hdb9 10G 

 - hdb10 ~10G

hdb2 <-- ~60G

All of my data is currently on hdb2.  What I want to do is move all that off so I can repartition and make the drive all extended 10G partitions.  (I guess for allocatability in LVM   :Rolling Eyes:  ) 

Anyway, I've got it all setup where all the partitions are 8e LVM they are all part of the media Volume Group and there are 2 Logical Volumes /dev/media/audio and /dev/media/video (these are physically on hdb2)  BTW, that order you see up there is the order the partitions are physicaly, so the data is at the end of the drive.

So I figured that since my setup is currently where they are all the same group I can just do a 

```
pvmove -v -i 10 /dev/hdb2

```

and it will all move off of hdb2 and onto the available partitions.... WRONG. I get this error:

```
    Finding volume group "media"

    Archiving volume group "media" metadata.

    Creating logical volume pvmove0

  Insufficient contiguous allocatable extents (2506) for logical volume pvmove0: 10240 required

  Allocation for temporary pvmove LV failed

```

So basically from what I understand, it's saying that there are not enough PEs to allocate hence the 2506... well yeah.. it's trying to only use hdb10 cause that is the number of PEs on that partition.

My question is how do I get it to start at the FIRST of the drive (hdb5), and what are the "normal rules" it follows when you don't supply a destination volume?

For reference here is the output from vgdisplay -v media

```
    Using volume group(s) on command line

    Finding volume group "media"

  --- Volume group ---

  VG Name               media

  System ID             

  Format                lvm2

  Metadata Areas        7

  Metadata Sequence No  10

  VG Access             read/write

  VG Status             resizable

  MAX LV                255

  Cur LV                2

  Open LV               0

  Max PV                255

  Cur PV                7

  Act PV                7

  VG Size               115.02 GB

  PE Size               4.00 MB

  Total PE              29446

  Alloc PE / Size       14725 / 57.52 GB

  Free  PE / Size       14721 / 57.50 GB

  VG UUID               gdiYGJ-BlR6-jECV-IBe5-Jr2J-K2l2-omLtMm

   

  --- Logical volume ---

  LV Name                /dev/media/audio

  VG Name                media

  LV UUID                ECVldn-fBbw-kUQx-IHNk-oVkF-VPq2-UOgY5Z

  LV Write Access        read/write

  LV Status              available

  # open                 0

  LV Size                52.52 GB

  Current LE             13445

  Segments               2

  Allocation             next free (default)

  Read ahead sectors     0

  Block device           254:0

   

  --- Logical volume ---

  LV Name                /dev/media/video

  VG Name                media

  LV UUID                ABJBKB-DvJ6-PT5p-TBFs-Gfoq-fkgN-cSvo8m

  LV Write Access        read/write

  LV Status              available

  # open                 0

  LV Size                5.00 GB

  Current LE             1280

  Segments               1

  Allocation             next free (default)

  Read ahead sectors     0

  Block device           254:1

   

  --- Physical volumes ---

  PV Name               /dev/hdb2     

  PV UUID               MK0VY7-iqPC-Fvs8-t4q8-zqu3-xKYi-p5YSWm

  PV Status             allocatable

  Total PE / Free PE    14725 / 0

   

  PV Name               /dev/hdb5     

  PV UUID               ocPLZc-0kuq-bEOX-QDq3-qwG5-DIKI-LhOzm9

  PV Status             allocatable

  Total PE / Free PE    2443 / 2443

   

  PV Name               /dev/hdb6     

  PV UUID               1RPzTb-Vwi1-erBK-SmbH-xWxZ-zKO0-0YVEvp

  PV Status             allocatable

  Total PE / Free PE    2443 / 2443

   

  PV Name               /dev/hdb7     

  PV UUID               uQ1Hes-G3ak-Wfpq-7xQr-XahV-l5qF-sI4pct

  PV Status             allocatable

  Total PE / Free PE    2443 / 2443

   

  PV Name               /dev/hdb8     

  PV UUID               3JM35M-D4ie-LN4N-UsKd-qrvt-TTPl-3VQEdF

  PV Status             allocatable

  Total PE / Free PE    2443 / 2443

   

  PV Name               /dev/hdb9     

  PV UUID               k9TlC6-zINq-KVMI-ySxE-yEcp-AVpM-PzUUxs

  PV Status             allocatable

  Total PE / Free PE    2443 / 2443

   

  PV Name               /dev/hdb10     

  PV UUID               BM4uww-Xfpw-Ptz2-LReQ-xirO-Bkrm-Cl5pLV

  PV Status             allocatable

  Total PE / Free PE    2506 / 2506

```

----------

## gondoi

Well here I am posting a reply to my own post again   :Wink: 

I finally just signed up on the LVM mailing list and sent out an email (after searching the archives first of course)

Here is what I got:

 *Quote:*   

> Summary: How do I pvmove data with LVM2 if contiguous runs of
> 
> PEs in the source LVs will have to be split up to make them fit?
> 
> Quick answer:
> ...

 

So there we go... apparently pvmove isn't ready to do that yet.

Now the only problem is, I only seem to have vgcfgrestore and vgcfgbackup, and by the man pages (and the names of the programs themselves) it doesn't look like those edit the metadata any.

And I got a message from neuron saying that I probably shouldn't be using pvmove for that type of situation.

So off I go to do a manual cp.   :Smile: 

----------

