All the parts that I ordered for the new VBOX arrived on Monday, just one day after I placed the order. I didn’t have to wait for the parcel to arrive at the post office or stay at home all day to wait for a courier to deliver it to my apartment; I picked up the box at an automated machine at the central station. I entered a eight digit code the postal service sent to me in a text message, then a small door in the machine opened and my computer parts popped out. It was all extremely convenient. Almost like magic.
The first part of the assembly went more or less according to plan, I had to go out and buy a power connector for the SATA drive, but that was the only unexpected event. To get all the parts to fit was a bit of a challenge, the box is quite small and the heat sink on the motherboard is enormous, at least compared to the size of the motherboard itself. On top of this, the shortest SATA cable I could find was half a meter long, which was more than twice the length I actually needed.
As for operating system, I went with Ubuntu because it’s the new hot Linux distro and it also has a very active community. That’s a good thing for me, who know very little about Linux. Ubuntu installed as planned, LAMP, was set up by the main installer and everything generally worked like a charm until I got some ideas. Some crazy ideas.
Since I was setting up a server, I decided I needed RAID. No server is complete without at least RAID 1. RAID 1 gives the server fault tolerance because if one of the hard drives in the setup fails, there is still at least one working drive with all the data. The faulty disk can be replace while the system is powered up and online and the contents of the disks in the array is automatically synched. I found another cheap disk and started to configure it. The motherboard has a built in RAID controller, but I realized after some reading that it was only FakeRAID and not recognized as a RAID controller by Ubuntu. So instead I started configuring a software RAID.
Everything worked well until, what do you know, one of the disks actually failed during the installation process! That’s irony for you. So I had to get back to the store where I bought the drive and get a replacement. When I got back home with the new drive, the problems began. It was just plain impossible to add the new disk to the existing RAID setup in the Ubuntu installer. No matter how hard I tried to delete the partition tables on both drives, the RAID setup just magically appeared time and time again.
After many frustrating hours, I finally found the answer: The RAID configuration is not saved in the partition tables, which was what I assumed all along. They are saved in something called superblocks, and these superblocks are not deleted by partman nor fdisk. So if you’re struggling with magic RAID configuration that just appear out of the blue, this is the shell command that will save the day:
sudo mdadm -zero-superblock /dev/sda5
Be careful, though, as I suspect that you will loose access to all your data when you run the above command. It’s possible that you can save it with some other mdadm-command but that is way beyond my very limited knowledge. Replace /dev/sda5 with whatever partition you want to remove from the RAID configuration. It’s quite possible that you have to stop the RAID array before running the above command:
sudo mdadm -stop /dev/md0
Replace /dev/md0 with the name of the array you have to stop.
If you plan to configure a RAID 1 setup in Ubuntu, I also recommend that you read the following articles: