All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jitendra <jkhasdev@gmail.com>
To: Zdenek Kabelac <zkabelac@redhat.com>, dm-devel@redhat.com
Subject: Re: device mapper mapping across reboot
Date: Sat, 10 Mar 2018 16:17:47 +0530	[thread overview]
Message-ID: <20180310104747.GA1027@gmail.com> (raw)
In-Reply-To: <f0e41723-159a-fe39-42f2-4a2ef1466bfa@redhat.com>



>lvm2 is exactly solving this problem as it maintains consistent
>'metadata' on every device - so upon reboot devices are discovered and
>from their metadata dm tables are actived/restored.

Got it.

>So  are you looking for recreation of all the lvm2 infrastructure for
>this relatively quite complex task ?
Not exactly, but I want to create mapper device created before the root and
other fs get mounted so that I can track I/Os in target.

>Or you just want to 'create' DM after kernel is booted ?
dmsetup create with my target.

>Or you even want to pass 'DM' table line on kernel boot option line -
>so even your boot device is a 'DM' device ?

It is something exactly, I wanna to do.

eg. I wrote a basic target as explained here
http://techgmm.blogspot.in/p/writing-your-own-device-mapper-target.html

Now, to use this target (kernel module), I need to create mapper device as
echo 0 <size_of_device> basic_target /Path/to/your/device 0 | dmsetup create my_basic_dm_device

After creation of device as /dev/mapper/my_basic_dm_device for /dev/sda, if I do I/O from
/dev/mapper/my_basic_dm_device, then all I/O goes through basic_target before it
hits to /dev/sda.

Now, if system is booted and disk is offline then it is very easy to create
mapper device. But now let suppose I want to boot on
/dev/mapper/my_basic_dm_device instead of /dev/sda1 etc. then I have to create
mapper device even before it get switch root.

This is same case for other disks as well. So there should be a way so that I
can use device mapper framework after reboot.

---
Jitendra

  reply	other threads:[~2018-03-10 10:47 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-09  9:58 device mapper mapping across reboot jitendra kumar khasdev
2018-03-09 13:31 ` Zdenek Kabelac
2018-03-10 10:47   ` Jitendra [this message]
2018-03-12  9:49     ` Zdenek Kabelac
2018-03-12 11:09       ` Jitendra
2018-03-12 14:41         ` Zdenek Kabelac

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=20180310104747.GA1027@gmail.com \
    --to=jkhasdev@gmail.com \
    --cc=dm-devel@redhat.com \
    --cc=zkabelac@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.