[linux-lvm] defragging logical volumes

Eric M. Hopper hopper at omnifarious.org
Wed Sep 5 02:19:58 UTC 2001


On Tue, Sep 04, 2001 at 09:58:05PM -0400, Jason Edgecombe wrote:
> hi,
> 
>   how can I rearrange logical volumes so that they are contiguous? does
> it matter if the root LV isn't contiguous?

	I've thought of this too, and I bet it matters some, but not
very much.  The extents in question are 4M in size.  If you are
concerned about it, you could try increasing the extent size to 32M and
not lose much in the way of resize granularity.

	The only time it matters is when a normally contiguous read
crosses a logical extent boundary.  So, larger logical extents make this
less likely.  Also, LVM tends to allocate things contiguously anyway.

	Still, the pvmove mechanism provides a way to defragment if
you're concerned about it.  I don't think such a utility exists, but,
given the existence of pvmove, I doubt it would be too hard to write.
'tsort' is your friend.  :-)

	Of course, pvmoving things while the filesystem is still running
is a little dangerous as LVM doesn't do any kind of journalling of
metadata that I know of.  If the power goes out during a move..
*shudder*

Have fun (if at all possible),
-- 
"It does me no injury for my neighbor to say there are twenty gods or no God.
It neither picks my pocket nor breaks my leg."  --- Thomas Jefferson
"Go to Heaven for the climate, Hell for the company."  -- Mark Twain
-- Eric Hopper (hopper at omnifarious.org  http://www.omnifarious.org/~hopper) --
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 232 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/linux-lvm/attachments/20010904/595b7d86/attachment.sig>


More information about the linux-lvm mailing list