# Unable to create software raid device (Solution)

## Woody2143

I ran in to this today and since I was unable to find an answer I figured I would post one.

I was previously using the fake-raid provided by the bios. After running in to a couple of problems and banging my head against the table I decided to use the software raid with better control.

I was attempting to create the /dev/md1 device per the instructions and kept running in to the error:

# mdadm --create /dev/md1 --level=1  --raid-devices=2 /dev/sdb1 /dev/sdc1

mdadm: device /dev/sdb1 not suitable for any style of array

After some looking I found that adding --verbose gave me a better idea of the problem:

# mdadm --verbose --create /dev/md1 --level=1  --raid-devices=2 /dev/hdb1 /dev/hdd1

mdadm: super0.90 cannot open /dev/hdb1: Device or resource busy

mdadm: super1.x cannot open /dev/hdb1: Device or resource busy

mdadm: ddf: Cannot use /dev/hdb1: Device or resource busy

mdadm: Cannot use /dev/hdb1: It is busy

mdadm: device /dev/hdb1 not suitable for any style of array

I ran 'lsof' but was unable to find anything using my device.

I then got to thinking that despite removing the software raid in the bios it was still on the OS.

I checked dmtab but nothing was in there so I ran 'dmsetup table' and sure enough a device was still listed.

I used 'dmsetup remove sil_ajadaccdfcac' and the device was deleted.

After that it let me create the md device.

I hope this helps out should someone else run in to this problem.

----------

## richard.scott

it sounds like you already have your device mounted... or in use by the fake raid.

What kernel boot options did you provide? you won't easily be able to convert a fake raid system to a software raid system while its running.

You'd need to make a backup (just in case) and boot from a LiveCD to create the mirror.

Rich

----------

## Woody2143

 *richard.scott wrote:*   

> it sounds like you already have your device mounted... or in use by the fake raid.
> 
> What kernel boot options did you provide? you won't easily be able to convert a fake raid system to a software raid system while its running.
> 
> You'd need to make a backup (just in case) and boot from a LiveCD to create the mirror.
> ...

 

Once I deleted the old raid device it let me create the software raid device. I was able to work through the problem I was just hoping to help someone else just in case they ran in to the same error. I may not have been able express my thoughts clear enough though.

----------

## the_mgt

Have you converted the raid from dm to md with all the data on the partitions? And it did work as in "all data is safe"?

I am trying to get rid of my dm in favour of md, too. (Of course i will do a full backup, but I am curious if it is that simple!)

edit: typo? is it "safe" or "save"?   :Rolling Eyes: 

----------

## richard.scott

I don't think you can do that as the md device is a layer between the filesystem and the disk

dm just duplicates the filesystem, and works at a higher level to md.

Your best bet will be to backup your data and start from scratch.

Rich

p.s. its safe   :Smile: 

----------

