Lab server setup - Ubuntu 12.4

With a recent change of machines in the lab, I thought that I should update the backup server according to reflect the new machines. However, upon inspection the backup server OS hard drive had died long ago; but then what do you expect when you use 8 year old battered PCs as a server.

This wasn’t too much of a problem as the machine’s RAID array was otherwise fine, it just hadn’t been mounted in some time. And the lab machines all have their files safely on them still. So I thought I’d take the opportunity to bring new life to the server and update it. Something that had been on the list of things-to-do for a long time and I just hadn’t got there.

Server installation

I got a USB stick with the latest version of Ubuntu 12.4 LTS x64 and installed it onto the backup server on a fresh, new WD green drive. I used the standard desktop version and not the dedicated server or minimal install as frankly I cant be bothered with setting everything up from the command line and getting all the libraries, drivers, network connections, etc to work when the live disk just works.

After the fresh install I ran the usual

sudo apt-get update && sudo apt-get upgrade

And waited for it to pull the updates from the Ubuntu servers. Followed by:

sudo apt-get install synaptic

This just downloads the Synaptic package manager, which oddly isn’t included by default anymore by Ubuntu.

sudo apt-get install nfs-kernel-server nfs-client

All of the lab machines I’ve configured to use NFS shares to allow manipulation of files between them

RAID array configuration

Finally, I installed mdadm (md (multiple device) administrator) which allows for the mounting and control of hard drives into RAID arrays without expensive hardware controllers

sudo apt-get install mdadm

Annoyingly, the mdadm install requires the package sendmail, which is used for email notifications if a RAID array dies, however the sendmail installer is useless. It takes over the terminal window and needs you to set up some configuration settings but will not allow you a cursor. To solve this press “Tab” and suddenly the cursor selects the OK box and you can continue.

With mdadm installed I could now mount the RAID array, using a similar method to that described before, initially using Ubuntu’s Disk Utility program to gather which hard drives were allocated to which hardware address. My drives were located at /dev/sdb and /dev/sdc. So I could mount them using:

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

Which created a single mdadm device (md0)

  • in a RAID 1 (--level=1)
  • from 2 disks (--raid-devices=2).

Now the device had been created it was mounted to a folder (having to specify the drives file system (ext4)

sudo mount -t ext4 /dev/md0 /media/raid

NFS mounting

As previously mentioned all the machines in the lab allow NFS sharing between them. So for each machine it was as easy as creating a new directory for each machine

mkdir /media/[machine to be added]

And then mounting the machine (make sure to configure firewalls appropriately)

mount [IP or DNS entry to machine]:/home /media/[machine to be added]

So something like

mount /media/PC1


df -h

Should now show that you have a NFS drive attached.

This is all very well and good, but all that we’ve done is mount the drive this time, but for a server in the event of power outage and reboot we want the drives to be automatically mounted. To do this we need to edit /etc/fstab and add a new line for each drive

[...] /media/raid/PC1   nfs   rw,sync,hard,intr   0   0

You can use different mount options if you like (look up man nfs), for example a backup server doesn’t really need write permissions.

Remote desktop

In Ubuntu’s menu select, Desktop Sharing, and select Allow others to view your desktop and Allow other users to control your desktop

Backup script

For the backing up scripts, see the next article

This page previously appeared on[^1][^2][^3]

[^1:] [^2:] [^3:]

What distinguishes you from other developers?

I've built data pipelines across 3 continents at petabyte scales, for over 15 years. But the data doesn't matter if we don't solve the human problems first - an AI solution that nobody uses is worthless.

Are the robots going to kill us all?

Not any time soon. At least not in the way that you've got imagined thanks to the Terminator movies. Sure somebody with a DARPA grant is always going to strap a knife/gun/flamethrower on the side of a robot - but just like in Dr.Who - right now, that robot will struggle to even get out of the room, let alone up some stairs.

But AI is going to steal my job, right?

A year ago, the whole world was convinced that AI was going to steal their job. Now, the reality is that most people are thinking 'I wish this POC at work would go a bit faster to scan these PDFs'.

When am I going to get my self-driving car?

Humans are complicated. If we invented driving today - there's NO WAY IN HELL we'd let humans do it. They get distracted. They text their friends. They drink. They make mistakes. But the reality is, all of our streets, cities (and even legal systems) have been built around these limitations. It would be surprisingly easy to build self-driving cars if there were no humans on the road. But today no one wants to take liability. If a self-driving company kills someone, who's responsible? The manufacturer? The insurance company? The software developer?