I just made a fresh install of Ubuntu 12.10 on a new SSD (/dev/sda). Now I would like to add two 1TB drives (/dev/sdb /dev/sdc) in RAID 1 but I'm pretty clueless on how to do it.

This is what I came up with (but didn't work):

First created partitions on the new drives:

sudo fdisk /dev/sdb

created primary partition and write table to disk

After that:

sudo mdadm --create --level=1 --name=raidarray --raid-devices=2 /dev/sdb /dev/sdc

However this outputs:

mdadm: device /dev/sdb exists but is not an md array.

Can somebody point me in the right direction on how to do this?

One bonus question: Would it be possible to reserve a part (same size of SSD) of one HDD and create a RAID 1 with the SSD and part of the HDD. And if so, how and can I keep my installation?


The default command should look like this:

mdadm --create --verbose /dev/md0 --level=1 /dev/sda1 /dev/sdb2

You are not adding a complete disk, you should add a device (use /dev/sdb1 (or2), not just /dev/sdb) as far as I know. The target name (/dev/md0) was also missing.

I always use this cheatsheet: http://www.ducea.com/2009/03/08/mdadm-cheat-sheet/ :D


You have not specified the name of the resulting raid device. As such, mdadm is assuming that you're trying to create a RAID device ad /dev/sdb and then failing because /dev/sdb already exists.

You should modify your command:

sudo mdadm --create --level=1 --name=raidarray /dev/md0 --raid-devices=2 /dev/sdb /dev/sdc

/dev/md0 is the name of the new RAID device you're going to create.