All of lore.kernel.org
 help / color / mirror / Atom feed
From: NeilBrown <neilb@suse.de>
To: Benjamin ESTRABAUD <be@mpstor.com>
Cc: linux-raid@vger.kernel.org
Subject: Re: mdadm: use static major/minor numbers.
Date: Wed, 21 Nov 2012 08:16:22 +1100	[thread overview]
Message-ID: <20121121081622.162d6f08@notabene.brown> (raw)
In-Reply-To: <50AB7964.60002@mpstor.com>

[-- Attachment #1: Type: text/plain, Size: 2328 bytes --]

On Tue, 20 Nov 2012 12:36:52 +0000 Benjamin ESTRABAUD <be@mpstor.com> wrote:

> Hi!
> 
> I recently updated mdadm-2.6.9 to mdadm-3.2.6 on a system (own busybox 
> based distro) that had its kernel version updated from 2.6.35 to 3.4.
> 
> Everything works well apart from a feature I used that I seem to be 
> unable to reactivate:
> 
> In the past, to ensure knowing the number of possible RAID devices that 
> could be created on the system, I used static major:minor mappings by 
> building the /dev/md/dXX and /dev/md/dXXpXX entries (with major 254, and 
> three minors for each device for 3 partitions), allowing me to be 
> certain that 64 RAID devices could be created at all times.
> 
> When creating an array, the /dev/md/dXX and dXXpXX devices "nodes" would 
> be used (not recreated) and the major/minor number these devices point 
> to would be used for the actual MD block device.
> 
> This was a very handy feature. With the latest mdadm, I simply cannot do 
> that, as creating a /dev/md/dXX will in fact remove that device file and 
> symlink it to /dev/md_dXX. I then created /dev/md_dXX devices prior to 
> creating an array, and got the following error message: "mdadm: 
> /dev/md_d3 exists but looks wrong, please fix".
> 
> Looking through the source I can see that mdadm basically verifies if 
> the file's major/minor matches the one that it had planned for the 
> device, which in this case doesn't.
> 
> Is there any way to work around that? Or in fact, I don't actually 
> *need* to use static major/minor numbers, but I need to know in advance 
> how many RAIDs I'll be able to create provided I'll always use 2 
> partitions for them and can provide the -amdp2 argument to mdadm to make 
> sure that only 2 partitions devices nodes are created.
> 
> Is there a way to know the maximum number of RAIDs that can be created, 
> provided that nothing else uses major 9 and 254?
> 
> Thank you very much in advance for your help!

I don't really understand what your problem is.

mdadm should create any devices it needs - unless it detects udev, in which
case it leaves the device creation to udev.

So simply don't create any md devices in /dev and let mdadm do whatever is
required.
Does that approach not suit your needs?  If not, why not?

NeilBrown

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 828 bytes --]

  reply	other threads:[~2012-11-20 21:16 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-20 12:36 mdadm: use static major/minor numbers Benjamin ESTRABAUD
2012-11-20 21:16 ` NeilBrown [this message]
2012-11-21 12:26   ` Benjamin ESTRABAUD
2012-11-21 20:57     ` NeilBrown
2012-11-22 11:26       ` Benjamin ESTRABAUD

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=20121121081622.162d6f08@notabene.brown \
    --to=neilb@suse.de \
    --cc=be@mpstor.com \
    --cc=linux-raid@vger.kernel.org \
    /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.