All of lore.kernel.org
 help / color / mirror / Atom feed
From: malahal@us.ibm.com
To: dm-devel@redhat.com
Subject: Re: Device-mapper for write monitoring
Date: Sun, 22 Feb 2009 21:48:53 -0800	[thread overview]
Message-ID: <20090223054852.GA9395@us.ibm.com> (raw)
In-Reply-To: <OFB375B90B.5958A499-ONC2257565.0042E713-C2257565.00491A7B@il.ibm.com>

Michael Keller [MKELLER@il.ibm.com] wrote:
> 
> > As far as I know, "dm tables" are not stored persistently by the device
> > mapper tools. LVM is the one that stores and uses it from
> > initramfs/initrd. You will have to write your own tools to store the
> > configuration and use it. These tools will have to be included in the
> > initramfs/initrd for your thing to work on root device. You may need to
> > reserve some space on the device to store your configuration!
> 
> But now suppose, I added a simple dm-linear device in between LVM and the
> physical device - so to speak, a glass sheet on top of the physical volume.
> What would happen? I tried something similar outside the boot process: I
> put a dm-delay device on top of /dev/sda1 (which is a PV). The
> resulting /dev/mapper/delayed has no users, and obviously the logical
> volumes are not suddenly magically going through this device. On the other
> hand, when I did a pvscan, it would now report to me a physical volume
> called /dev/mapper/delayed, rather than /dev/sda1! I suppose from LVM's
> point of view, it just finds two identical devices (two devices with
> identical LVM metadata), and chooses to display ... well, one of them.

If your LVM used /dev/mapper/delayed device as a PV, that amounts to
inserting dm-delayed between LVM and the "physical volume". By default
LVM scans all block devices in /dev. You should add "filter" rules so
that LVM doesn't use /dev/sda1 but /dev/mapper/delayed. You will need
code to make it persistent though -- either LVM changes or new tools!

> This means that in the boot process, to support a similar setup, I'd need
> to create my device first, and then somehow instruct 'lvm vgscan' to make
> the correct choice. I think /etc/lvm/lvm.conf (included in initrd) allows
> me to do so. At this point this is clearly becoming an LVM question, rather
> than a device-mapper question.
> 
> Unless I missed something?

You are right! Look at multipath tools. Multipath tools also use device
mapper framework. People use LVM on top of multipath devices. Multipath
tools use device identification and don't need to store any metadata on
the devices themselves. You could probably use similar method depending
on what you want to do.

Thanks, Malahal.

  reply	other threads:[~2009-02-23  5:48 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-19  8:06 Device-mapper for write monitoring Michael Keller
2009-02-19 14:28 ` malahal
2009-02-22 13:18   ` Michael Keller
2009-02-23  5:48     ` malahal [this message]
2009-02-19 14:49 ` Alasdair G Kergon
2009-02-22 13:28   ` Michael Keller

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=20090223054852.GA9395@us.ibm.com \
    --to=malahal@us.ibm.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.