All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hannes Reinecke <hare@suse.de>
To: device-mapper development <dm-devel@redhat.com>
Subject: Re: Determine partition prefix used for mpath devices
Date: Wed, 17 Mar 2010 17:08:53 +0100	[thread overview]
Message-ID: <4BA0FE95.8010406@suse.de> (raw)
In-Reply-To: <4B9FEA00.2040703@storix.com>

David Huffman wrote:
> In a script, I need to somehow determine what prefix is being used for
> partitions as set by UDEV. It seems that the naming convention is in
> flux and could change frequently. When using user_friendly_names the
> prefix is set using kpartx within udev rules. My problem is I need to
> know what the prefix is so my scripts know what device naming convention
> to look for.
> 
> Here are the different iterations of naming schemes:
> 
> mpath0p1
> mpath0-part1
> mpathap1
> mpatha-part1
> 
> Is there a way other than grepping through the udev rules to determine
> what the prefix is? The partitions may not exist so I cannot just look
> to see what they are. I need to know BEFORE I create partitions. I know
> this is a strange request, but I am working with a lot of code that was
> designed before multipath was available and using the sys naming is not
> an option (i.e. /disk/by-id/wwid).
> 
I wouldn't rely on the device-mapper table names, as they could be pretty
much everything.

To handle this situation I've patches up multipath and kpartx to provide
UUID prefixes, which normally can't be influenced from userspace.
Multipath devices carry the prefix 'mpath-', kpartx generated devices
carry the prefix 'part<num>-'.
So by checking the prefix you pretty much know which program generated
this particular device.

Cheers,

Hannes
-- 
Dr. Hannes Reinecke		      zSeries & Storage
hare@suse.de			      +49 911 74053 688
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: Markus Rex, HRB 16746 (AG Nürnberg)

  reply	other threads:[~2010-03-17 16:08 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-16 20:28 Determine partition prefix used for mpath devices David Huffman
2010-03-17 16:08 ` Hannes Reinecke [this message]
2010-03-17 23:39   ` David Huffman
  -- strict thread matches above, loose matches on Subject: below --
2010-03-23 16:22 David Huffman
2010-03-24 16:07 ` Hannes Reinecke
2010-03-24 18:31   ` David Huffman

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=4BA0FE95.8010406@suse.de \
    --to=hare@suse.de \
    --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.