Re: RAID starting at md127 instead of md0
Worked for me too, thanks a lot
Re: RAID starting at md127 instead of md0
Worked for me as well.
This is a great "feature". Just ate about 2 hours of my time.
Re: RAID starting at md127 instead of md0
Quote:
Originally Posted by
YesWeCan
Hi all.
This seems to be a "feature" of the mdadm in the newest kernel. There was another thread with similar symptoms recently.
For reasons I do not yet understand, mdadm seems to invent an array device name out of thin air when there is a problem. This confuses everybody. md127 seems to be a common name it now chooses.
Two things seem to be important:
1) The ARRAY statement in mdadm.conf needs to be correct. I am not convinced the direct output of mdadm -Es is reliable anymore. Especially the name directive. Mine broke because I had a space in the name!
So I would try minimizing the specifiers in your ARRAY statements: all you normally need is device name and UUID:
Code:
ARRAY /dev/md0 UUID=e4665ceb:15f8e4b6:b186d497:7d365254
And there seems to be some change to do with /dev/md/* and /dev/md* which I don't yet understand.
2) You need to update initramfs so it contains your mdadm.conf settings during boot.
Code:
sudo update-initramfs -u
Try those and report back. :)
Quote:
Originally Posted by
nasha
Yep, that's correct.
The new mdadm/kernel setup creates the default mdadm.conf file with --name=NAS:0 or equivalent.
When a --name parameter is set, a random (seems to always be 127) md device is created that actually symlinks to /dev/md/NAS:0 or equivalent.
Removing the name= from the mdadm.conf sets it back to normal
Good answers. I dropped the name in my mdadm.conf and ran update-initramfs as described. System is now where I want it to be.
Re: RAID starting at md127 instead of md0
Quote:
Originally Posted by
nasha
Yep, that's correct.
The new mdadm/kernel setup creates the default mdadm.conf file with --name=NAS:0 or equivalent.
When a --name parameter is set, a random (seems to always be 127) md device is created that actually symlinks to /dev/md/NAS:0 or equivalent.
Removing the name= from the mdadm.conf sets it back to normal
FYI, if you are trying to use a large drive (2TB in my case) your problem is not simply mis-numbered RAID devices, it's the partition table on large drives are not the same. You have to use a GUID partition table (GPT) instead of the legacy MBR in all drives larger than 2TB.
Google "GUID partition table (GPT) grub linux howto"
Re: RAID starting at md127 instead of md0
Quote:
Originally Posted by
YesWeCan
Hi all.
This seems to be a "feature" of the mdadm in the newest kernel. There was another thread with similar symptoms recently.
For reasons I do not yet understand, mdadm seems to invent an array device name out of thin air when there is a problem. This confuses everybody. md127 seems to be a common name it now chooses.
Two things seem to be important:
1) The ARRAY statement in mdadm.conf needs to be correct. I am not convinced the direct output of mdadm -Es is reliable anymore. Especially the name directive. Mine broke because I had a space in the name!
So I would try minimizing the specifiers in your ARRAY statements: all you normally need is device name and UUID:
Code:
ARRAY /dev/md0 UUID=e4665ceb:15f8e4b6:b186d497:7d365254
And there seems to be some change to do with /dev/md/* and /dev/md* which I don't yet understand.
2) You need to update initramfs so it contains your mdadm.conf settings during boot.
Code:
sudo update-initramfs -u
Try those and report back. :)
Ran into the same trouble here with a RAID-6 array coming up as /dev/MD127.
Your tip worked! Thanks!!!
Re: RAID starting at md127 instead of md0
Hi, I posted already in another thread, but I figure I'll post here too in case anyone ran into this. After fixing the UUID in mdadm.conf running update-initramfs outputs the following error:
Code:
mdadm: cannot open /dev/md/0: No such file or directory
However,I do have /dev/md0. I dont know what happened to mdadm so that it is expecting /dev/md/0 or why /dev/md0 is the device being created, but it seems to be keeping my array busted. If anyone knows how to solve this issue, I'd love to know.
Thanks in advance!
Re: RAID starting at md127 instead of md0
Quote:
Originally Posted by
micahgalizia
However,I do have /dev/md0. I dont know what happened to mdadm so that it is expecting /dev/md/0 or why /dev/md0 is the device being created, but it seems to be keeping my array busted. If anyone knows how to solve this issue, I'd love to know.
Thanks in advance!
I have never seen or heard of a /dev/md/0... it's always been /dev/md0.
FWIW.....
Re: RAID starting at md127 instead of md0
Quote:
Originally Posted by
micahgalizia
Hi, I posted already in another thread, but I figure I'll post here too in case anyone ran into this. After fixing the UUID in mdadm.conf running update-initramfs outputs the following error:
Code:
mdadm: cannot open /dev/md/0: No such file or directory
However,I do have /dev/md0. I dont know what happened to mdadm so that it is expecting /dev/md/0 or why /dev/md0 is the device being created, but it seems to be keeping my array busted. If anyone knows how to solve this issue, I'd love to know.
Thanks in advance!
I was having a similar issue with gparted saying something like "could not stat /dev/md/0" when my array is md0. Also, the array was not getting found by nautilus/showing up in the Devices section for mounting.
I'm not sure if this is the correct thing to do but I made the /dev/md directory then made a symbolic link to /dev/md0 by running
Code:
sudo ln -s /dev/md0 /dev/md/0
Not the array shows up in gparted in the drop down/select window as /dev/md0 and it also shows in the devices window in Nautilus and is mountable by clicking on it. Only quirk now is when you select /dev/md0 in the gparted drop down, the actual partition shows up as /dev/md0p1.
So far it seems to be working - aside from gparted showing a wonky name...
I'll keep playing with it...
Re: RAID starting at md127 instead of md0
Quote:
Originally Posted by
CrazyMike
Only quirk now is when you select /dev/md0 in the gparted drop down, the actual partition shows up as /dev/md0p1.
OK, nevermind /dev/md0p1 appears to be normal partition naming, so it appears I'm in good shape here...
Re: RAID starting at md127 instead of md0
FYI I have done some more research on this and I wanted to share with you how I think mdadm with metadata 1.2 actually deals with device naming. I CANNOT FIND ANY COMPLETE DOCUMENTATION so this may not be a complete picture.
Each disk has a superblock that specifies a bunch of things but includes the array UUID and the array name.
The default is to assemble the array under the device names
/dev/md/<Name> and /dev/mdN where N is made up but seems to start at 127 and count down. Note, two device files are created for one device.
It is as if at the /dev/md/ level it can use the name off disk but at the /dev/ level it has to use 'md' + a number.
However, if the disk Name happens to be a number (no text) then it uses this number at the /dev level too.
Ex1: If the on-disk Name=crazy8 the array device names will be /dev/md/crazy8 and /dev/md127
Ex2: If the on-disk Name=8 the array device names will be /dev/md/8 and /dev/md8
This had me very confused for a while.
Now, a device name in an ARRAY statement in mdadm.conf will override (partially) the disk name.
Ex3. ARRAY /dev/md2 UUID=ABCD... name=crazy8
/dev/md/2 and /dev/md2
Ex4. ARRAY /dev/md/pot UUID=ABCD... name=3
/dev/md/pot and /dev/md3
Notice that at the /dev level it will use a valid number from the name.
Following this? It gets worse! When you give an array a name that is just a number (no text) mdadm prefixes it with your hostname when it displays it.
Ex5. array name=88 and your hostname=tonys_pc
mdadm -Es will output
ARRAY /dev/md/88 ... name=tonys_pc:88
So I think "88" is all that is written to the disk superblocks but mdadm adds your hostname prefix to it when it displays it. So you are not seeing what is actually in the superblocks. But it DOES NOT use the hostname prefix name when allocating a device name. In this case the device names are
/dev/md/88 and /dev/md88
The bottom line for me is that it is essential to define an ARRAY statement in mdadm.conf to tell it what to call things so that it doesn't just go off and make names up that will confuse the heck out of you. :)