My name is Andy and I have a problem

$ find /home/andy/Maildir -type f -wholename '*/new/*'| wc -l
$ find /home/andy/Maildir -type f -wholename '*/cur/*'| wc -l

If it’s not obvious, that means I have 123k unread emails and 24k read ones. I archive off read emails older than 60 days, but still, that’s pretty pointless and stupid. It’s time to have a purge and unsubscribe from all those lists which I always think I’ll get around to reading at some point.

Update: Just over a week later and with some ruthless pruning, things look much better:

$ find /home/andy/Maildir -type f -wholename '*/new/*' | wc -l
$ find /home/andy/Maildir -type f -wholename '*/cur/*' | wc -l

Not everything is an issue of liberty

Andrew comments regarding Dog-lead goths ‘hounded off bus’:

Now whilst I am not for/against the Goth lifestyle – it’s not something that I’d personally get into. However, just because it’s seen as a bit ’strange’ or ‘weird’ to the majority of us does not mean we should prevent it.

Andrew, if you take the bus company at their word they were not stopping it because they deemed it “strange” or “weird”, but because they deemed it unsafe, i.e. they did not claim to be taking a position on the Goth lifestyle. Being libertarian (or indeed anarchist) does not mean “everyone can do anything they want.”

I have a little difficulty in seeing how these two being chained together really affects anyone else’s safety though..!

Freecycle as a dating service?

After discussing the following Freecycle ad on IRC:

Hi all. me and my chilren are moving to an unfurnished home and we need pretty much everything like sofas 2 two seaters colour unimportant. microwave, tv unit, small tv for my daughters bedroom and everything would be well appreicated so please contact me if you have any of these on your list to clear out. many thanks and kind regards

I want to know, has anyone dated anyone they met from Freecycle? Feel free to tell me in confidence if you don’t want to be identified!

Update: Just to clarify, I am not suggesting that this ad in any way presents itself as looking for dates. The conversation that followed me mentioning it on IRC did, however, contain a suggestion that someone who was interested in meeting single mothers might find Freecycle a good place to do it. And I am interested to know if anyone has ever had a relationship with someone they first met from Freecycle.

Red Hat-based Linux under Xen, from Debian Etch

I find myself in the position of needing to overhaul BitFolk‘s Red Hat-alike offerings, which at the moment are limited to Fedora Core 6. Apparently that is out of date now and Fedora aren’t supplying any updates for it anymore, and my understanding is that in Red Hat land one can’t just upgrade to the latest release without reinstalling. Sadly I don’t think I can convince every customer to upgrade to Debian or Ubuntu, so I need to move with the Red Hat times. I decided to start with Centos 5 because that’s the one with the most demand.

The first thing I find is what looks like a very nice guide to installing Centos under Xen. At the moment all of my dom0s are Debian Etch, some with Linux software RAID (md) and the newer ones with hardware RAID. All of the Xen domains currently have their block devices exported as individual LVM logical volumes from dom0.

Going by the HOWTO, that’s not the way to do it in Centos (and by extension, every other Red Hat-alike) anymore. They want their storage as a disk image, exported as /dev/xvda which they will partition themselves. A departure from my current setup, but should be possible. Unfortunately it seems that there is some bug somewhere in md/LVM/Xen about trying to export an LV as a whole disk like this. Say this is my domU config file:

name = 'centos5'
memory = 120
kernel = '/boot/vmlinuz-centos5-install'
ramdisk = '/boot/initrd.img-centos5-install'
extra = 'text'
disk = [ 'phy:mapper/mainvg-domu_centos5_xvda,xvda,w' ]
vif = [ 'mac=00:16:3e:1b:b2:e7, bridge=xenbr0, vifname=v-centos5' ]

with /dev/mapper/mainvg-domu_centos5_xvda being an LV.

If I start this up, the installer kernel kicks in and begins the process, but any operations on exported disk result in thousands of dom0 kernel messages like this:

Jan 19 01:54:43 montelena kernel: raid10_make_request bug: can't convert block across chunks or bigger than 64k 653279743 4

At some point the domU will see this as a corrupted block device, remount it read-only and the installation will fail.

Searching for more information on this problem leads me only to a similar report from January 2007 by Ask Bjørn Hansen with no follow-ups except from me, reporting the same thing. I mailed Ask to see if he solved the problem, but he told me he just moved to image files and then the problem went away. I do not want to move to image files.

The problem does not happen when I try it on a machine with hardware RAID. I still have too few machines with hardware RAID to accept that as a solution though.

I’m thinking that it won’t happen if I did away with exporting whole disks and went back to exporting individual block devices. To try to test my theory I thought I’d go ahead and do the Centos install on one of the machines with hardware RAID, which would leave me with a disk image on an LV, that I could later split out into separate block devices.

I then encountered problems getting pygrub to work, so I may as well note down what I did to get that going in case it would be useful for anyone else.

For those who aren’t aware, pygrub is a Python tool which can look inside a disk image or a filesystem to find a GRUB menu.lst. It then emulates the GRUB menu and returns the kernel, initrd, boot arguments etc. etc. that GRUB would normally have selected. It’s a way to keep all the kernel stuff inside the guest filesystem so it can be managed as usual by the admin of the guest.

pygrub comes as part of Xen, and on Etch it can be found at /usr/lib/xen-3.0.3-1/bin/pygrub. To test it you can just run it with a disk or filesystem image/device as the parameter:

$ sudo /usr/lib/xen-3.0.3-1/bin/pygrub /dev/mainvg/domu_centos5_xvda

What that got me at first was a python error about “GrubConfig” not being found (sorry, the exact text has scrolled off my screen and I forgot to save it to a file…). That’s because of Debian bug #390678. To fix it just do as it says and edit the sys.path in /usr/lib/xen-3.0.3-1/lib/python/grub/ to be /usr/lib/xen-3.0.3-1/lib/python.

That got me a new error about being unable to read the filesystem. Searching around provided me with some clues that it would be a case of putting some python filesystem stuff in /usr/lib/xen-3.0.3-1/lib/python/grub/fsys/.

I downloaded the source of Xen 3.0.3, went into tools/pygrub/, installed the python2.4-dev and e2fslibs-dev packages, then did a “make”. That completed without error and left me with:

$ ls -la build/lib.linux-i686-2.4/grub/fsys/ext2/
total 36
drwxr-xr-x 2 andy andy  1024 2008-01-19 22:33 .
drwxr-xr-x 3 andy andy  1024 2008-01-19 22:33 ..
-rw-r--r-- 1 andy andy  1126 2006-10-15 12:22
-rwxr-xr-x 1 andy andy 30352 2008-01-19 22:33
-rw-r--r-- 1 andy andy   220 2006-10-15 12:22

which I copied into /usr/lib/xen-3.0.3-1/lib/python/grub/fsys/ext2/.

Success! I’ve now got Centos 5 in a disk image which can be booted from my Etch dom0 with the following domU config file:

name = 'centos5'
memory = 120
disk = [ 'phy:mapper/mainvg-domu_centos5_xvda,xvda,w' ]
vif = [ 'mac=00:16:3e:1b:b2:e7, bridge=xenbr0, vifname=v-centos5' ]
bootloader = '/usr/lib/xen-3.0.3-1/bin/pygrub'

(Remember this is only on a dom0 with hardware RAID; if I try to do this on LVM over md I suffer disk corruption in the exported LV)

The next thing I wanted to do was get access to the first partition of that disk image from the dom0 so that I could take a copy of it and use it as the basis for another block device. It may not be immediately obvious to you how to get at a partition inside a disk image; the way to do it is with kpartx. On Debian that can be found in the package multipath-tools:

$ sudo kpartx -a /dev/mainvg/domu_centos5_xvda
$ sudo ls -la /dev/mapper/*centos5*
brw-rw---- 1 root disk 254, 96 2008-01-19 23:51 /dev/mapper/domu_centos5_xvda1
brw-rw---- 1 root disk 254, 97 2008-01-19 23:51 /dev/mapper/domu_centos5_xvda2
brw-rw---- 1 root disk 254, 95 2008-01-19 20:20 /dev/mapper/mainvg-domu_centos5_xvda

The first two were added by kpartx and can be mounted like any block device. I did so, took an archive of the contents, created a new test LV, and unpacked that tar into it. I then labelled the new LV as “/” (because that’s how Red Hatters find their root filesystem):

$ sudo e2label /dev/mainvg/domu_test_root /

and came up with a new domU config file:

name = 'centos5'
memory = 120
disk = [ 'phy:mapper/mainvg-domu_test_root,xvda1,w',
         'phy:mapper/mainvg-domu_test_swap,xvda2,w' ]
vif = [ 'mac=00:16:3e:1b:b2:e7, bridge=xenbr0, vifname=v-centos5' ]
bootloader = '/usr/lib/xen-3.0.3-1/bin/pygrub'

This works, no disk corruption.

So Centos 5 is available now, and I will try to get around to Fedora 8 as well at some point.


Andrew, I’ll be going. I expect a few other hantslug/bitfolk people will as well. I’m waiting for Graham to kick off talk of a mass Eurostar booking…

The Eurostar may end up slightly more expensive than a flight, but getting to/from the actual train will be a lot less hassle than by plane, and the trip itself will be more comfortable.

My eyes! The goggles do nothing! (Day 2)

Day 2 of the conjunctivitis saga (Day 1 · Day 3).

Today’s photo might look worse than yesterday’s to some people. I think that’s just because it’s a more detailed photo — it turns out that being able to see enables one to use a camera more effectively.

The whites of my eyes are much more white today. The gunk level is much reduced (if that’s not obvious it’s only because yesterday’s was so blurred you couldn’t tell where the gunk stopped and the eye began). In fact most of the visible gunk is actually from the eye drops I’ve been given.

I think I can avoid a trip to hospital today.

My eyes! The goggles do nothing!

Day 1 of the conjunctivitis saga (Day 2 · Day 3).

This entry is just going to be me complaining like an old man about my various illnesses in a long rambling manner, so if that is of no interest to you I recommend you stop reading now.

I’m so sick of colds and associated illnesses. I feel like I’ve had a cold for months. A few weeks before Christmas I had proper flu, the kind that makes you stay in bed simultaneously sweating with fever and shivering with a chill. That lasted around four days but with sniffles lingering on right up until Christmas.

Just as I was over it I travelled up to Birmingham to spend Christmas week with family, and everyone there was ill with some coughing and sore throat thing as well! I spent a week surrounded by the walking dead, wondering when it was going to be my turn. I thought I’d got away with it: I returned to London on the 28th still feeling okay, and walk in to the sound of my house mate Phil having a coughing fit.

A few hours later I could feel my throat going.

On the 29th I met up with a work colleague to take the on-call stuff from him, for I was to be on-call over the New Year period, handing over on Wednesday 2nd. The throat/cough thing was getting worse, but it was just an irritation, I could handle it.

By New Year’s Eve it was fairly miserable. During the day I’d been in dayjob’s office as it was a normal working day I’d not booked as holiday. I struggled through, not being very productive and got out of there about 6.15pm. I did have somewhere to go that would be on-call-friendly and still sociable, and I could have forced myself to get into the spirit, but due to a miscommunication that didn’t work out anyway. By 10pm NYE I’d had enough of it all and went to bed. Woken at 1am by the on-call phone, I ushered in the new year by rebooting things.

New Year’s Day was spent mostly under the duvet occasionally reaching for snotrag.

I was meant to be back in the office on Wednesday the 2nd, but the cold had become a lot worse and I took a sickie. Not a great way to start the new working year, but I wouldn’t have been up to much anyway. By this point my body clock had given up any semblance of coinciding with working hours and I was finding myself unable to sleep until past 5am, then waking up a few hours later with the alarm. When this happened on Thursday morning I was actually feeling a lot better, just completely exhausted and sleep-deprived. I emailed in another sickie and settled down for some sleep, content that Things Can Only Get Better.

Remember the on-call stuff? I was meant to hand over on Wednesday but because I’d pulled two sickies I still had it, so I was still on-call. This is not ideal of course, but was doable in the face of mere man-flu.

Some time later it was dark and my eyes wouldn’t open. Welded shut with eye-goo. And itchy, so incredibly itchy. Feeling like I’ve got glass under the lids. With some pain I force them open, discover it is Thursday evening, and visit the bathroom mirror to check out the damage. My eyes were a bit red but it didn’t seem that bad once I’d washed my face. But the itchiness wouldn’t go away, in fact it only got worse as the night progressed.

By late Thursday night the whites of both my eyes had turned deep red, goo was continuously leaking everywhere, and I’d have to unstick my left eye every few minutes. My eyelids felt like weather balloons, the whole area around my eye sockets was painful to the touch. What the hell is wrong?

I had it once before when I was a little kid: conjunctivitis. My cold’s parting gift.

It got so bad that I decided I must take a picture of it just so that people would believe me. It turns out that taking a picture of your own eyes without a tripod when you are a crap photographer is really hard. Every shot was just too blurry to make sense of. What follows is the best I could do, and it does not do justice. You can’t really see how red my eyes are, nor how encrusted with gunk. You did want to see that, right?

That was from this morning. Time to visit the doctor!

Last year, some people mistakenly got the impression that I do not like my doctor. This is completely false; I think he’s pretty good actually. He seems very efficient, seeing me and most others in mere minutes, yet in the few times I have seen him I’ve never felt that he was trying to rush me out the door. He always takes the time to discuss treatments, and doesn’t get too exasperated when I bring up other things unrelated to my appointment.

Of course I had to get past the usual hurdle of the demon receptionist when I called at 8.45am, her trying to persuade me that I don’t actually need to see the doctor today, but with my eyes doing that I Do Need To See The Doctor Today and wasn’t going to accept any other outcome. They warned me that because of this vomiting bug thing I’d probably have a long wait but it turned out to only be about 20 minutes.

As soon as I walked in to his room he looked at me and said, “My God, it’s been a long time since I’ve seen conjunctivitis that bad. I’ll give you something for it but if it isn’t any better by tomorrow then you must go to hospital.” Hey, at least I got my diagnosis correct. While I was there I got him to give me a flu jab as well.

What I did next was a bit silly. I still had the on-call stuff you see, yet I’m obviously not fit to carry out that duty. I’d emailed work before setting out for the doctor’s to explain what was wrong with me and that I’d be bringing the on-call stuff in to hand it over to someone else. Even before seeing the doctor I knew that conjunctivitis can be very contagious, but I was feeling guilty for my time off and didn’t feel able to call them up and say “yeah I’m not coming in today either, and I can’t do on-call, and I’m not bringing the on-call stuff back, sorry.” I should’ve though. I do not recommend doing what I did, which was to go straight from the chemist to the office.

Walking about with one eye gunked shut is interesting, if unpleasant. Using public transport and crossing roads etc. is quite nerve-wracking with limited vision. Also people staring and making comments about my encrusted eyes was a bit embarrassing. When I got into the office, the youngest of the many goths we breed there said, “Dude, didn’t you see the email saying Don’t Come In?” “I’m not seeing a lot of things at the moment.” was the best I could come up with. The rest of the team kept their distance as I unpacked the laptop and phone, and the person I was to hand over to looked extremely nervous about taking possession of these potentially-infected items. In fact she told me to “just leave them on your desk and we’ll.. do something with them.” Ace. I left.

Once again, I do not recommend walking about in public with contagious infections. It was irresponsible and stupid of me and entirely due to my own lack of backbone to just say “no” at key moments. In this case it was even just the thought of having to say “no”, since in reality my employer urged me not to do this anyway (only I didn’t see that, as it happened in email while I was at the doctor’s).

Anyway, I’m feeling a bit better now. The eyes still look pretty bad but they’re not leaking much anymore, and are a little less red, so I have hope that I won’t be going to hospital tomorrow. I’d probably just get the vomiting bug and MRSA as well, anyway.

I’ll try and take another photo of the eyes tomorrow. I bet you can’t wait.