Bug 222158

Summary: RFE: PV defragmentation tool
Product: [Fedora] Fedora Reporter: Dave Wysochanski <dwysocha>
Component: lvm2Assignee: LVM and device-mapper development team <lvm-team>
Status: CLOSED WONTFIX QA Contact: Corey Marthaler <cmarthal>
Severity: medium Docs Contact:
Priority: medium    
Version: rawhideCC: agk, buchner.johannes, dwysocha, gmazyland, jbrassow, ktdreyer, lvm-team, mcepl, ovasik
Target Milestone: ---Keywords: FutureFeature
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-08-06 01:14:43 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Dave Wysochanski 2007-01-10 18:33:55 UTC
Might be a useful new feature.

https://www.redhat.com/archives/linux-lvm/2006-December/msg00035.html

"> Any way to "reorganize" the PV, or am I stuck?
Yes and No.  What you want is an lvm repacker.  Basically a defragmentation 
program for PV Extents.  This way you can put all the extents that are not 
allocated contiguously into contiguous blocks.  Currently no such tool 
exists.  Right now extents can get fragmented with more growing and shrinking 
of logical volumes.

You can accomplish this same task manually with a bit of work.  All you need 
to do is look at the allocated extents on the pv you wish to make smaller and 
allocate them elsewhere.

The tools you'll need are lvdisplay -m and pvmove. "

Comment 1 Jon Stanley 2008-04-23 20:29:43 UTC
Adding FutureFeature keyword to RFE's.

Comment 2 Matěj Cepl 2009-06-04 18:43:43 UTC
Alternative would be dragging&dropping of logical volumes in system-config-lvm.

Comment 3 Johannes Buchner 2011-09-12 22:35:50 UTC
There is some code here that does the job, just needs to be re-written in python, wired with pvmove and integrated into system-config-lvm.

http://bisqwit.iki.fi/source/lvm2defrag.html

Ideal would probably be a "Optimize" menu item in Tools or something.

Comment 4 Dave Wysochanski 2015-07-30 11:38:02 UTC
This bug has been open for 8 years now and there doesn't seem to be much interest.  Can it be closed?

Comment 5 Milan Broz 2015-07-30 12:14:12 UTC
I would like to see that tool even after these 8 years of waiting :-)

Comment 6 Alasdair Kergon 2015-07-30 18:08:32 UTC
I don't think the passage of time has had much effect on this feature: it still needs to be written one day.

Comment 7 Jonathan Earl Brassow 2019-08-06 01:14:43 UTC
(In reply to Dave Wysochanski from comment #4)
> This bug has been open for 8 years now and there doesn't seem to be much
> interest.  Can it be closed?

I'm closing it.