It’s been a long time since the last time I installed and used Ubuntu, but with another shiny newish version out, 6.10 or whatever it is, I wanted to give it another go. Of course, I’m afraid of hard disk crashes (as should you be), so the first thing I do is set up a software RAID. I’ll go with a RAID-1 (Mirror) so we’re protected in the event that one of the disks decides to up and die.
The last time I did this was for Ubuntu 5.10 (don’t ask me what nifty nickname that version had) – but it looks like a few things (not many) have changed. In 6.10 (AKA Edgy Eft) the Disks Manager is gone, but you can still use the Device Manager to figure out what disks you want to use to create your RAID. I still have two of these 160GB SATA Seagate drives that I’ll use for the sake of this example. Here’s a screen shot of the Device Manager, I’ve browsed to the first of the disks I’m planning on using, and you can see that it’s /dev/sda (screenshot, top right).
This screenshot also shows that my drives contain the Backup volume – I’m nuking this volume to create this RAID.
Now we open up the terminal, and get going. My drives are /dev/sda and /dev/sdb, so the first step is to use cfdisk to partition them:
daniel@ubuntu:~$ sudo cfdisk /dev/sda
daniel@ubuntu:~$ sudo cfdisk /dev/sdb
Running cfdisk opens a cursor based application that you need to use to create the partitions. I deleted all existing partitions, and then created a Primary partition that took up the entire disk. Then I set the Type to FD which is Linux Raid Autodetect.
Next we load the RAID module for RAID-1 (Mirror):
daniel@ubuntu:~$ sudo modprobe raid1
After this, I opened up Device Manager again to see what the partitions had been called that we created on our disks. One of my partitions is /dev/sda1 and the other is /dev/sdb2. You can check out the screen shot below to see what I was looking at:
You can also notice from this screen that the Backup volume has indeed been nuked, and now we simply have Volume (linux_raid_member).
The next thing I want to do is run mdadm, but in my install of Ubuntu 6.10 it doesn’t exist, so we’ll install it:
daniel@ubuntu:~$ sudo apt-get install mdadm
That will spit out a bunch of stuff and eventually you should get the message:
* Starting RAID monitoring service mdadm —monitor [ ok ]
Alright, now let’s run mdadm to create the RAID:
daniel@ubuntu:~$ sudo mdadm —create
/dev/md0 —level=1 —raid-devices=2 /dev/sda1 /dev/sdb1
For me, I was prompted to confirm that I wanted to continue to create the array, because it looked like my disks were already a part of an array. I just pressed ‘y’ and carried on.
At this point, the RAID is being constructed, it’s not yet completed, even though you’ve been dumped back to the terminal. We can view the progress of the resyncing like so:
daniel@ubuntu:~$ sudo cat /proc/mdstat
Personalities : [raid1]md0 : active raid1 sdb1[1] sda1[0]
156288256 blocks [2/2] [UU]
[>....................] resync = 2.4%
(3886336/156288256) finish=52.6min speed=48201K/secunused devices: <none>
daniel@ubuntu:~$
So in 52.6 minutes we should be good to go. Now is your queue to grab me a Caramel Macchiato from Starbucks…Triple Grande, please.
Once the RAID is finished doing the resync, we need to create a file system on that bad boy. I’m going to use ext3, but you can go ahead and use whatever strikes your fancy.
daniel@ubuntu:~$ sudo mkfs.ext3 /dev/md0
And voila! Once that’s finished, we should have a nice shiny file system that’s all RAIDified. Before we can actually do anything with it, we first need to mount it. I’m going to mount mine at /backup, but again, you can mount it however or wherever you see fit.
daniel@ubuntu:~$ sudo mkdir /backup
daniel@ubuntu:~$ sudo mount /dev/md0 /backup
Now with any luck, we should have 160GB of RAID goodness mounted at /backup, let’s check to see what we’ve got:
daniel@ubuntu:~$ df -k /dev/md0
I would love to paste the result of the above command here, but the stupid terminal is not copying my selected text to the clipboard, but trust me when I say it tells us we have a nice ~160GB file system mounted at /backup.
Since we don’t want to have to remount the file system every time we reboot, we can add an entry to /etc/fstab to get it to mount at boot. As I’ve mentioned before, I’m not a Linux ninja by any stretch of the imagination, but if you read the man page for fstab and take a look at what’s in your current file, I’m confident you’ll easily be able to get it to mount the way you’d like. For me, I basically copied the line from my boot disk and changed /dev/hdc to /dev/md0 and also changed the last column (pass) from 1 to 2.
/dev/md0 /backup ext3 defaults,errors=remount-ro 0 2
There you are, a newly updated entry on how to set up a nice software RAID in Edgy Eft (Ubuntu 6.10). Enjoy.

