Home » Questions » Computers [ Ask a new question ]

Creating a RAID1 partition with mdadm on Ubuntu

Creating a RAID1 partition with mdadm on Ubuntu

I'm trying to set up a RAID1 partition on my Ubuntu 9.10 workstation.

Asked by: Guest | Views: 33
Total answers/comments: 2
Guest [Entry]

"Finally some progress!

dmraid indeed was the culprit, as mdadm's Wikipedia entry suggested. I tried removing dmraid packages (and running update-initramfs though I'm not sure if that was relevant).

After that, and rebooting, the devices under /dev/mapper are gone (which is fine - I don't need to access the Windows NTFS partitions on Linux):

$ ls /dev/mapper/
control

And, most importantly, mdadm --create works!

$ sudo mdadm -Cv -l1 -n2 /dev/md0 /dev/sda4 /dev/sdb4
mdadm: size set to 241095104K
mdadm: array /dev/md0 started.

I checked /proc/mdstat and mdadm --detail /dev/md0 and both show that everything is fine with the newly created array.

$ cat /proc/mdstat
[..]
md0 : active raid1 sdb4[1] sda4[0]
241095104 blocks [2/2] [UU]
[==========>..........] resync = 53.1% (128205632/241095104)
finish=251.2min speed=7488K/sec

Then I created a filesystem on the new partition:

$ sudo mkfs.ext4 /dev/md0

And finally just mounted the thing under /opt (& updated /etc/fstab). (I could of course have used LVM here too, but frankly in this case I didn't see any point in that, and I've already wasted enough time trying to get this working...)

So now the RAID partition is ready to use, and I've got plenty of disk space. :-)

$ df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sdc5 70G 52G 15G 79% /
/dev/md0 227G 188M 215G 1% /opt

Update: there are still some issues with this RAID device of mine. Upon reboot, it fails to mount even though I have it in fstab, and sometimes (after reboot) it appears to be in an inactive state and cannot be mounted even manually. See the follow-up question I posted."
Guest [Entry]

"Maybe a stupid answer, but - are you sure sd{a,b}4 is not mounted anywhere by ubuntu?

And what motherboard you have as you say about hardware raid? It may be really some software raid that maybe disturbs here."