From: "Jun'ichi Nomura" <j-nomura@ce.jp.nec.com>
To: Neil Brown <neilb@suse.de>, Alasdair Kergon <agk@redhat.com>,
Lars Marowsky-Bree <lmb@suse.de>
Cc: device-mapper development <dm-devel@redhat.com>,
linux-kernel@vger.kernel.org
Subject: [PATCH 0/3] sysfs representation of stacked devices (dm/md)
Date: Fri, 17 Feb 2006 13:00:17 -0500 [thread overview]
Message-ID: <43F60F31.1030507@ce.jp.nec.com> (raw)
Hello,
These patches provide common representation of dependencies
between stacked devices (dm and md) in sysfs.
For example, if dm-0 maps to sda, we have the following symlinks;
/sys/block/dm-0/slaves/sda --> /sys/block/sda
/sys/block/sda/holders/dm-0 --> /sys/block/dm-0
This makes it easier for user space tools/scripts to find out
device dependencies.
Suppose complicated but quite normal situation like below:
We have a logical volume (dm-2) on md raid1 (md0) which is
build upon dm-multipath (dm-0, dm-1) on FC disks (sda .. sdd).
dm-2
+-- md0
|-- dm-0
| |-- sda
| +-- sdb
|
+-- dm-1
|-- sdc
+-- sdd
Though md0, dm-0, dm-1 and sd[a-d] contain same LVM2 meta data,
LVM2 should pick up md0 as PV, not dm-0, dm-1 and sdXs.
mdadm should build md0 from dm-0 and dm-1, not from sdXs.
Similar things will happen on 'mount' and 'fsck' if we use
file system labels instead of LVM2.
Currently, these relationships are determined by each tool
combining information like the existence of md metadata
and dm dependency ioctl.
With the patches, symlinks are created as shown below:
/sys/block/dm-2/slaves/md0 --> /sys/block/md0
/sys/block/md0/holders/dm-2 --> /sys/block/dm-2
/sys/block/md0/slaves/dm-1 --> /sys/block/dm-1
/sys/block/md0/slaves/dm-0 --> /sys/block/dm-0
/sys/block/dm-0/holders/md0 --> /sys/block/md0
/sys/block/dm-0/slaves/sda --> /sys/block/sda
/sys/block/sda/holders/dm-0 --> /sys/block/dm-0
...
thus we only need to check "holders" directory of the device
to decide whether the device is used by dm/md.
Also we can walk down the "slaves" directories to collect
the devices conposing the given dm/md device.
The idea was raised in dm-devel by Lars in the last year
but I couldn't find follow ups of actual implementation.
https://www.redhat.com/archives/dm-devel/2005-April/msg00040.html
Any comments?
--
Jun'ichi "Nick" Nomura, NEC Solutions (America), Inc.
next reply other threads:[~2006-02-17 17:59 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-02-17 18:00 Jun'ichi Nomura [this message]
2006-02-17 18:01 ` [PATCH 1/3] sysfs representation of stacked devices (dm/md common) Jun'ichi Nomura
2006-02-17 18:44 ` Alasdair G Kergon
2006-02-18 1:03 ` Jun'ichi Nomura
2006-02-18 19:50 ` Alasdair G Kergon
2006-02-21 15:33 ` Jun'ichi Nomura
2006-02-21 15:52 ` Alasdair G Kergon
2006-02-17 18:03 ` [PATCH 2/3] sysfs representation of stacked devices (dm) Jun'ichi Nomura
2006-02-17 18:05 ` [PATCH 3/3] sysfs representation of stacked devices (md) Jun'ichi Nomura
2006-02-17 19:42 ` [PATCH 0/3] sysfs representation of stacked devices (dm/md) Alasdair G Kergon
2006-02-18 1:21 ` Jun'ichi Nomura
2006-02-18 19:53 ` Alasdair G Kergon
2006-02-21 15:34 ` Jun'ichi Nomura
2006-02-18 6:06 ` Kyle Moffett
2006-02-19 22:04 ` Neil Brown
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=43F60F31.1030507@ce.jp.nec.com \
--to=j-nomura@ce.jp.nec.com \
--cc=agk@redhat.com \
--cc=dm-devel@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=lmb@suse.de \
--cc=neilb@suse.de \
/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