linux-lvm.redhat.com archive mirror
 help / color / mirror / Atom feed
From: Phillip Susi <psusi@cfl.rr.com>
To: LVM general discussion and development <linux-lvm@redhat.com>
Cc: "Brian J. Murrell" <brian@interlinx.bc.ca>
Subject: Re: [linux-lvm] will pvmove'ing (an LV at a time) defragment?
Date: Thu, 29 Apr 2010 14:23:43 -0400	[thread overview]
Message-ID: <4BD9CEAF.3060906@cfl.rr.com> (raw)
In-Reply-To: <loom.20100429T185325-182@post.gmane.org>

On 4/29/2010 12:59 PM, Brian J. Murrell wrote:
> If I currently have a volume group consisting of two drives and I add a third 
> drive and them pvmove from the two existing drives to the new drive, will that 
> defragment my LVs?  i.e.:
> 
> # pvmove /dev/sda2 /dev/sdb /dev/sdc
> 
> where /dev/sdc is the new empty drive.

That will move all extents OFF of sda2 and onto sdb and sdc.  I believe
that the default allocation policy will try to locate extents on the
same pv as other extents that lv is using.  Whether or not that results
in more or less fragmentation depends on the current layout.

> Or will it just move the PEs from each source disk (in turn) in the order they 
> appear on the source disk, effectively just concatenating the two sources disks 
> to the new target disk?

In the above command there is one source disk and two destination disks,
not the other way around.  Only the first argument to pvmove is the
source, any additional arguments lists valid destination(s), otherwise
any pv other than the first argument is used.

If you want to defrag your lvs then you need to look at the current
layout with lvdisplay -m and then you can tell pvmove exactly what
extents you want moved to where with something like pvmove /dev/sda:x-y
/dev/sda:q-r --alloc anywhere.  The --alloc anywhere is needed if the
source and destination drives are the same, since otherwise pvmove tries
to move the extents to any volume OTHER than the source, and if you
restrict the possible destinations with the second argument to only the
source drive, the allocation will fail.

  parent reply	other threads:[~2010-04-29 18:23 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-29 16:59 [linux-lvm] will pvmove'ing (an LV at a time) defragment? Brian J. Murrell
2010-04-29 18:13 ` Alasdair G Kergon
2010-04-29 18:23 ` Phillip Susi [this message]
2010-05-01 13:26 ` Brian J. Murrell
2010-05-01 22:19   ` Phillip Susi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4BD9CEAF.3060906@cfl.rr.com \
    --to=psusi@cfl.rr.com \
    --cc=brian@interlinx.bc.ca \
    --cc=linux-lvm@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).