You are not logged in.

#1 2011-02-10 07:04:59

XtrmGmr99
Member
Registered: 2009-04-14
Posts: 128

LVM and pvmove: Insufficient free space

Hello,

I have a server with four disks in an LVM volume group. I am wanting to replace this with a single 2TB drive, however all SATA ports are used by the disks. I need to remove one disk, install the new disk, and then transfer all content over...

This disk that I want to remove is /dev/sdc. This disk, unlike the others, has 2 partitions: a boot partition and an LVM partition that is part of the volume group. My intent is to purge /dev/sdc2 (the LVM partition) from the LVM volume group, shrink an LVM partition on another disk and use that for /boot, and then finally remove /dev/sdc.

But, I've run into a bit of a problem...

The LVM partition on /dev/sdc2 is less than 40G. I know for a fact that there is more free space than that on the other disks, but pvmove returns with an error that it doesn't have enough free space to move to content off:

$ pvmove /dev/sdc2
Password:
  Insufficient free space: 9481 extents needed, but only 6544 available
  Unable to allocate mirror extents for pvmove0.
  Failed to convert pvmove LV to mirrored

I don't understand why it can't just move whatever content resides on /dev/sdc2 to free space on the other disks. I might be doing something wrong, but can someone explain this?

Thanks!

Some info:

$ lvdisplay --maps
  --- Logical volume ---
  LV Name                /dev/VolGroup00/lvolroot
  VG Name                VolGroup00
  LV UUID                1ZdePr-hcnS-Ykzv-p99J-dfKV-4Ng1-r42Dt0
  LV Write Access        read/write
  LV Status              available
  # open                 1
  LV Size                20.00 GiB
  Current LE             5120
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           254:0

  --- Segments ---
  Logical extent 0 to 5119:
    Type                linear
    Physical volume     /dev/sdb1
    Physical extents    0 to 5119


  --- Logical volume ---
  LV Name                /dev/VolGroup00/lvolhome
  VG Name                VolGroup00
  LV UUID                HJ3qGb-ThzI-UDkI-kItC-ThPk-iiP4-LXe4eD
  LV Write Access        read/write
  LV Status              available
  # open                 1
  LV Size                20.00 GiB
  Current LE             5120
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           254:1

  --- Segments ---
  Logical extent 0 to 5119:
    Type                linear
    Physical volume     /dev/sdb1
    Physical extents    5120 to 10239


  --- Logical volume ---
  LV Name                /dev/VolGroup00/lvolswap
  VG Name                VolGroup00
  LV UUID                DXIpqt-op4c-1qfq-MB9C-sp0F-kSTa-g16QAF
  LV Write Access        read/write
  LV Status              available
  # open                 1
  LV Size                1.00 GiB
  Current LE             256
  Segments               1
  Allocation             contiguous
  Read ahead sectors     auto
  - currently set to     256
  Block device           254:2

  --- Segments ---
  Logical extent 0 to 255:
    Type                linear
    Physical volume     /dev/sdc2
    Physical extents    0 to 255


  --- Logical volume ---
  LV Name                /dev/VolGroup00/lvolstorage
  VG Name                VolGroup00
  LV UUID                RTiGDD-0xoF-VX2v-QKcv-6MLZ-7mX8-J14aQQ
  LV Write Access        read/write
  LV Status              available
  # open                 1
  LV Size                622.54 GiB
  Current LE             159371
  Segments               4
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           254:3

  --- Segments ---
  Logical extent 0 to 9224:
    Type                linear
    Physical volume     /dev/sdc2
    Physical extents    256 to 9480

  Logical extent 9225 to 11519:
    Type                linear
    Physical volume     /dev/sdb1
    Physical extents    10240 to 12534

  Logical extent 11520 to 40136:
    Type                linear
    Physical volume     /dev/sda1
    Physical extents    0 to 28616

  Logical extent 40137 to 159370:
    Type                linear
    Physical volume     /dev/sdd1
    Physical extents    0 to 119233
$ pvdisplay
  --- Physical volume ---
  PV Name               /dev/sdb1
  VG Name               VolGroup00
  PV Size               74.53 GiB / not usable 2.87 MiB
  Allocatable           yes
  PE Size               4.00 MiB
  Total PE              19079
  Free PE               6544
  Allocated PE          12535
  PV UUID               EM1AK2-UsBD-nTDj-52sZ-LpYW-rS5i-AEH4Vr

  --- Physical volume ---
  PV Name               /dev/sdc2
  VG Name               VolGroup00
  PV Size               37.04 GiB / not usable 2.89 MiB
  Allocatable           yes (but full)
  PE Size               4.00 MiB
  Total PE              9481
  Free PE               0
  Allocated PE          9481
  PV UUID               dwXCls-Ce4b-2Kjp-dgKE-NTOX-seCv-Q4jfiv

  --- Physical volume ---
  PV Name               /dev/sda1
  VG Name               VolGroup00
  PV Size               111.79 GiB / not usable 2.94 MiB
  Allocatable           yes (but full)
  PE Size               4.00 MiB
  Total PE              28617
  Free PE               0
  Allocated PE          28617
  PV UUID               4hvcfl-1IWM-T1MB-3qjC-z342-rN4x-Qjm00u

  --- Physical volume ---
  PV Name               /dev/sdd1
  VG Name               VolGroup00
  PV Size               465.76 GiB / not usable 1.50 MiB
  Allocatable           yes (but full)
  PE Size               4.00 MiB
  Total PE              119234
  Free PE               0
  Allocated PE          119234
  PV UUID               opSi3p-EVRu-kqb2-u7Ni-ItVt-LTEj-RuhqZB
$ sudo vgdisplay
  --- Volume group ---
  VG Name               VolGroup00
  System ID
  Format                lvm2
  Metadata Areas        4
  Metadata Sequence No  21
  VG Access             read/write
  VG Status             resizable
  MAX LV                0
  Cur LV                4
  Open LV               4
  Max PV                0
  Cur PV                4
  Act PV                4
  VG Size               689.11 GiB
  PE Size               4.00 MiB
  Total PE              176411
  Alloc PE / Size       169867 / 663.54 GiB
  Free  PE / Size       6544 / 25.56 GiB
  VG UUID               nltb47-cx1W-oJb1-5rvA-ECgb-rcuX-ysP33i

Last edited by XtrmGmr99 (2011-02-10 07:05:57)

Offline

#2 2011-02-10 16:46:08

perbh
Member
From: Republic of Texas
Registered: 2005-03-04
Posts: 765

Re: LVM and pvmove: Insufficient free space

With all due respect - why don't you just buy a usb-enclosure (~$25), put your 2TB disk in that and then just copy ?
Surely, that must be easier than fiddling around with lvm ...

Offline

#3 2011-02-10 17:47:00

XtrmGmr99
Member
Registered: 2009-04-14
Posts: 128

Re: LVM and pvmove: Insufficient free space

I have one. That doesn't mean I should use it to workaround this problem. Knowledge is great, and a solution to this is much better in the long run. It will better prepare me for when I run into something like this again, unless of course there is no real way to get out of this predicament.

That and transferring 600+GB via USB2 would be a pain in the ass. <_< If the server had eSATA, that's another thing, but it doesn't. x_x

Offline

#4 2011-02-12 02:01:41

XtrmGmr99
Member
Registered: 2009-04-14
Posts: 128

Re: LVM and pvmove: Insufficient free space

Bump...

Offline

#5 2011-02-13 03:07:20

XtrmGmr99
Member
Registered: 2009-04-14
Posts: 128

Re: LVM and pvmove: Insufficient free space

I solved it.

I used the "Shrink logical volume" section on the LVM wiki, and then proceeded to pvmove. All is well. ^_^

Offline

Board footer

Powered by FluxBB