[dm-devel] creating partition mappings with different delimiters
Eddie Williams
Eddie.Williams at steeleye.com
Tue Apr 4 13:31:20 UTC 2006
On Mon, 2006-04-03 at 23:23 +0200, Christophe Varoqui wrote:
> Eddie Williams a écrit :
> > I see it is kpartx that is defaulting to the 'p' as the delimiter (in
> > the set_delimiter function) when the uuid ends with a digit and no
> > delimiter when the uuid ends with a character.
> >
> > Wouldn't it be better to always use the same delimiter by default? As
> > it stands now one will not be able to determine that a node is a
> > partition versus a full device by just looking at the name.
> >
> >
> This behaviour mimics the kernel partition naming policies : /dev/sd?
> partitions have no separator, while /dev/cciss/c0d0 have one, for example.
Yes and no. Yes, for /dev/sd nodes it never adds a separator and
for /dev/cciss it always adds one. But "no" in the sense that I can not
think of any examples prior to this where sometimes it does and
sometimes it doesn't (add a separator) for the same device type.
The key item here is that it was consistent. For each device you knew
what to expect. That made for a nice easy regular expression to figure
out what kind of device you were dealing with.
For the case of "uuid" nodes I do not see a way to use a regular
expression to determine what kind of node you are dealing with. If you
have a node that ends with something like "c1" you can not tell if that
is partition 1 or the full device.
Yes, there are tools available to figure out if a node is a partition or
the full disk. I have to admit to being lazy and like the ease at being
able at a glance to tell what the node represents. The same work I do
not want to have to do as a human I also do not want to have to add to
my programs. I often find being lazy makes for good programming.
Accomplishing a task with minimal work is always best (and even better
if you find someone else has done the work for you).
>
> kpartx once meant to be a true alternative to in-kernel partition
> handling, thus cared about that naming compatibility.
>
> I'm inclined to leave it that way, if not only to discourage people to
> partition multipathed devices :)
I can understand that, I was a bit disappointed when I found that kpartx
existed. I was not expecting to support partitions on multipath
devices. The cat is out of the bag now and I doubt it will go back in.
Partitions are here to stay.
I started to suggest that I could add a way, perhaps in multipath.conf,
to define a default separator. That way someone could override the
default behavior fairly easily. I am not sure making this change now is
worth it though. I will just accept that I probably need to run
'dmsetup info' on a node to figure out if it is a partition or disk.
Thanks
Eddie
More information about the dm-devel
mailing list