# udev and MD1

## |rt|

I have a server here which I'm trying to migrate over to udev without much luck.  It keeps hanging b/c /dev/md1 does not exist.  Udev has the rules to create md devices and it's creating md0 without any problems anyone know how to fix this?

I'm running 

udev: 45

baselayout: 1.9.4-r6

kernel: 2.6.11-gentoo-r6 

I've seen alot of other people with this problems on various distro's but haven't found any answers to the problem.

Thanks,

David

----------

## NeddySeagoon

|rt|,

Thats an old udev. I have udev 56. It seems to create all my raid devices OK

----------

## |rt|

I tried udev 56 but had the same problems.  I wonder if a newer baselayout would help with this.  In the end I ended up going back to devfs to get the system back to a working state today.  I hope to have some time to do some more troubleshooting/experimenting with the system soon and hopefully get udev working.  But if anyone else has any suggestions on what to do let me know.

Neddy do you have more than 1 md device?  Also are you using mdadm or raidtools to assemble the arrays?

David

----------

## danorris

I'm having the same problem. I'm almost embarassed by this, since I know the solution is almost certainly very simple. But I don't understand udev well enough to figure it out. One mistake I did make is that I didn't set the partition type on my RAID array to 0xFD, so it probably isn't being auto-detected properly.

How do I tell udev to create /dev/md0 manually, so that I can change the partition type? Will this cause udev to auto-recognize and create /dev/md0 in the future? If not, what else do I need to do?

----------

## NeddySeagoon

danorris,

Boot with the liveCD and use fdisk to fix the partition types.

----------

## danorris

Thanks, but I'm sure there's a way to do it without rebooting. In any case, "MAKEDEV md" worked to manually create /dev/md*. Earlier I had tried "MAKEDEV md0" which doesn't work. And I may be out of luck on the partition types, since my array isn't actually using any partitions (the devices in raidtab are e.g. /dev/sda, /dev/sdb, ... instead of /dev/sda1, ...). And then I mkfs'd on /dev/md0 itself, didn't bother with a partition table. This is how some HOWTO or other suggested I do it and I didn't stop to think that this might be a really bad idea... oh well, live and learn.

----------

## NeddySeagoon

danorris,

Are you using kernel software RAID or BIOS (fake) RAID ?

----------

## danorris

Software RAID5:

/etc/raidtab:

```
raiddev /dev/md0

    raid-level              5

    nr-raid-disks           3

    nr-spare-disks          0

    persistent-superblock   1

    parity-algorithm        left-symmetric

    chunk-size              32

    device                  /dev/sda

    raid-disk               0

    device                  /dev/sdb

    raid-disk               1

    device                  /dev/sdc

    raid-disk               2
```

/etc/fstab:

```
/dev/md0            /ms         reiserfs    noatime,notail,noauto       0 0
```

/proc/mdstat:

```
Personalities : [raid5]

md0 : active raid5 sdc[2] sdb[1] sda[0]

      586072192 blocks level 5, 32k chunk, algorithm 2 [3/3] [UUU]

unused devices: <none>
```

----------

## NeddySeagoon

danorris,

I've not seen that done before. I run raia0 and raid1 but I made the partitions first and put them into raid sets after. Every device is a file, so I suppose theres no reason why you should not contribute whole drives like you have done.

----------

## danorris

Well, one big reason not to do it the way I did is that there are no partitions to be autoscanned. The way I understand it, the RAID tools recognize 0xFD as a special partition type identifying a component of a RAID array. Then it looks at the RAID superblock on all the component partitions, reads the array number, and creates the appropriate /dev/md* devices. Since I have no partitions, I can't do this. At least, that's my understanding of how it's supposed to work, but I could very easily be wrong...

----------

