Archive for the ‘Linux’ category

Hell Freezes over – Is Steve Jobs right?

October 25th, 2010

It’s been widely reported that Steve Jobs thinks that 7″ tablets from RIM and Samsung are “dead on arrival”. The 7″ screen isn’t big enough for a pleasant touch screen experience and in any case they’re too expensive.

I seldom find myself agreeing with Steve Jobs, but I think he might just have a point here.

Today by “IT Buyers Guide” from BT Business Direct dropped in to my pigeon hole and their quoting £509.79 plus VAT for the Samsung Galaxy Tab – that’s a penny short of £600 for a tablet PC. I don’t see how that is a sensible price for a tablet in anyone’s book.

I’m toying with getting a couple of tablets for my staff to use when they’re out and about in classrooms to cut the amount of walking back to the office needed to pick up new jobs – but at £510 each there’s no way I’ll be buying Galaxy Tabs.

Equally I won’t be buying iPads, lovely as the hardware is, because of Apple’s attitude towards app developers and the devices’ junkie-like iTunes habit.

Is 7 inches enough?

Quite frankly I don’t think so – especially if the screen in question is a 16:9 or 16:10 aspect ratio. Tablets look like they should be used in the portrait orientation, as you would a clipboard, yet with a 7″ screen that forces web content to be relatively small. Those extra 3″ coupled with a 4:3 aspect ratio makes a huge difference.

I guess time will tell if Samsung has found a form factor that people like using. Having used a Dell Streak briefly it felt like a large phone (which it essentially is) and I see the Galaxy Tab as a slightly enlarged version of that – although at 7″ you’re going to look alot like Dom Joly using it!

Personally I want a 10″ device, powered by Android or maybe even ChromeOS and I’m hoping that the muted Google Tablet will be very much along those lines.

Open Letter to Simon Kirby

May 12th, 2010

The upshot of the General Election for me was a change in Parliamentary representative in the form of the Conservative MP Simon Kirby.

There follows an open letter to Mr Kirby outlining my suggestions for cuts to the BSF program which would potentially save the country millions of pounds and safeguard jobs in to the bargain. I also mention the need to repeal or heavily rework the Digital Economy Act and to urgently look at Copyright reform.

I intend to publish here any response I might receive.

Dear Mr Kirby

Firstly my congratulations on your recent election success, and your parties subsequent proposed coalition Government with the Liberal Democrats.

As my elected representative, I’m taking a couple of minutes to put to you my point of view on a couple of important issues in the hope that you can take my views on board.

One of the stated aims of the Conservative Party is to begin cutting the budget deficit with immediate effect. May I suggest a thorough review of the Building Schools for the Future scheme and the quango appointed to run it (Partnerships for Schools) would be an excellent point to begin.

BSF in its conception was a revolutionary rework of state-funded secondary schools nationwide, however over time it has become clear that the needs of large businesses have been pushed to the fore and it is now the normal situation in a BSF scheme to spend millions of pounds unnecessarily on consultants, propitiatory software and replacing nearly new equipment like-for-like at each and every school it touches.

Education desperately needs its funding for ICT, but schools that have invested in their ICT services are being penalised by this levelling process that has been imposed by Partnerships for Schools.

Supporters of the BSF program would say that it’s possible for schools to opt out of the Managed ICT Service side of BSF – and it is, theoretically and on paper. In reality it’s a very long and difficult process to demonstrate that existing provision exceeds that offered by an MSP. It falls to the school – which is rightly working towards educating its students – to counter the claims made by dedicated teams from the MSPs. It’s not surprising that almost all schools that embark on that route fail to win their argument.

Please therefore consider cutting the monies spent on the BSF Managed ICT Service such that the remaining funds are spent directly where they are needed by frontline ICT staff, Headteachers and Governors in schools rather than wasted on consultants and replacing systems like-for-like.

The previous Parliament also presided over the farce that was the passing of the Digital Economy Act. The arguments surrounding that act are well publicised and I’m sure you’re aware of the pertainant points.

Nick Clegg made an election promise to repeal the Digital Economy Act if the Liberal Democrats were in power. I hope that the Con-Lib coalition will seriously consider repealing the act or at the very least undertake a major overhaul of the act to address the very serious shortcomings that it has.

And finally please use this period of Conservative-Liberal accord to tackle the issue of Copyright reform. The UK is still applying copyright laws passed decades ago to modern business practises and I’m afraid they just aren’t fit for purpose any longer. Indeed proper copyright reforms would largely address the contentious issues that the Digital Economy Act attempts to legislate around and would probably negate the need for its existence at all.

Yours sincerely

Alex Harrington

Xibo and MythTV

April 14th, 2010

W’e’ve got a new room at work for our older students which has a TV mounted on the wall for Digital Signage.

What we wanted to do was provide a live/recorded TV function for breaks and lunchtime and then an easy way to switch over to our Digital Signage solution (Xibo) at other times.

It turned out to be reasonably simple.

First we installed and configured a new MythBuntu frontend (we already had the myth backend server running from a different project). I then installed the Xibo Python client (1.1.0a21) and made a small modification to the code to allow it to exit by remote control button press (our Media Centre remote sends a backspace character when you press the back button):

if e.scancode == 22:
    self.parent.downloader.running = False
    self.parent.scheduler.running = False

    log.log(5,"info",_("Blocking waiting for Scheduler"))
    log.log(5,"info",_("Blocking waiting for DownloadManager"))
    log.log(5,"info",_("Blocking waiting for Player"))

That block was added after line 2852 appropriately indented of course 😀

It’s then a simple enough job to add a Xibo button to the MythTV menu.

As your mythfrontend user (ie the user that automatically logs in to Mythbuntu on boot), do the following:

mkdir ~/.mythtv
cp /usr/share/mythtv/themes/defaultmenu/mainmenu.xml ~/.mythtv

You then edit ~/.mythtv/mainmenu.xml and add in a block like this:

    <text>Xibo Digital Signage</text>
    <action>EXEC /opt/xibo/pyclient/client/python/</action>

Then restart mythfrontend. You should have a new icon on the menu system that launches Xibo. Once Xibo is running, the client should quit when you press the back button on your remote control and drop you back in to MythTV.

Here’s a short video to show the system in action!

Backup KVM Virtual Machines on OCFS2 Filesystems on an OpenFiler SAN Appliance

April 13th, 2010

We’re using a large OCFS2 partition shared across multiple hosts to provide shared storage for our KVM virtual machines.  We chose OCFS2 because it has a relatively easy setup when compared to GFS (especially since we use Ubuntu as the host OS). The main drawback however is you can’t mount a snapshot of an OCFS2 volume on the same host as the machine that has the live filesystem mounted.

For a long time now we’ve been backing up our OpenFiler-based SAN by taking snapshots using the OpenFiler web interface, and then on a separate machine using a combination of dd and ssh to take a block-level image of the SAN and archive it off for possible disaster recovery.

It works quite well but restoring anything from that image is a total pain. I compress the image using gzip too so firstly I have to find enough disk space on a different machine to extract the archive and then a significant amount of hassle to get OCFS2 setup on a standalone PC and to mount the file image. It follows then that recovering one VM from the image can take days to complete – which isn’t very satisfactory.

Another option would be to share the snapshot devices on the SAN as a new target and then mount them remotely on a server outside the cluster. That’s ideal, except that when you modify iSCSI targets or luns on OpenFiler it reloads the ietd daemon which has a nasty habit of causing the two Ubuntu hosts to stop seeing the target and taking the disk offline.

After some work I discovered you can manually tell iet to start sharing a new target or lun from the command line without needing to restart the service.

Here then is the command history I used:

  1. Take a manual snapshot on OpenFiler (I called it “backup”)
  2. From the command line on the OpenFiler appliance, add a new iSCSI target: ietadm –op new –tid=0 –params
  3. Find the target ID for the new target we just created. There’s a list in the /proc/net/iet/volume file. In my case I got tid:3
  4. Add the snapshot to the target. I’m using blockio with my iscsi targets. The default is fileio:  ietadm –op new –tid=3 –lun=0 –params Type=blockio,Path=/dev/vm/of.snapshot.vm1.backup
  5. Check the volume file again. You should see the export complete with the path to the snapshot.
  6. Connect to, mount and backup the snapshot filesystem using a different PC.
  7. Unmount the filesystem and disconnect from the iSCSI target
  8. Remove the lun: ietadm –op delete –tid=3 –lun=0
  9. Remove the target: ietadm –op delete –tid=3
  10. Remove the snapsh

You can now connect to the iSCSI target from a remote machine, mount the OCFS2 filesystem as needed and backup the files from the filesystem. There’s no guarantee that the images will be consistent but my experience is the machines normally come up fine after an fsck. Any lost data can be restored from the nightly backups of the machines that we take using BackupPC.

My next move is to script all this so that the OpenFiler appliance can kick off a full backup on a schedule.


Here’s the finished script:


# Create a snapshot
echo Creating Backup Snapshot
lvcreate -L100000M -s -n backup /dev/vm/vm1

# Export the snapshot
echo Exporting Snapshot over iSCSI
ietadm –op new –tid=3 –params
ietadm –op new –tid=3 –lun=0 –params Type=blockio,Path=/dev/vm/backup

# Sleep a few seconds to make sure iet is sharing the device
sleep 2

# Connect to nas-backup and connect to the share
echo Connecting to iSCSI target
ssh root@backup iscsiadm -m discovery -t sendtargets -p
ssh root@backup iscsiadm -m node –targetname –portal –login
sleep 30

# Mount the share
echo Mounting filesystem
ssh root@backup mount /dev/sde1 /mnt/vm

# Backup
echo Backup Starting
read -p “Press a key when your backup is complete!”

# Unmount the share
echo Unmounting filesystem
ssh root@backup umount /mnt/vm
sleep 2

# Disconnect
echo Disconnecting from iSCSI share
ssh root@nas-backup iscsiadm -m node –targetname –portal –logout
sleep 10

# Remove the iscsi lun and target
echo Removing iSCSI share
ietadm –op delete –tid=3 –lun=0
ietadm –op delete –tid=3

# Remove the snapshot
echo Removing Snapshot
lvremove -f /dev/vm/backup

# Finished

Converting Windows VMWare machines to KVM

February 24th, 2010

I had to do some work on a Windows 2003 virtual server running on VMWare this week which is running on our old playground VMWare install (Server 1.0.4!) and it was sooooo slow I decided enough was enough and it was time to move it on to a sensible platform.

It actually turned out to be quite easy to convert from one platform to the other, with a bit of help from my old boss James Lidderdale.

  1. Shutdown the VMWare server and take a full backup
  2. Boot the VMWare server and uninstall VMWare tools
  3. Apply mergeide.reg registry patch to enable windows to boot on KVM virtual hardware. I’ve no idea where this came from. James had it. I’d like to credit the original author though! Rename .txt to .reg and then merge in as normal.
  4. Shutdown the VMWare server
  5. Convert the vmdk disk image to a single pre-allocated monolithic image:
    • vmware-vdiskmanager -r Server.vmdk -t 2 /some/other/folder/Server.vmdk
  6. Copy the resulting Server-flat.vmdk image over to your KVM server
  7. Now optionally convert the disk to a qcow2 file:
    • qemu-img convert Server-flat.vmdk -O qcow2 Server.qcow2
  8. Finally create a suitable virtual machine definition using that file as the main hard drive. If all went well you should see your VMWare machine boot inside KVM.

The first time I tried this it failed miserably. Turned out that the VMWare machine I was working with had snapshots associated with it. In my case, the disk I needed to flatten with vmware-vdiskmanager was actually Server-000001.vmdk. Once I figured that out it worked first time.

Why I unsubscribed Audible

January 28th, 2010

Because they don’t support Android. Other than that I was a pretty happy customer.

Linux Teacher PC Update

December 11th, 2009

Well we’ve spent a little time on this. Seb’s been helping out and has done the majority of the work so far.

We’ve got the following working:

  • “Domain” logins (against the LDAP database)
  • CCTV Software (via Wine)
  • Themed to look like our standard XP workstations (but not to the extent that you can’t tell the difference. We’re still using the standard Gnome menus). This needs further work.
  • Promethean ActivInspire for Linux (full marks Promethean)

lvm2 Snapshot Write Performance

December 11th, 2009

We’re running an OpenFiler based iSCSI SAN at work and have been very pleased with both its speed and reliability, however I was copying some VM images around the other day and it seemed to me that the disk IO was a little laboured.

A quick Google for lvm2 snapshot performance brought me to an article by Dennis van Dok which prompted me to do a little testing of my own.

Here’s the raw results of the tests Dennis proposes on our system:

Without Snapshot
root@virgil:/mnt/vm# sync; time sh -c “dd if=/dev/zero of=/mnt/vm/test bs=1M count=1000; sync”
1000+0 records in
1000+0 records out
1048576000 bytes (1.0 GB) copied, 1.79423 s, 584 MB/s

real    0m9.697s
user    0m0.000s
sys     0m2.530s

With Snapshot
root@virgil:/mnt/vm# rm test
root@virgil:/mnt/vm# sync; time sh -c “dd if=/dev/zero of=/mnt/vm/test bs=1M count=1000; sync”
1000+0 records in
1000+0 records out
1048576000 bytes (1.0 GB) copied, 1.67537 s, 626 MB/s

real    0m49.165s
user    0m0.000s
sys     0m2.020s

Now I didn’t carry that out in optimal test conditions. The filesystem is mounted over iSCSI and there’s caching and multipathing in the mix too so this is far from scientific. It’s quite possible that some real traffic from one of the VMs has skewed the result somewhat, but none the less that’s a 5x slow down on write with a snapshot compared to without.

So it’s a tricky dilema. Snapshots are so convenient yet appear to impose such a penalty. We’re going away to rethink how we “do” snapshots.

Could 2010 be the year of the Linux Desktop?!

November 20th, 2009

With the release of Windows 7 and Windows XP some 8 years old now, it’s getting to the point where it’s time to make some changes on the desktop.

Without signing the school up to a Microsoft Schools Agreement, we’d be looking at approximately £45,000 to upgrade to Office 2007 and Windows 7. We’d also have to start looking at running Samba 4 at the network core to support Windows 7, or, move to Active Directory which would be an additional cost (server licensing + 2008 R2 CALs).

It seems then that this might be an opportune time to consider alternatives. The school has alot of Linux at the network core. File servers, domain controllers (LDAP + Samba + bind + dhcpd), Learning Platform, VoIP, SAN, Virtualisation Solution and more are all Linux-based and we have the expertise in the technical staff to support those systems.

From a BSF point of view I’m hoping this is a smart move too. It will significantly reduce ongoing licensing costs and is pretty hard to beat for long-term sustainability. It also makes the job of any potential managed service provider bidding on our site significantly harder since the expectation will be that the philosophy of the school should not be fundamentally changed by a switch in service provision.

My Christmas holiday project therefore will be to get an Ubuntu 9.10 box to mirror the functionality of a standard teaching workstation as far as possible. We’re pretty sure we know where the sticking points will be, but like most things, you won’t really know until you try.

Main points as I see them now:

  • Support from Leadership
  • Support from Governing Body
  • Training for Staff (and Students?)
  • Support for Windows-only software
  • Support for Legacy files (Microsoft Publisher being the worst offender)
  • MIS software officially requires Microsoft Office to run and runs on .net 2 and 3.5
  • Desktop Lockdown
  • Monitoring
  • Updating software (local apt repo?)

I’ll be posting here progress as I go along in the “Open Source Schools” category.

Secure Offsite Backups

November 16th, 2009

With more and more people having laptops at work, we needed a way to allow them to backup their files from remote locations securely.

We use Backup Professional from Attix5 for our server offsite backups but it’s frighteningly expensive when you have more than a handful of devices to backup. What I wanted was a system that does the same job, but that’s Open Source.

First I looked at duplicity/duplicati which I’ve used before and would do a good job, but they really require you to do a regular full backup and sometimes we don’t see remote devices for months at a time. We could have setup a very long interval between full backups, but the longer the restore chain, the greater the chance of having problems when you need a file restored.

I’d all but resigned myself to that limitation when I stumbled across BoxBackup. It offers continuous incremental-forever backups and you don’t even have to trust the server you’re backing up to. All the files on the remote server are encrypted and access to the server is by SSL certificates.

It’s not the friendliest bit of software to install, especially on Windows but I’ve made it work on all the machines we’ve tried so far, including a couple of Windows machines. The icing on the cake would be VSS support on Windows and a nice cross-platform GUI to wrap the whole install process and make it alot simpler.

The really nice thing is that you don’t notice it backing up. It runs as a service on Windows and as a daemon on Linux in the background and updates files on the central server once every hour (by default). You can configure it to send you email when it finishes each backup run along with details of how much data was sent.

There’s an ftp-client like interface to view backed-up files and to restore them to your machine. You can also restore directly to a USB drive attached to the server if you need to restore alot of files and don’t have the bandwidth to do it.