saffsd Tux's lil' helper
Joined: 03 Mar 2006 Posts: 139
|
Posted: Mon Mar 05, 2007 12:35 pm Post subject: Splitting extents in an lvm2 PV in order to pvmove it |
|
|
Hello.
I have been tearing my hair out all night with this problem. I am trying to move data from one hard disk to another, and I've moved all the PVs save for one. Here's the bloody problem:
Code: |
# pvdisplay
--- Physical volume ---
PV Name /dev/hda18
VG Name home
PV Size 18.64 GB / not usable 0
Allocatable yes
PE Size (KByte) 4096
Total PE 4771
Free PE 163
Allocated PE 4608
PV UUID wE0ODQ-7G1F-embd-OE1J-ePw6-ENIn-SBZB3C
--- Physical volume ---
PV Name /dev/hda5
VG Name media
PV Size 18.64 GB / not usable 0
Allocatable yes (but full)
PE Size (KByte) 4096
Total PE 4771
Free PE 0
Allocated PE 4771
PV UUID zDeVbp-KM0h-ZdIU-96pA-FBe5-5UeE-dK2feF
--- Physical volume ---
PV Name /dev/hda6
VG Name media
PV Size 18.64 GB / not usable 0
Allocatable yes
PE Size (KByte) 4096
Total PE 4771
Free PE 1862
Allocated PE 2909
PV UUID LoxbWS-N0uA-eEhW-c8WX-6Xmb-qDPr-T0ot5f
--- Physical volume ---
PV Name /dev/hda7
VG Name media
PV Size 18.64 GB / not usable 0
Allocatable yes
PE Size (KByte) 4096
Total PE 4771
Free PE 2037
Allocated PE 2734
PV UUID lCTfCQ-yeyv-SvQc-in4a-2Rqx-KrU2-a2cMPV
--- Physical volume ---
PV Name /dev/hda8
VG Name media
PV Size 18.64 GB / not usable 0
Allocatable yes
PE Size (KByte) 4096
Total PE 4771
Free PE 2385
Allocated PE 2386
PV UUID f2HbDD-1zpK-JB31-aOUQ-hNR7-pv25-TyA5HF
--- Physical volume ---
PV Name /dev/hda9
VG Name media
PV Size 18.64 GB / not usable 0
Allocatable yes
PE Size (KByte) 4096
Total PE 4771
Free PE 1167
Allocated PE 3604
PV UUID Z0njRq-Eeyk-gZ3O-Rqp9-STns-gr1R-vEyr0j
--- Physical volume ---
PV Name /dev/hda10
VG Name media
PV Size 18.64 GB / not usable 0
Allocatable yes
PE Size (KByte) 4096
Total PE 4771
Free PE 2385
Allocated PE 2386
PV UUID aMnzer-I0P3-tSqJ-dgjm-EOD6-Ymma-Mcg9qB
--- Physical volume ---
PV Name /dev/hda11
VG Name media
PV Size 18.64 GB / not usable 0
Allocatable yes
PE Size (KByte) 4096
Total PE 4771
Free PE 2385
Allocated PE 2386
PV UUID 9e6lZ1-FVyv-aQe9-MBqc-0VAn-g1gZ-5JnGJS
--- Physical volume ---
PV Name /dev/hda12
VG Name media
PV Size 18.64 GB / not usable 0
Allocatable yes
PE Size (KByte) 4096
Total PE 4771
Free PE 2385
Allocated PE 2386
PV UUID BPdZKq-Il9K-zw0S-0yYM-Tkve-QD8p-Guh61h
--- Physical volume ---
PV Name /dev/hda13
VG Name media
PV Size 18.64 GB / not usable 0
Allocatable yes
PE Size (KByte) 4096
Total PE 4771
Free PE 2385
Allocated PE 2386
PV UUID x7CjcU-Lf7V-d0wY-7vLG-U2TJ-BKKD-uhWwaC
--- Physical volume ---
PV Name /dev/hda14
VG Name media
PV Size 18.64 GB / not usable 0
Allocatable yes
PE Size (KByte) 4096
Total PE 4771
Free PE 2385
Allocated PE 2386
PV UUID W6iBEV-juL1-NsYB-4Ddh-F9Vz-DY3d-4gXROz
--- Physical volume ---
PV Name /dev/hda15
VG Name media
PV Size 18.64 GB / not usable 0
Allocatable yes
PE Size (KByte) 4096
Total PE 4771
Free PE 2385
Allocated PE 2386
PV UUID SNlJi0-aG9u-IZE9-n2En-JamF-jeZ0-EKno1C
--- Physical volume ---
PV Name /dev/hda16
VG Name media
PV Size 18.64 GB / not usable 0
Allocatable yes
PE Size (KByte) 4096
Total PE 4771
Free PE 2211
Allocated PE 2560
PV UUID lZVUvw-wpHX-0sHB-ovnh-z8sC-HDL2-vcA9Nc
--- Physical volume ---
PV Name /dev/hda17
VG Name media
PV Size 18.64 GB / not usable 0
Allocatable yes
PE Size (KByte) 4096
Total PE 4771
Free PE 757
Allocated PE 4014
PV UUID fxRjZV-WKLJ-zTDK-bu4u-XEno-OjQx-hht3TZ
--- Physical volume ---
PV Name /dev/hdc17
VG Name media
PV Size 9.32 GB / not usable 0
Allocatable NO
PE Size (KByte) 4096
Total PE 2386
Free PE 0
Allocated PE 2386
PV UUID ELcwds-Lcn5-5RQn-K7iE-GHFG-suoE-Aklj1T
|
As you can see, /dev/hdc17 has 2386 PEs that need to move. Unfortunately, I have a large number of chunks of 2385 PEs available, and none that is 2386, so pvmove refuses to move it! Is there any way I can force these PEs to be split over multiple LVs in the VG? Please help!
edit:
While I'm at it, is there any way to tidy up the way these PEs have been allocated? As in, is it possible for me to reconsolidate the data such that the LVs span as few PVs as possible?
comment: If you're moving data between two hard disks, merging their VGs and doing pvmoves is a stupid way to do it. Trust me. Just make new LVs and rsync the data across. You'll be much happier in the long run. |
|