Bug 18972 - mdadm won't make an array with more than 27 raid devices
Summary: mdadm won't make an array with more than 27 raid devices
Status: RESOLVED DOCUMENTED
Alias: None
Product: IO/Storage
Classification: Unclassified
Component: MD (show other bugs)
Hardware: All Linux
: P1 normal
Assignee: Neil Brown
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-09-22 22:07 UTC by Rich Ercolani
Modified: 2010-09-22 22:53 UTC (History)
1 user (show)

See Also:
Kernel Version: 2.6.35
Subsystem:
Regression: No
Bisected commit-id:


Attachments

Description Rich Ercolani 2010-09-22 22:07:07 UTC
Precisely as the subject says.

I expected mdadm --create -l 0 -n 36 /dev/sd[b-z] /dev/sda[a-k] to work.

Instead, I was informed:
mdadm: invalid number of raid devices: 36

Empirically, I tested, and found it rejected any number greater than 27.

Why 27? The man page and documentation don't appear to have any notes on the topic.

Why file it on kernel.org? Because I don't know if this is a kernel md limitation or a software mdadm detail.

Tested on mdadm 2.6.7.1 and 3.1.4, using 2.6.35.
Comment 1 Rich Ercolani 2010-09-22 22:24:45 UTC
I found what's catching me in mdadm, at least.

md_p.h:
  #define MD_SB_DISKS                      27

mdadm.c:
  int max_disks = MD_SB_DISKS; /* just a default */

and then, later

mdadm.c:
        if (raiddisks) {   
                if (raiddisks > max_disks) {
                        fprintf(stderr, Name ": invalid number of raid devices: %d\n",
                                raiddisks);
                        exit(2);   
                }
                ...
        }

So it's at least a hardcoded value in mdadm. My question is whether Linux MD also breaks if I screw with that value.
Comment 2 Neil Brown 2010-09-22 22:38:31 UTC
Try
   man 4 md

search for '28'.

With mdadm, try
   --metadata=1.2
or if you particularly need the metadata to be at the end of the device,
   --metadata=1.0

NeilBrown
Comment 3 Neil Brown 2010-09-22 22:47:05 UTC
Or to put it another way, this is a known issues with the original
metadata format (0.90), which is one of the reasons that a new format
(1.x) was created.

mdadm is supposed to automatically choose 1.x if too many devices are
requested, but it looks like I didn't check that code properly.
Though it is moot now, as most recent mdadm defaults to 1.x...
Comment 4 Rich Ercolani 2010-09-22 22:53:55 UTC
Does it? I tried using 3.1.4, so unless you mean git HEAD, it certainly didn't do the Right thing without explicitly being told --metadata 1.0 or --metadata 1.2...

Note You need to log in before you can comment on or make changes to this bug.