You are not logged in.

#1 2009-08-23 06:22:53

Prozzaks
Member
Registered: 2009-08-23
Posts: 16

[SOLVED]RAID Autodetect does not work

Hi Archlinux community!

I have a small problem with my new Software RAID-5 setup.  It doesn't get automatically detected and assembled when the kernel boots.

The raid device (/dev/md0) has been created with four other block devices (/dev/sdb1, /dev/sdc1, /dev/sdd1, /dev/sde1).  Each partition is of the 0xFD type which is "Linux raid autodetect".

With my previous system (Gentoo), this was sufficient.  Upon booting, the kernel would probe for existing RAID arrays after loading the RAID driver and would activate them.  I want to get the same behaviour with Archlinnux since I want to mount the RAID device as /home.

I tried adding "raid" to the hooks in /etc/mkinitcpio.conf

HOOKS="base udev autodetect pata scsi sata raid filesystems"

After I forced an update with pacman -S kernel26, but it did not work.  I also tried putting "madadm" in the HOOKS instead of raid and it did not work either.

I know the RAID is clean and can be properly assembled with :

mdadm --assemble /dev/md0 /dev/sdb1 /dev/sdc1 /dev/sdd1 /dev/sde1

What can/must I do to have the device automatically detected, assembled and activated at boot time?

Thank you in advance for your help! smile

Last edited by Prozzaks (2009-08-24 18:48:11)

Offline

#2 2009-08-23 15:12:17

lilsirecho
Veteran
Registered: 2003-10-24
Posts: 5,000

Re: [SOLVED]RAID Autodetect does not work

Generate a  file in /etc/rc.local:

mdadm --assemble  /dev/md0 /dev/sd[bcde] ; mount -t ext3 /dev/md0 /mnt/md

This will assemble and mount the /raid array automatically.

If you need a different arrangement, modify the code as desired.


Prediction...This year will be a very odd year!
Hard work does not kill people but why risk it: Charlie Mccarthy
A man is not complete until he is married..then..he is finished.
When ALL is lost, what can be found? Even bytes get lonely for a little bit!     X-ray confirms Iam spineless!

Offline

#3 2009-08-23 16:21:10

lilsirecho
Veteran
Registered: 2003-10-24
Posts: 5,000

Re: [SOLVED]RAID Autodetect does not work

Perhaps the better solution for your system:
In /etc/rc.conf:

mdadm --assemble /dev/md0 /dev/sd[bcde] ; mount /dev/md0 /home -o ro ; mount -o remount, r/w /home

I note this procedure in another post this date.

I would expect that the mount command might have to include the filesystem.


Prediction...This year will be a very odd year!
Hard work does not kill people but why risk it: Charlie Mccarthy
A man is not complete until he is married..then..he is finished.
When ALL is lost, what can be found? Even bytes get lonely for a little bit!     X-ray confirms Iam spineless!

Offline

#4 2009-08-23 16:50:06

lilsirecho
Veteran
Registered: 2003-10-24
Posts: 5,000

Re: [SOLVED]RAID Autodetect does not work

After researching the autodetect and mdadm wiki, it may be that you need to perform:

mkinitcpio -p kernel26

Not sure but LVM may be required for your fs.


Prediction...This year will be a very odd year!
Hard work does not kill people but why risk it: Charlie Mccarthy
A man is not complete until he is married..then..he is finished.
When ALL is lost, what can be found? Even bytes get lonely for a little bit!     X-ray confirms Iam spineless!

Offline

#5 2009-08-23 18:05:04

lilsirecho
Veteran
Registered: 2003-10-24
Posts: 5,000

Re: [SOLVED]RAID Autodetect does not work

Perhaps you can perform the following to successfully mount your raid...I was successful with a similar autodetect just a few minutes ago.

EDIT: The correct item to be inserted into mkinitcpio is MDADM which supercedes RAID, then run mkinitcpio -p kernel26.

The key is to setup the array in your system and activate it...then run:

mdadm -D /dev/md0 >> /etc/mdadm.conf

mdadm -E /dev/md0 >> /etc/mdadm.conf

Then ensure that /etc/mdadm.conf contains the data and SAVE the file.

Reboot and the system should autodetect your raid. 

It worked in my system.

EDIT: Perhaps a better code is as follows:

mdadm -D --scan >>/etc/mdadm.conf
mdadm -E --scan >>/etc/mdadm.conf

Last edited by lilsirecho (2009-08-23 21:16:44)


Prediction...This year will be a very odd year!
Hard work does not kill people but why risk it: Charlie Mccarthy
A man is not complete until he is married..then..he is finished.
When ALL is lost, what can be found? Even bytes get lonely for a little bit!     X-ray confirms Iam spineless!

Offline

#6 2009-08-23 19:25:37

lilsirecho
Veteran
Registered: 2003-10-24
Posts: 5,000

Re: [SOLVED]RAID Autodetect does not work

Performs correctly on two HDD's with the posted entries into mdadm.conf.


Prediction...This year will be a very odd year!
Hard work does not kill people but why risk it: Charlie Mccarthy
A man is not complete until he is married..then..he is finished.
When ALL is lost, what can be found? Even bytes get lonely for a little bit!     X-ray confirms Iam spineless!

Offline

#7 2009-08-24 01:54:26

lilsirecho
Veteran
Registered: 2003-10-24
Posts: 5,000

Re: [SOLVED]RAID Autodetect does not work

To have the raid in /Home:

 Fstab: /dev/md0     /home      FS?       defaults               0    0

Prediction...This year will be a very odd year!
Hard work does not kill people but why risk it: Charlie Mccarthy
A man is not complete until he is married..then..he is finished.
When ALL is lost, what can be found? Even bytes get lonely for a little bit!     X-ray confirms Iam spineless!

Offline

#8 2009-08-24 16:11:09

Prozzaks
Member
Registered: 2009-08-23
Posts: 16

Re: [SOLVED]RAID Autodetect does not work

To test things out, I built myself a kernel (2.6.30.5 vanilla) and I included the necessary drivers for the disk controllers, the disk drives, the RAID and the autodetect directly in the kernel.  The result : Autodetection work fine without the need for any configuration.

I do not know if there is an option that should be activated on the kernel command line to force the RAID probing or if it's the module that isn't included in the initrd or if the option is simply not compiled with the kernel package in Arch.  I will do further test to try to identify the cause.

Offline

#9 2009-08-24 16:29:22

lilsirecho
Veteran
Registered: 2003-10-24
Posts: 5,000

Re: [SOLVED]RAID Autodetect does not work

My approach used the standard mdadm method, first to load the mdadm.conf with the /dev/md0 details.  This provides autodetect with the information needed during boot and results in the assembly of the specified raid combination.  Thus, the raid devices are assembled based on the data in mdadm.conf.  This data is mandatory since many raid formats are possible.

Fstab permits that raid device to be mounted in /home.

Using this approach, I have autodetect installed and operating on Raid0 in three HDD's without changing the kernel.  The mdadm.conf data is required to autodetect.

EDIT:  The data included in mdadm permits multiple raid device arrangements to be autodetected and assembled on the same boot.  Thus raid0, raid1, raid0+1 or whatever at the same time.

Pleased to read that you have arranged a method to solve your autodetect difficulty.

You might edit it and call it solved.

-------------------------------------------------------------------
How can there be a big bang if there is no atmosphere or ears to hear!

Last edited by lilsirecho (2009-08-24 17:15:23)


Prediction...This year will be a very odd year!
Hard work does not kill people but why risk it: Charlie Mccarthy
A man is not complete until he is married..then..he is finished.
When ALL is lost, what can be found? Even bytes get lonely for a little bit!     X-ray confirms Iam spineless!

Offline

#10 2009-08-24 18:45:50

Prozzaks
Member
Registered: 2009-08-23
Posts: 16

Re: [SOLVED]RAID Autodetect does not work

lilsirecho wrote:

Thus, the raid devices are assembled based on the data in mdadm.conf.  This data is mandatory since many raid formats are possible.

I thought that the RAID configuration was embedded in the persistent superblock on each member device.  See http://tldp.org/HOWTO/Software-RAID-HOWTO-5.html#ss5.9.  The Linux Software RAID howto is outdated, but I believe that the information provided about persistent superblocks and autodetection is still valid.  Section 7.2 http://tldp.org/HOWTO/Software-RAID-HOWTO-7.html#ss7.2 talks about the requirements for autodetection.

The method you suggested, which I'm sure would work, basically isn't autodetection, but assembly of the array with the system init scripts based on a configuration file.  This would be sufficient for me since my root filesystem isn't on a RAID volume, but will not work with a root on RAID (sounds cool when said out loud wink ).  However, I'm a nasty geek and I want the greatest features available tongue  I also want to make my new distro to be as good as it can be (Only 40.0% obsolete according to http://www.oswatershed.org/)!

[prozzaks@stonewatch ~]$ grep MD_AUTODETECT /usr/src/linux-2.6.30-ARCH/.config
[prozzaks@stonewatch ~]$ grep MD_AUTODETECT /usr/src/linux-2.6.30.5/.config
CONFIG_MD_AUTODETECT=y
[prozzaks@stonewatch ~]$

The two greps above reveal that the RAID autodetect support simply isn't compiled into the default Arch kernel.  Now, I just need to figure out how to request an update to the Arch Linux kernel package. smile

Offline

#11 2009-08-24 19:03:19

lilsirecho
Veteran
Registered: 2003-10-24
Posts: 5,000

Re: [SOLVED]RAID Autodetect does not work

Perhaps the notation for mkinitcpio to enter the raid devices into "mkinitcpio " "MODULES" will give autodetect since it now would be integrated into the kernel26.

I am looking into this probability after lunch.


Prediction...This year will be a very odd year!
Hard work does not kill people but why risk it: Charlie Mccarthy
A man is not complete until he is married..then..he is finished.
When ALL is lost, what can be found? Even bytes get lonely for a little bit!     X-ray confirms Iam spineless!

Offline

Board footer

Powered by FluxBB