# [SOLVED] Software raid is not starting by it self?

## tomekki

Hello there, 

after booting I need to perform always 

```

# mdadm -As /dev/md5

mdadm: /dev/md5 has been started with 3 drives.

# cat /proc/mdstat

Personalities : [raid6] [raid5] [raid4]

md5 : active raid5 sdb1[0] sdd1[2] sdc1[1]

      976767872 blocks level 5, 64k chunk, algorithm 2 [3/3] [UUU]

```

 to access my software raid.

Any idea why this is not happen automatically?

thanks, Tomekki

```

# cat /etc/mdadm.conf

DEVICE /dev/sd[bcd]1

ARRAY /dev/md5 level=raid5 num-devices=3 UUID=b198e038:fd1a40fa:7e8af8ae:c79c7e1b devices=/dev/sdb1,/dev/sdc1,/dev/sdd1

```

```

mdadm --detail /dev/md5

/dev/md5:

        Version : 00.90

  Creation Time : Mon Dec 24 09:51:59 2007

     Raid Level : raid5

     Array Size : 976767872 (931.52 GiB 1000.21 GB)

  Used Dev Size : 488383936 (465.76 GiB 500.11 GB)

   Raid Devices : 3

  Total Devices : 3

Preferred Minor : 5

    Persistence : Superblock is persistent

    Update Time : Sun Nov 16 21:54:35 2008

          State : clean

 Active Devices : 3

Working Devices : 3

 Failed Devices : 0

  Spare Devices : 0

         Layout : left-symmetric

     Chunk Size : 64K

           UUID : b198e038:fd1a40fa:7e8af8ae:c79c7e1b

         Events : 0.22696

    Number   Major   Minor   RaidDevice State

       0       8       17        0      active sync   /dev/sdb1

       1       8       33        1      active sync   /dev/sdc1

       2       8       49        2      active sync   /dev/sdd1

```

Last edited by tomekki on Wed Nov 19, 2008 6:38 am; edited 1 time in total

----------

## gringo

can we have a look to a fdisk -l dev/sdc  f.ex. ? did you mark all involved partitions with fd (Linux raid autodetect) ?

cheers

----------

## tomekki

 *gringo wrote:*   

> can we have a look to a fdisk -l dev/sdc  f.ex. ? did you mark all involved partitions with fd (Linux raid autodetect) ?
> 
> cheers

 

most certainly:

```

fdisk -l /dev/sdb

Disk /dev/sdb: 500.1 GB, 500107862016 bytes

255 heads, 63 sectors/track, 60801 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

Disk identifier: 0x6ad9bXXX

   Device Boot      Start         End      Blocks   Id  System

/dev/sdb1               1       60801   488384001   83  Linux

duo tmk # fdisk -l /dev/sdc

Disk /dev/sdc: 500.1 GB, 500107862016 bytes

255 heads, 63 sectors/track, 60801 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

Disk identifier: 0x10bcdXXX

   Device Boot      Start         End      Blocks   Id  System

/dev/sdc1               1       60801   488384001   83  Linux

duo tmk # fdisk -l /dev/sdd

Disk /dev/sdd: 500.1 GB, 500107862016 bytes

255 heads, 63 sectors/track, 60801 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

Disk identifier: 0x1a441XXX

   Device Boot      Start         End      Blocks   Id  System

/dev/sdd1               1       60801   488384001   83  Linux

```

So no, the type is not Linux raid auto. 

Once this array was used with an other gentoo installation, but then, it was mounted automaticly.

I guess it is not save to chnange the partition type on the fly?

Tomekki

----------

## linuxtuxhellsinki

 *tomekki wrote:*   

> 
> 
> I guess it is not save to chnange the partition type on the fly?
> 
> Tomekki

 

I quess it is, or I haven't got any problems with it and that type is just some byte at mbr, nothing else is written to disk   :Rolling Eyes: 

----------

## drescherjm

 *Quote:*   

> I guess it is not save to chnange the partition type on the fly? 

 

It is safe to do that with fdisk. I have done this many times. Do not delete anything and you will be 100% safe.

I believe it is

t

Then answer partition # question

then 

fd

----------

## tomekki

After your encouragements I changed the partition type  :Smile: .

Unfortunately the raid is still not started automaticly after rebooting.

Do you have some other idea?

```

# fdisk -l /dev/sdb

Disk /dev/sdb: 500.1 GB, 500107862016 bytes

255 heads, 63 sectors/track, 60801 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

Disk identifier: 0x6ad9bXXX

   Device Boot      Start         End      Blocks   Id  System

/dev/sdb1               1       60801   488384001   fd  Linux raid autodetect

# fdisk -l /dev/sdc

Disk /dev/sdc: 500.1 GB, 500107862016 bytes

255 heads, 63 sectors/track, 60801 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

Disk identifier: 0x10bcdXXX

   Device Boot      Start         End      Blocks   Id  System

/dev/sdc1               1       60801   488384001   fd  Linux raid autodetect

# fdisk -l /dev/sdd

Disk /dev/sdd: 500.1 GB, 500107862016 bytes

255 heads, 63 sectors/track, 60801 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

Disk identifier: 0x1a441XXX

   Device Boot      Start         End      Blocks   Id  System

/dev/sdd1               1       60801   488384001   fd  Linux raid autodetect

```

----------

## honp

I think you must rebuild the array.

----------

## drescherjm

 *Quote:*   

> I think you must rebuild the array.

 

You should not have to do that because of the fdisk change.

----------

## minor_prophets

Wouldn't hurt though, no?

----------

## drescherjm

I believe it is a kernel or udev related problem. 

Is the raid456 driver compiled as a module or is it builtin the kernel?

Are you using openrc?

----------

## tomekki

 *drescherjm wrote:*   

> I believe it is a kernel or udev related problem. 
> 
> Is the raid456 driver compiled as a module or is it builtin the kernel?
> 
> Are you using openrc?

 

Yes, I am using openrc.

The driver was compiled as a module. Then, I compiled it into the kernel. Voilà, it works now  :Smile: .

It seems, that the raid is assembled before the modules are loaded.

Thank you for your support!

/Tomekki

----------

## drescherjm

 *Quote:*   

> It seems, that the raid is assembled before the modules are loaded.

 

That was my guess. Compiling the raid456 into the kernel is the safest option. This is what I do since on all systems (~10) that I am using software raid, my / is on a raid 5 or 6 partition. 

As a module you may need to add mdraid to your boot or default runlevel. And update your /etc/conf.d/modules to specifically load the raid456 driver.

----------

## minor_prophets

My / is on a RAID 1 and compiled into the kernel as "built-in" as well.

----------

