LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   RAID array not detected on boot (https://www.linuxquestions.org/questions/slackware-14/raid-array-not-detected-on-boot-826521/)

Laodiceans 08-16-2010 07:20 AM

RAID array not detected on boot
 
I have a raid array level 5 with metadata 1.2 made with mdadm. I put it on /etc/fstab to mount it on boot but it doesn't works because the raid is not detected on boot.

I have a /etc/mdadm.conf like this:

Code:

ARRAY /dev/md0 level=raid5 num-devices=3 metadata=1.2 name=0 UUID=afdfe00e:0d18a5eb:29aa54f9:8b422ee0
Just another thing...

After the command
Code:

mdadm --detail --scan >> /etc/mdadm.conf
The mdadm.conf is like this:

Code:

ARRAY /dev/md0 level=raid5 num-devices=3 metadata=1.02 name=0 UUID=afdfe00e:0d18a5eb:29aa54f9:8b422ee0
But I change manually the metadata version because the 1.02 give me a error. I don't know if it is a bug or what!

Beside this. I have to put a line in /etc/rc.d/rc.local to assemble the array.

Code:

mdadm --assemble --scan --uuid=afdfe00e:0d18a5eb:29aa54f9:8b422ee0
And after that I already can mount it.

Why the array is not detected on boot? Is because metadata type is prior to 1.00?
Can I put the line I have on /etc/rc.d/rc.local to assemble the array in another file, that will be executed before /etc/fstab?

Richard Cranium 08-16-2010 07:41 AM

What version of Slackware? Are you using an initrd? What does "mdadm -E -s" give you?

Laodiceans 08-16-2010 07:52 AM

Slackware 13.1
I am not using any initrd.

mdadm -E -s gives:

Code:

ARRAY /dev/md/0 level=raid5 metadata=1.2 num-devices=3 UUID=afdfe00e:0d18a5eb:29aa54f9:8b422ee0 name=0

Richard Cranium 08-16-2010 08:38 AM

OK, if you boot with an initrd, you'll get your raid array created for you. That's pretty much the only way you can do it. On the plus side, it's pretty easy to boot with an initrd.

Perhaps the best thing to do is to run
Code:

/usr/share/mkinitrd/mkinitrd_command_generator.sh --longhelp
as root and read the output. Did you compile your own kernel?

Laodiceans 08-16-2010 10:29 AM

Nop. I use the kernel shipped with slackware.

Richard Cranium 08-16-2010 10:53 AM

OK.

The only mdadm code that is run during boot is found in the initrd's init script. Anything that you put in rc.local is run at the end of /etc/rc.d/rc.M, which is at the end of the multiuser boot.

The long instructions for the mkinitrd_command_generator.sh command (which is what you get when you run the command line that I gave above) tells you pretty much everything that you need to do. /boot/README.initrd will tell you everything else that you need to know.

(I don't know why the RAID autodetect stuff isn't also in /etc/rc.d/rc.S. The LVM code is in the initrd init script and in /etc/rc.d/rc.S.)


All times are GMT -5. The time now is 06:59 PM.