# Raid problem: cannot determine md version

## meekrob

I'm trying to set up gentoo with a kernel raid.  I'd like to set up a raid0 swap and root partition and a raid1 boot and backup partition.  I noticed the gentoo install cd has raidtools installed so I partition out the drives using fdisk.  I then create /etc/raidtab:

```
#swap

raiddev /dev/md0

raid-level 0

nr-raid-disks 2

persistant-superblock 1

chunk-size 32

device /dev/hde1

raid-disk 0

device /dev/hdg1

raid-disk 1

#root

raiddev /dev/md1

raid-level 0

nr-raid-disks 2

persistant-superblock 1

chunk-size 32

device /dev/hde2

raid-disk 0

device /dev/hdg2

raid-disk 1

#boot

raiddev /dev/md2

raid-level 1

nr-raid-disks 2

persistant-superblock 1

chunk-size 32

device /dev/hde3

raid-disk 0

device /dev/hdg3

raid-disk 1

#backup

raiddev /dev/md3

raid-level 1

nr-raid-disks 2

persistant-superblock 1

chunk-size 32

device /dev/hde4

raid-disk 0

device /dev/hdg4

raid-disk 1

```

I then type:

```

# mkraid /dev/md0

cannot determine md version: No such file or directory

#

```

Ack!  So I check for /proc/mdstat.  Nothing there.  

How do I create the devices:

/dev/md0

/dev/md1

/dev/md2

/dev/md3

??

----------

## fghellar

Try this:

```
# cd /dev

# MAKEDEV md*
```

----------

## Guest

Ahh.  I have to start with a modprobe md... are there any other modules I need to load?

----------

## meekrob

modprobe md seemed to do the trick!

thanks!

----------

## TNX

Hello,

I have run into a problem with /dev/md0.

Something must have broken in /dev, because at first my /dev/md0 worked just fine, raiddisk became active during boot and was exported over nfs. Currently, I've had to disable raidstart during boot, because it would hang the boot into an error message. The error "cannot determine md version: 25." comes up when trying to use any raidtool. The odd thing is, that if I go and rm /dev/md0 and create it again, the device works properly. (Or most probably I'm creating the file in the wrong way)

Here is how I do it currently:

```

server root # mount /dev/md0/

mount: can't find /dev/md0 in /etc/fstab or /etc/mtab

server root # raidstart

cannot determine md version: 25.

server root # cd /dev/

server dev # rm -dr md0

server dev # ln -s md/0 md0

server dev # raidstart /dev/md0 

server dev # mount /dev/md0 /data/

```

----------

## RaaR

I read somewhere that kernel 2.5.x and above used /dev/md/? instead of /dev/md?.

Try replacing /dev/md0 with /dev/md/0 in fstab.   Either I'm just not understanding your problem or this should solve it.

----------

## TNX

Yes the /dev/md/0 is the device and making /dev/md0 a symbolic link pointing to it solves the problem for as long as the computer is running. But if the system reboots, /dev/md0 is botched and I have to manually recreate the link.

I'm searching a solution which would make /dev/md0 to work correctly at boottime. (All other /dev/md? devices work properly at boot.)

----------

## TNX

Ok, found a solution:

Scrapped devfs and emerged udev, now /dev/md0 works properly.

----------

## pilla

Merged threads to put together two possible solutions and made stick.

----------

## yottabit

Just some helpful hints:

Use the new mdadm (multi-disk administrator) package and its mdadm.conf instead of the old raidtools and raidtab. Your life will be much easier. You can Google mdadm to read how it works and its advantages over raidtools. For setting up your system with mdadm you can see the software RAID howto supplement to Gentoo installation here: http://www.gentoo.org/doc/en/gentoo-x86-tipsntricks.xml#software-raid. Lastly on this subject, you can interchange between mdadm and raidtools since they're just the userland utilities and both use the kernel's md driver! So no need to redefine your arrays and reformat! Just emerge mdadm, create your mdadm.conf (can be done automatically; read the previous link), unmerge raidtools, reboot! (Maybe there's more, but that's all I think I did...)

This has been covered before, but since this thread is sticky for the moment, I may as well say again: there really is no point in striping (RAID0) your swap! The kernel swap daemon automagically stripes/balances multiple swaps if you specify all of them in your /etc/fstab! Neato, right? Occam's Razor and all that jazz. (Finally, realize that if you were doing a mirrored array [RAID1] for the root filesystem there would be a good reason to mirror your swap... if one of the disks were to fail, you'd likely still keep serving up that database or whatever... with striping swap, if you lose a disk it's like pulling a RAM chip out of the system while running, hehe.)

J

----------

## epinefryna

Hi

Need help

I found great howto about installing gentoo on raided hdds, I tried all of it and I'm stuck

I created partitions on my two identical hdds

```
Disk /dev/sda: 36.7 GB, 36703934464 bytes

255 heads, 63 sectors/track, 4462 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System

/dev/sda1   *           1          17      136521   fd  Linux raid autodetect   <-----boot

/dev/sda2              18         142     1004062+  82  Linux swap / Solaris

/dev/sda3             143        2575    19543072+  fd  Linux raid autodetect    <----- /

/dev/sda4            2576        4462    15157327+  fd  Linux raid autodetect   <---- /home
```

and

```
Disk /dev/sdb: 36.7 GB, 36703934464 bytes

64 heads, 32 sectors/track, 35003 cylinders

Units = cylinders of 2048 * 512 = 1048576 bytes

   Device Boot      Start         End      Blocks   Id  System

/dev/sdb1   *           1         123      125936   fd  Linux raid autodetect

/dev/sdb2             124        1101     1001472   82  Linux swap / Solaris

/dev/sdb3            1102       20175    19531776   fd  Linux raid autodetect

/dev/sdb4           20176       35003    15183872   fd  Linux raid autodetect
```

I did

```
modprobe md
```

and got 

```
md: md driver 0.90.1 MAX_MD_DEVS=256, MD_SB_DISKS=27
```

in dmesg

Created /etc/raidtab - almost the same as I found on this forum

PROBLEM:

I cannot see any /dev/md* devices.  So I cannot run mkraid 

```
livecd ~ # mkraid

cannot determine md version: no MD device file in /dev.
```

I'm running 2005.1 LiveCD.

Will you help me, please.  And if you are so kind please explain me how is it possible that my two identical hhds have different geometries ???? 

64 heads, 32 sectors/track, 35003 cylinders 

255 heads, 63 sectors/track, 4462 cylinders

Thank you in advance

----------

## yottabit

You need to create the md device nodes. Easy!

See this: http://www.gentoo.org/doc/en/gentoo-x86-tipsntricks.xml#software-raid

Cheers,

J

----------

## Woolong

Hi,

I followed the guide to create raid1, the system boots and runs okay. But the second disk is somehow out of sync with my first hd.

I described the problem here:

https://forums.gentoo.org/viewtopic-t-395242-highlight-.html

----------

## Chazmati

Help!  After converting to UDEV, raidstart fails but mdadm still works.

```
metal ~ # raidstart /dev/md1

cannot determine md version: no MD device file in /dev.

metal ~ # raidstart /dev/md/1

cannot determine md version: no MD device file in /dev.

metal ~ # cat /etc/fstab | grep /dev/md

/dev/md/1               /home/share     ext3            defaults                0 0

metal ~ # cat /etc/raidtab

raiddev /dev/md/1

raid-level              1

nr-raid-disks           2

chunk-size              32

persistent-superblock   1

nr-spare-disks          0

        device          /dev/hdc2

        raid-disk       0

        device          /dev/hda2

        raid-disk       1

metal ~ # mdadm --assemble /dev/md1 /dev/hdc2 /dev/hda2

mdadm: /dev/md1 has been started with 2 drives.
```

Spaces added for clarity.  What's up with this?

----------

## neysx

 *yottabit wrote:*   

> You need to create the md device nodes. Easy!
> 
> See this: http://www.gentoo.org/doc/en/gentoo-x86-tipsntricks.xml#software-raid
> 
> Cheers,
> ...

 http://www.gentoo.org/doc/en/gentoo-x86+raid+lvm2-quickinstall.xml would be a better place to look. I'll add a link to it in gentoo-x86-tipsntricks.xml

Hth

----------

## ali3nx

 *yottabit wrote:*   

> Just some helpful hints:
> 
> Use the new mdadm (multi-disk administrator) package and its mdadm.conf instead of the old raidtools and raidtab. Your life will be much easier. You can Google mdadm to read how it works and its advantages over raidtools. For setting up your system with mdadm you can see the software RAID howto supplement to Gentoo installation here: http://www.gentoo.org/doc/en/gentoo-x86-tipsntricks.xml#software-raid. Lastly on this subject, you can interchange between mdadm and raidtools since they're just the userland utilities and both use the kernel's md driver! So no need to redefine your arrays and reformat! Just emerge mdadm, create your mdadm.conf (can be done automatically; read the previous link), unmerge raidtools, reboot! (Maybe there's more, but that's all I think I did...)
> 
> This has been covered before, but since this thread is sticky for the moment, I may as well say again: there really is no point in striping (RAID0) your swap! The kernel swap daemon automagically stripes/balances multiple swaps if you specify all of them in your /etc/fstab! Neato, right? Occam's Razor and all that jazz. (Finally, realize that if you were doing a mirrored array [RAID1] for the root filesystem there would be a good reason to mirror your swap... if one of the disks were to fail, you'd likely still keep serving up that database or whatever... with striping swap, if you lose a disk it's like pulling a RAM chip out of the system while running, hehe.)
> ...

 

Must agree with yottabit on using mdadm. The best i can recall raidtools and friends have been depreciated in 2.6 linux kernels for some time favoring mdadm. raidtools may work but it's more than liklely only usable for long term support and compatibility to allow systems admins time to rebuild software raid arrays.

----------

## umka69

show here your.

```

# cat /proc/mdadm

# ls -l /dev/md*

```

----------

