# MD autodetect breaks when upgrading kernel to 2.6.28-r5

## nickk

I am running currently amd64 system with 2.6.22-gentoo-r8 kernel, it boots from MD raid1 device (md0) and works fine.

I am trying to upgrade kernel to 2.6.28-gentoo-r5 and it cant autodetect md devices on startup (md says 0 drives detected) resulting kernel panic with VFS saying vfs cannot open root device "900" or invalid block (9,0). But all the md modules are compiled in kernel.

What to do ?

Here are my disks:

   Device Boot      Start         End      Blocks   Id  System

/dev/sda1               1         499     4008186   82  Linux swap / Solaris

/dev/sda2             500        1496     8008402+  fd  Linux raid autodetect

/dev/sda3            1497       91201   720555412+   5  Extended

/dev/sda5            1497        2742    10008463+  fd  Linux raid autodetect

/dev/sda6            2743        3988    10008463+  fd  Linux raid autodetect

/dev/sda7            3989       91201   700538391   fd  Linux raid autodetect

   Device Boot      Start         End      Blocks   Id  System

/dev/sdb1               1         499     4008186   82  Linux swap / Solaris

/dev/sdb2             500        1496     8008402+  fd  Linux raid autodetect

/dev/sdb3            1497       91201   720555412+   5  Extended

/dev/sdb5            1497        2742    10008463+  fd  Linux raid autodetect

/dev/sdb6            2743        3988    10008463+  fd  Linux raid autodetect

/dev/sdb7            3989       91201   700538391   fd  Linux raid autodetect

md0 consists of /dev/sda2 and /dev/sdb2.

excerpt from .config:

CONFIG_MD=y

CONFIG_BLK_DEV_MD=y

CONFIG_MD_AUTODETECT=y

CONFIG_MD_LINEAR=y

CONFIG_MD_RAID0=y

CONFIG_MD_RAID1=y

CONFIG_MD_RAID10=y

CONFIG_MD_RAID456=y

CONFIG_MD_RAID5_RESHAPE=y

CONFIG_MD_MULTIPATH=y

CONFIG_MD_FAULTY=y

CONFIG_BLK_DEV_DM=y

CONFIG_DM_DEBUG=y

CONFIG_DM_CRYPT=y

CONFIG_DM_SNAPSHOT=y

CONFIG_DM_MIRROR=y

CONFIG_DM_ZERO=y

CONFIG_DM_MULTIPATH=y

CONFIG_DM_DELAY=y

----------

## NeddySeagoon

nickk,

Grub does not care about raid devices at all - it simply ignores them, hence you can boot from raid1 but not a striped raid set.

Grub is loading your kernel here, so thats not the problem.

Your raid setup looks fine too.

I suspect that you have set 

```
[*]   ATA SFF support 
```

in jumping from 2.6.22, which turns off most of the SATA drivers, hence your raid is not detected because the underlying disks are not detected.

Grub is a special case, as it loads the kernel, it has to make its own arrangements for reading the drives.

--- edit ---

changed "boot from raid0" to "boot from raid1"

----------

## nickk

My SATA disks are on SAS1068E controller which works under  fusion mpt drivers (mptbase) which are compiled in kernel too.

Here .config excerpts about that:

CONFIG_FUSION=y

CONFIG_FUSION_SPI=y

CONFIG_FUSION_SAS=y

CONFIG_FUSION_MAX_SGE=128

Here all my other SATA config settings:

CONFIG_SATA_PMP=y

CONFIG_SATA_AHCI=y

Should i switch on smth else ?

----------

## NeddySeagoon

nickk,

The fusion drivers are the low level hardware support for SCSI.  You also need 

```
  │ │    < > RAID Transport Class                                         │ │  

  │ │    -*- SCSI device support                                          │ │  

  │ │    < > SCSI target support                                          │ │  

  │ │    [*] legacy /proc/scsi/ support                                   │ │  

  │ │        *** SCSI support type (disk, tape, CD-ROM) ***               │ │  

  │ │    <*> SCSI disk support 
```

but thats not new, you have always needed these options for that hardware.

----------

## nickk

Sure, this is on too.

And here what i found in .config by greping SCSI:

CONFIG_SCSI=y

CONFIG_SCSI_DMA=y

CONFIG_SCSI_TGT=y

CONFIG_SCSI_PROC_FS=y

CONFIG_SCSI_MULTI_LUN=y

CONFIG_SCSI_CONSTANTS=y

CONFIG_SCSI_WAIT_SCAN=m

CONFIG_SCSI_SPI_ATTRS=y

CONFIG_SCSI_SAS_ATTRS=y

CONFIG_SCSI_SAS_LIBSAS=m

CONFIG_SCSI_SAS_HOST_SMP=y

CONFIG_SCSI_SAS_LIBSAS_DEBUG=y

CONFIG_SCSI_LOWLEVEL=y

----------

