# [SOLVED] mdadm: no devices found for /dev/md0

## humbletech99

I've got a raid5 array on four disks, but when I try to reconstruct the array it fails as follows:

```
mdadm -A /dev/md0

mdadm: no devices found for /dev/md0
```

However, if I do

```
mdadm -A /dev/md0 /dev/hd[abef]1
```

then it reconstructs the array properly and you can see the results:

```
mdadm --detail --scan

ARRAY /dev/md0 level=raid5 num-devices=4 UUID=feebae85:4c152e6d:e63ff723:9401b138

   devices=/dev/hda1,/dev/hdb1,/dev/hde1,/dev/hdf1
```

```
mdadm --detail /dev/md0

/dev/md0:

        Version : 00.90.00

  Creation Time : Mon May 22 22:37:50 2006

     Raid Level : raid5

     Array Size : 468864768 (447.14 GiB 480.12 GB)

    Device Size : 156288256 (149.05 GiB 160.04 GB)

   Raid Devices : 4

  Total Devices : 4

Preferred Minor : 0

    Persistence : Superblock is persistent

    Update Time : Sun Jun 18 23:51:01 2006

          State : active

 Active Devices : 4

Working Devices : 4

 Failed Devices : 0

  Spare Devices : 0

         Layout : left-symmetric

     Chunk Size : 64K

           UUID : feebae85:4c152e6d:e63ff723:9401b138

         Events : 0.13

    Number   Major   Minor   RaidDevice State

       0       3        1        0      active sync   /dev/hda1

       1       3       65        1      active sync   /dev/hdb1

       2      33        1        2      active sync   /dev/hde1

       3      33       65        3      active sync   /dev/hdf1

```

The proper details for /dev/md0 are in /etc/mdadm/mdadm.conf and I've tried to remake this file from the working array by doing

```
mdadm -A /dev/md0 /dev/hd[abef]1

mdadm --detail --scan > /etc/mdadm/mdadm.conf
```

But then trying to reassemble the array the easy way still fails

```
mdadm -A /dev/md0

mdadm: no devices found for /dev/md0
```

??? 

I don't understand why this doesn't work, it used to...

----------

## thesnowman

Two things - the mdadm.conf file is /etc/mdadm.conf on my system (sys-fs/mdadm-1.12.0), not /etc/mdadm/mdadm.conf.

Secondly. when you do 

```
mdadm --detail --scan > /etc/mdadm/mdadm.conf
```

it is not adding the DEVICE entries to mdadm.conf.

Try this

```
# echo "DEVICE dev/hda1 /dev/hdb1 /dev/hde1 /dev/hdf1" > /etc/mdadm.conf

# mdadm --detail --scan >> /etc/mdadm.conf
```

(or just edit mdadm.conf by hand and add the DEVICE line)

----------

## humbletech99

ah, thanks a lot, this got it, I forgot that the DEVICE line was needed. This sorted it.

----------

