pvmove: Insufficient free space with both disks the same size

I was migrating some LUNs to another storage.

After creating the LUNs with the same size, I intended to move the data to the new disk but I was getting there was insufficient free space

root@linux:~ # pvmove /dev/mapper/bkpcvrdd01 /dev/mapper/bkpcvrdd01newp1
Insufficient free space: 12800 extents needed, but only 12799 available
Unable to allocate mirror extents for pvmove0.
Failed to convert pvmove LV to mirrored

What happens is that the source disk is bigger than the new disk.

root@linux:~ # pvdisplay /dev/mapper/bkpcvrdd01 /dev/mapper/bkpcvrdd01newp1
— Physical volume —
PV Name /dev/mapper/bkpcvrdd01
VG Name bkpcvrdvg
PV Size 50.00 GB / not usable 640.00 KB
Allocatable yes (but full)
PE Size (KByte) 4096
Total PE 12800
Free PE 0
Allocated PE 12800
PV UUID giRfdd-oDKH-12W7-ObwE-nFoN-nF0L-3OFlK5

— Physical volume —
PV Name /dev/mapper/bkpcvrdd01newp1
VG Name bkpcvrdvg
PV Size 50.00 GB / not usable 3.31 MB
Allocatable yes
PE Size (KByte) 4096
Total PE 12799
Free PE 12799
Allocated PE 0
PV UUID MXxLNF-hDbU-eaEp-0wyW-ly1l-N1FJ-Bh2fNk

Both are the same size but due to the physical structure, each disk shows a different size.

Run fdisk -l and observe the size. This is the disk after a LUN expansion.

root@linux:~ # fdisk -l /dev/mapper/bkpcvrdd01new

Disk /dev/mapper/bkpcvrdd01new: 54.2 GB, 54223962112 bytes
255 heads, 63 sectors/track, 6592 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/mapper/bkpcvrdd01newp1 1 6592 52950208+ 8e Linux LVM

Now compare both disk sizes:

53.6 GB, 53687746560 bytes
53.6 GB, 53686370304 bytes

Advertisement