All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Bryn M. Reeves" <bmr@redhat.com>
To: device-mapper development <dm-devel@redhat.com>
Cc: Bernd Broermann <bernd@broermann.com>
Subject: Re: DM inconsistent after disk migration
Date: Thu, 20 Oct 2011 16:09:01 +0100	[thread overview]
Message-ID: <4EA0398D.4020207@redhat.com> (raw)
In-Reply-To: <780ff8d84fb70f7ddf8beb696ff02ddf.squirrel@webmail.xlab.net>

On 10/20/2011 03:47 PM, Bernd Broermann wrote:
> CODE "move" script
> # mirror
> pvcreate /dev/disk2
> vgextend vg01  /dev/disk2
> lvconvert -m1 --mirrorlog core /dev/vg01/lvdata  /dev/disk2
> # split
> lvconvert -m0 --mirrorlog core /dev/vg01/lvdata  /dev/disk1
> vgreduce vg01  /dev/disk1
> pvremove  /dev/disk1

If you just want to move the logical extents in vg01/lvdata from disk1 
-> disk2 why not use pvmove?

Internally it will construct a corelog mirror in a very similar way but 
it saves you from having to manually split things and supports 
transactional updates allowing the move to be automatically resumed if 
it is interrupted for any reason.

E.g.:

pvcreate /dev/disk2
pvmove /dev/disk1 /dev/disk2 (you can ommit disk2 here if it's the
                               only free space in the VG and pvmove will
                               chose it automatically)
vgreduce /dev/disk1
pvremove /dev/disk1

> My assumption is that SLAVE reconfigures the device-mapper not correct,
> when doing the "move" operations on MASTER.

Nothing told the SLAVE host that vg01/lvdata had changed so it still has 
the original PV device open (from its point of view on that side of the 
SRDF replication).

If the LV is not in use you can just de-activate/re-activate to have it 
see the changes to the VG metadata:

vgchange -an vg01; vgchange -ay vg01

Unless you're using a clustered environment with clvmd hosts that have a 
common view of shared storage will not be aware of on-disk changes made 
by another host. This is hazardous if both hosts can write to the 
storage at the same time as it's possible for simultaneous updates to 
the VG metadata to corrupt one another (SRDF should prevent this since 
only one side of the replicated device can be writable at a time but 
some care is still needed to ensure all hosts have a coherent view of 
the VG).

Regards,
Bryn.

  reply	other threads:[~2011-10-20 15:09 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-20 14:47 DM inconsistent after disk migration Bernd Broermann
2011-10-20 15:09 ` Bryn M. Reeves [this message]
2011-10-28 14:06   ` Bernd Broermann

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=4EA0398D.4020207@redhat.com \
    --to=bmr@redhat.com \
    --cc=bernd@broermann.com \
    --cc=dm-devel@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.