Building The New VBOX

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:

mdadm(8) - Linux man page

RAID-1 in My Ubuntu Installation

Setting up software RAID in Ubuntu Server

That’s about it for now; later I’ll tell you all about why I ended up using Debian instead. The second part of this entry is The Assembly Continues.


Feedback

This post has no feedback yet.

Do you have any thoughts you want to share? A question, maybe? Or is something in this post just plainly wrong? Then please send an e-mail to vegard at vegard dot net with your input. You can also use any of the other points of contact listed on the About page.


Caution

It looks like you're using Google's Chrome browser, which records everything you do on the internet. Personally identifiable and sensitive information about you is then sold to the highest bidder, making you a part of surveillance capitalism.

The Contra Chrome comic explains why this is bad, and why you should use another browser.