Recovering Wubi disk images

I previously waxed lyrical about Wubi as a nice way of getting Ubuntu on your Windows laptop without having to repartition your hard drive. It achieves this task by storing the partition as a disk image on your NTFS partition. However, I have recently discovered a major drawback of this approach. On the return leg of my journey, my laptop NTFS partition slowly started to die. Windows wouldn’t boot but the Linux partition was OK. However a few days later, I couldn’t boot Linux either. I am not sure yet if it is a hard drive problem or a file system problem but things were getting desperate as I had all my trip photos and videos on this disk!
Foolishly I ran CHKDSK in /R mode which decided to delete my root.disk index entry. Doh! I tried the various NTFS recovery utilities but to no avail. There are so many worthless (or expensive) file system recovery problems for Windows, I thought I might have better luck with a Linux utility.

In steps the excellent magicrescue. This utility can recover files based on a signature in the file header, similar to the way the Linux utility file works. However, to get it working you need to build a recipe which will identify Linux file system images. After a bit of hacking and with reference to /usr/share/misc/magic I constructed this one, which seemed to work:

1080 char x53
1081 char xef
1100 char x01
1124 char x03
command ./ 42949672960 $1

The accompanying Python script simply extracts N bytes from stdin and writes it to a file.

import sys
import os
max = int(sys.argv[1])
fh = open(sys.argv[2], "w")
n = 0
while 1:
 if n == max:
 data =
 n += len(data)
 if not data:

I found that this recipe extracted 4 potential files from the corrupt file system, of which one of them was my root.disk partition. Magicrescue has no way of identifying the end of a file, so I decided that I would extract to a file somewhat larger than the partition size (about 30Gb). After that has completed you can fix the partition by using e2fsck -f root.disk and then resize2fs. Job done!

Surf’s Up

“Err Scott, what are these rubbery things in the water? It’s seaweed right, not jellyfish?”

“Ah yeah, that’s just seaweed.”

Later on he confessed that was a lie.

Sharks and jelly-fish are the major animal threats to health when going surfing. But a strong rip, or a major wipeout which lands you on your neck are probably just as dangerous.

But right now, on my first surf lesson, I was more concerned with what a rediculous figure I cut in my wetsuit. Pigeon arms, fat tummy and a tiny pant protrusion caused by your dinkle retracting into its shell like a startled mollusc. Adding to my indignity was the fact I was learning with a load of 5-year olds. And they looked like they were going to be able to show me a thing or two on the waves.

First step is learning how to stand. Lie on your board with your feet touching the strap. Hands on the board, close in to your body. Push up and swing your legs round into a low crouch. Then quick as a flash (or as fast as possible), push yourself upright and centred on the board. Keep your knees slightly bent. Stick your arms out and up like you are at a disco. Trivial on the beach, rather more difficult in the water.

The waves were small and ‘dirty’ that day – meaning they broke close together without clean water separating them. These are poor surfing conditions for experts but fine for learners who don’t want big waves which smash you onto your board.

When learning, instead of paddling the instructor would push you into the oncoming wave. When you feel yourself being picked up by the wave, attempt to stand up. Simple in theory, rather difficult to manage in practice.

Nevertheless, after an hour in the water I’d managed to stand – for a few seconds at least – three separate times. Better than my Irish counterpart who was, quite frankly, struggling.

Rather pleased with myself, I couldn’t wait to get back into the water and consolidate my knowledge.

Later in the afternoon the waves were deemed fairly acceptable around Point Danger. I was reassured that the danger part referred to ships wrecked off the coast rather than to surfers. However, the beach was notorious for strong ripcurrents and was deemed too dangerous to swim, but OK for surfers who have the board as a buoyancy aid.

My second attempt was mostly a failure, hardly managing to stand up on the slightly shorter (and thus less stable) board that Scott had provided me. Surfing is divided into two disciplines, long-boarding refers to boards about 9ft. Short boards can be as short as 5ft. Long-boarding is easily to get into and lets you surf waves that would be impossible on a short board. But it is less easy to manouvere and go really fast.

As the long weekend progressed, the surf got better and better. We’d been watching surf films and it wasn’t quite “Big Wednesday” but it was definitely “Reasonable Sunday”. Scott told me that the area we are in – Coolangatta/Tweed Heads – is one of the best breaks on the Gold Coast. I learnt that there are several types of breaks – physical obstructions which create the wave shape that surfers look for. The main types are reef, beach and point breaks. Yeah, like the Keanu Reeves type. Locally there are two world-class breaks named Kirra and Snapper. These are like famous celebrities in Australia, mention them to any surfer and they’ll wax lyrical as to their specific qualities.

Surfers eagerly check websites with webcams for the current surf conditions all along the coast, and rush down in their cars when surf’s up. Consequently, the early mornings and evenings are the best time to surf. Scott will regularly get up at sunset (around 5am) to surf and stay late until it is nearly dark (6pm). During the day, there can be as many as 100 people sharing a sport, all trying to get on the same wave. This poses logistical difficulties with surfers coming at you from all angles. This is a particular worry for beginners who catch waves, falling off usually propels your board at considerable velocity in a difficult to control direction. I worried about ploughing my board into a child’s soft head.

Miraculously I avoided either killing or being killed whilst I honed my skills and learnt to control the board better. By Sunday, I could stand up fairly easily. The trick is to wait until you have properly caught the wave. The forward movement creates a stable platform which you can hop up on. If you haven’t properly caught the wave the board is unstable and you will fall. Lie too far forward on the board and the nose will point into the water, meaning that force will push you downwards into the wave, wiping you out. Too far back on the board will stop you catching the wave.

By Monday I had cracked it and was able to catch waves (you have to swim hard for a few seconds before the wave hits, and keep paddling whilst the wave is breaking underneath you until you get that wooosh of propulsion). I was getting on rides as long as 10 – 15 seconds.

All this takes a toll on your arms, legs and shoulders. I had also accumulated a large number of bruises, scrapes and grazes. My upper arms ached. I could also hardly walk by the end of the session, struggling to walk back up the steep hill to Scott’s.

But, I am totally hooked on surfing. Monday evening brought a fabulous sunset and some good surf, 3-4ft waves and very “clean”. With the day-trippers back in their cars to Brisbane, it was just us out there. Floating on a board, facing the setting sun, waiting for the swell to build up and the next set arrive was utterly relaxing. This kind of meditative relaxation has a spiritual element. I can see how people catch the surfing ‘bug’ and can’t ever go back to a normal life.

The post-surf buzz is just fabulous. A feeling of serenity counteracts the dull muscular ache. And if you close your eyes you can just see the swell rising and falling rhythmically. This natural high begs for an ice-cold beer, flopped out on the veranda balcony. After an hour of  vegetation, the ravenous hunger takes over and a sausage-filled barbecue is a virtual necessity. And then perhaps a couple of surf movies, before staggering to bed and slipping into a long, deep sleep.

Suddently Australian culture makes sense!

My surf pictures are on Flickr, and here’s a video of me surfing and narrowly avoiding killing a 9-year-old!
Top Surf Movies

We watched all these that weekend, and they were all great.

1. Point Break – Patrick Swayze is the ultimate surf philosopher/bank robber.
2. The Big Wednesday – “Deer Hunter” at the beach.
3. Surf’s Up – Surf penguins enter a competition. Surprisingly emotive.
4. Stepping into Liquid – Sentimental documentary about surf culture.

A Short Guide to Australian Food

You won’t be surprised to know I’ve been eating plenty on my trip. Here’s what I’ve found out.

Lamingtons – a sponge cake in chocolate icing, sprinkled with dessicated coconut. Ideal with afternoon tea. A stale one could probably choke a horse.

Snags – low-quality sausages for the barbie. Sold in packs of 500 if sport is on the telly.

Bugs – from Moreton Bay, delicious lobster like meat in a District 9 style crustacean case. $48.99/kg but damn tasty. Use the shells as a prop for your next sci-fi movie.

Vegemite – the classic Ozzie ingredient. Tastes like what you’d get if you put marmite and turnips in a food processor. To quote Mick Dundee: “You can live on it, but it tastes like shit.”

Fish – snapper, perch, barramundi, flathead, escolar. The major culinary reason to go to Australia. Absolutely top-notch quality; fresh and plentiful. What a change from back home!

Escolar – a fish which tastes like swordfish containing a waxy ester layer which can give you keirrohea – a bowel ailment which gives you rapid and oily faeces. I think I’ve had that.

Wagyu – raised for 300 days, grain-fed and purportedly given beer and massages. Actually some of the best beef I’ve eaten anywhere in the world. A bit depressingly good, actually. Originally for the Japanese export market you can get this in many restaurants and butchers. We actually need this back home (at a reasonable price). If they haven’t already, they should breed this locally. Australian “Scotch” beef is pretty good too.

Pie floater – a pie, sitting on mushy peas, often with gravy and/or ketchup. Not had one, they look pretty damn disgusting.

“Tasty cheese” – not a brand name, what Australians call mature cheddar.

Solo – really nice drink not unlike Fanta Lemon.

Kangaroo – a delicacy, a rich, gamey meat similar to venison. Also what they make dog food out of here.

Beer – despite our understanding of Australian beer to be pretty weak stuff, they have some very good beers here: Cooper’s, James Boag’s, Fat Yak. Quaffable stuff, improved by the way it is served: chilled glasses and small servings. Even the cask XXXX that I had at Brekky Creek Hotel was pretty damn decent. They don’t drink Fosters here.

Cheese – there is some pretty passable cheese here, most of it comes from the south, particularly Tasmania. I’ve not had anything that needs to be exported, but some pretty passable stuff none the less.

Steak Pubs – what a brilliant idea. Get sloshed on cold beers whilst watching AFL on the telly, then go and choose a massive chunk of wagyu, cooked perfectly rare and served with baked potato and coleslaw (which you can leave). I’m amazed we can’t do this back home as well.

Fusion/”Modern Australian” – the main problem with eating in Australia. It can happen in any restaurant. Take a perfectly nice dish (say, pasta) and then chuck in a load of asian ingredients: spring onions, chilli, coriander, soy sauce. Why?

Asian food – Bloody good, Japanese particularly thanks to the freshness of the fish.

Bushtucker – Apparently they do eat this stuff but I didn’t try it, thank god.

Sydney: Part 2

If my posts sound like I hadn’t been having a great time in Australia so far, you have probably got the right impression. I was beginning to despair that I was never going to feel better. Toilet visits were up to one an hour. I hoped desperately that a day of convalescing would get me in shape enough to look around Sydney before I had to move on again to Brisbane. I stocked up on supplies: coffee, orange juice, yoghurt, bread and cheese, plus some baby wipes. I watched “District 9”, a violent film about prawn-racism. It was pretty good but the protagnoist Wikus turning slowly into mutant seafood was unsettling. I fell asleep. I woke up again. I watched a few episodes of “The Thick of It” but it just depressed me. I fell asleep. I woke up. I had a terrible pizza on Victoria Street, the backpacking district. The chances of being well enough to visit the Sydney Fish Market to watch the wholesale auction at 7am the next morning were rapidly dissipating.

I woke up at 11am. What joy! I felt semi-human again. It was utter jubilation to be feeling a bit better! I didn’t even need the loo.

Mentally energised – Saturday, 2 days to discover what Sydney was all about. I set to it.

I walked down the McElhone Stairs to Woolloomooloo. I had my new favourite album by Miike Snow on my  iPod. The day was warm, about 20 degrees and breezy. Much nicer than Adelaide. I walked past the famous “Harry’s Cafe De Wheels”. This outdoor eatery is famed for its “Tiger” pie floater – a meat pie sitting on a little mound of mushy peas. Essentially Australia’s main culinary contribution. I stil wasn’t feeling well enough for that.

Walking past moored naval destroyers at the Sydney base I skirted the very fine Sydney botanical gardens. I passed a swimming pool set directly into the harbour wall which was bustling with activities. Rounding “Mrs Macquarie’s Chair” you are faced with that most famous of city vistas: the Sydney Harbour, bridge and opera-house. It’s one of those views that you can’t “get” until you see it in real life. What a vista. The skyscraper backdrop, clear blue sky, gardens and the kitschy Luna Park funfair add to the spectacle. Sydney is a world-class city like London, Paris or New York and it seemd the hype was justified.

I walked round to get to the Opera House which is covered in a reflective finish which makes it glint impressively. I had a coffee – well, several, as they kept knocking over in the wind and going all over my jeans.

Sydney has a vibrant restaurant scene and I was inspired by the excellent Sydney food blog Grab your fork to check out some fine examples of Sydney cuisine. Australia has no rich food culture to draw from so your main choices when dining is a genre called “Modern Australian”. This is a kind of updated, sanitised version of the Pan-asian/European “fusion” cuisine that was popular in the 90s until people realised it was totally stupid.

The other option is Asian food in Australia. This is fantastic and sometimes totally authentic. You have multiple options for top-notch Japanese, Chinese, Thai, Vietnamese and Balinese food. Australians eat out 3-4 times a week on average so there are huge numbers of restaurants. Japanese food seemed like a particularly good option with the plethora of top-notch fresh seafood available. Kabuki Shoroku was tipped as a particularly good one.

Arriving for my reservation I was pleased to see only Japanese faces. I ordered the sushi and sashimi followed by wagyu beef. The wagyu came raw, to be cooked at the table on a hot rock. The sushi chef was on fire, his knife technique was amazing. The sashimi was tuna, salmon or ocean trout and angel fish. It was served with some unagi (eel) which had been briefly seared on a tiny portable barbecue. I wished I knew the Japanese to get him to keep bringing me sushi like he was doing with the diners next to me. The sushi was excellent quality and the wagyu beef was a nice bit of theatre.

Returning home, I was finally sure that this trip was looking up!

Pictures of Sydney on Flickr here.

Sydney: Part 1

Next morning I was Sydney bound. I woke at 6:30am and got a taxi to the airport. Qantas being crap no longer fazed me. This was my fourth flight and I decided to just go with the flow. I was due to give a presentation at Westmead Hospital to clinical microbiologists and public health doctors in the afternoon. I was seriously considering cancelling or postponing. But I decided that would be unfair to my hosts and just slightly lame. So the plan was to get it done and get back to my death-bed ASAP.

Westmead was about 45 minutes by train from the airport. I arrived at the hospital and realised how appalling I looked. Unshaven, stinky, dirty sporting death eye-rings. I  made several trips between hospital shop and the gents, feeling like an alcoholic surgeon trying to get ready for a morning operating list after a heavy evening. Westmead Hospital is similar to many British hospitals built in the 70s – all concrete with no natural light.

After some time I managed to get myself looking half-way decent and even got my sweat patches under control. I popped another Panadol and went for lunch with my host Vitali, a microbiology consultant. We had a decent Thai meal and chatted about high-throughput sequencing applied to clinical microbiology.

Then it was time to look around their impressive clinical diagnostics lab. Then presentation time. I had 30 minutes this time, so I took my time and think I was clear if a bit more downbeat. The Ashes joke didn’t go down quite as well in this more austere atmosphere. But I good interest in the talk with 30 minutes of questions afterwards which was gratifying.

I was staying in Potts Point described as a leafy, well-to-do neighbourhood in upper Sydney. What they didn’t mention is that Potts Point borders the notorious Kings Cross district. Checking in to the Quest apartments the super-chatty receptionist said “don’t worry, it’s not like Kings Cross in London”. Presumably she meant because the London version is a lot classier. A mix of backpackers digs, kebab shops and nudie bars gave the area a grungey, Soho-like feel. Walking North into Potts Points properly it does get much more chi-chi. I killed the cockroach that crawled out of the kitchenette onto the carpet and decided to go out for dinner.

I had some restaurant recommendations from Chowhound and really fancied a decent bowl of pasta. The queue at Brothers Fratelli was long and unmoving so I settled for Lotus Bistro next door. The staff were off-hand and forgot about me for ages whilst I nursed a beer in the bar that I didn’t want. The clientele were seriously trendy, with suits sharp enough to take your face off. I overheard a particularly odious conversation – “I’m going to have a Gin and Tonic. Made with Hendrick’s Gin. Have you had Hendrick’s Gin? Hendrick’s Gin is better than other gins. I don’t have lemon with Hendrick’s gin because it bruises it.” This sort of brand-conscious behaviour made me laugh. Everyone knows Gordon’s make the best gin!

I didn’t really want to be in this place but I was so hungry it didn’t seem like an option to try my luck elsewhere. I was eventually seated and ordered a steak. Typical of Australian food there is a fusion theme. My “Scotch” fillet was served with sauteed greens, roast garlic, corn and wasabi butter. It was actually pretty good. But it would have been better if they’d served it plain with fries. Next to me were two Qantas air-stewardesses discussing their failed relationships and broken dreams. They talked about the life of a long-haul stewardess, it sounded utterly depressing. Who would volunteer for that level of sleep deprivation, periodically punctuated by terrible drink-soaked nights with philandering captains?

I would!

Mentally I was totally broken. I decided to spend as long as I needed in bed from that point on until I felt well again.

Death Warmed Up

I had been buoyed by adrenaline. The excitement of a new continent and a forthcoming presentation. Once my presentation was over I went into melt-down. A dry cough that had persisted from my plane journey became wracking. The Adelaide weather had been terrible – thunderstorms, rain and colder than back home. I had bone-trembling chills whenever I left the hotel room which I had ramped up to 30 degrees.

The whole conference went on a Barossa wine tour. The valley is famous for Shiraz but they do pretty much every style you could think of – Rieslings and Pinot Gris and Sauvignon Blanc and Chardonnay. Merlot, ‘Cab-sav’, Shiraz. Even tawny ports were covered. You’d be right to worry about the quality. I can’t really remember much of what I drunk. I just wanted to go to bed. The cellar door manager at Langmeil’s kept us waiting outside in the freezing cold whilst we got the full history. I wanted to hurt him severely. However, they did do a cracking Riesling called “Live Wire” which I would look out for back in the UK.

Back and bed. A few interminable hours later I got up again for dinner. Conversation was tough. Back to bed. High fevers, chills and not-quite-rigors ensued. Sleep was impossible. Toileting was troubling. I didn’t know whether to take my melatonin, concerned it would destroy some imagined neuroimmunological-chemical axis on the brink of collapse. I took it. I was gripped by terrible stomach pains. I filled out the University’s medical insurance policy online. I could imagine the investigation – “this form was filled out minutes before death!”. Eventually got to sleep at 4am and woke at 11am by the receptionist trying to kick me out of the room.

Scott and co were impressed at just how “green” I looked. I bought some Panadol and some fizzy water. Bus to the airport and a taxi to the Majestic Minima Hotel in Adelaide. This hotel has no staff and you check-in via a video screen which gives it a dystopic air. Are other guests robots? The rooms were tiny. But it was a relative bargain at $100 dollars a night. They make it up on Internet, access in hotels is very expensive ($20-30/day) and bandwidth metered. The most mean bandwidth allowance is at the Royal on the Park in Brisbane which gives you 100MB per 24 hours. Hardly enough to check your email. There was no ethernet cable supplied and no wireless so I decided to walk to the nearest computer store. Adelaide felt very staid and rather dull. Definitely not a party city. There is  colonial architecture. It can get up to 44 degrees centigrade in Summer but it was still very chilly. On the way I became very hungry and stopped for a burger. In Australia they put beetroot in burgers routinely. I got back home, reserved a taxi for themorning and fell into a dreamless sleep.

A tired little sausage in the Barossa Valley

The flight was an hour late leaving Bangkok due to a ‘technical problem’ with the plane. The staff are always disconcertingly vague on such points. Why not give you the details and let you make your own mind up if you still want to stay on? A fuel pipe problem is different from one that just makes all the inflight movies tedious. Some statistics relating technical problems to likelihood of flamey death would be helpful.

Being late, our arrival at Sydney was total carnage. Qantas staff incited us to get through customs and quarantine as quickly as possible. But airport staff actively thwarted any attempts to get through the queues. Despite a stressful battle through customs, the luggage wasn’t on the carousel. By the time I reached the queue for domestic transfer we were told that the connecting flight was closed and we’d just have to get on the next flight.

After half-an-hour more in the queue we were told actually the connecting flight was waiting for us and could we come straight to the front of the queue. Despite being already 20 minutes late for the flight we were forced to queue for another 30 minutes to get the bus to the domestic terminal. The tiredness and jet-lag was starting to get to me and I was getting irritated. I put my best whingeing pom accent on and suggested why didn’t they board the bus “according to the departure time”. Of course, this simply elicited the tried-and-tested Nazi guard response “I just do what I’m told to”.

Finally we boarded the plane. The flight to Adelaide from Sydney is about 2 hours. Arriving at Adelaide our baggage steadfastedly refused to appear on the baggage carousel. The long queue at the baggage handlers told the story. “Oh yeah, we didn’t load your bags” like that would have been an insane thing to do. “Why would you?”. They offered to deliver it to the hotel later that day.

At this point my mind was starting to give up its tentative grip on reality. I got a coffee and checked my email.

My next destination was the Barossa Valley, the famous wine-district, most reknowned for shiraz. There are plenty of massive producers: Penfolds, Peter Lehmann and the lamentable Jacob’s Creek. The Barossa is some 70km from Adelaide. I took a $150 taxi ride (£75; Australia is at least as expensive as the UK) to the main town, Tanunda. The sun beat down, magnified by the passenger window, my elbow rapidly going red. I struggled to stay awake and talk to my Sikh driver. Tanunda is a quite atypical introduction to Australia – it was settled by persecuted lutherean immigrants from Germany in the mid-19th century. Lutherean churches and german bakeries serving dot this small town. I decided to have a Mettwurst with sauerkraut to settle the nerves and stomach.

Somewhat steadied, I got a taxi to the Novotel Barossa Valley resort where BacPath 10, a conference on bacterial pathogenesis was being hosted. My taxi driver sported an expert beard and was a committed motorhead. We talked about Top Gear. “I LAHV CLAAAARKSON HE’S CLASSIC” shouted my host. “I ALSO LOVE CAPTAIN SLOW AND THE HAAAMSTER” he said with no appreciative irony. His favourite episode was the one where they drive across Botswana “CHASED BY THAT FLAMIN’ VW BUG!”. In fact, UK telly is everywhere here. Other than imports like Top Gear, there is Australian (Celebrity) Masterchef, Australian Idol, Australian Apprentice etc.

Arriving at the Novotel I was mildly perturbed to find I was sharing a room with two other delegates. I was in such a state I immediately decided to pay the extra $200/night to upgrade for a single room.

I met up with Scott and his two new post-docs who have emigrated from the UK to work in his lab. The conference started in the evening, after dinner. Letures after a few glasses of wine is never a sensible arrangement, but with my extreme tiredness it was a total killer. I watched the opening talk from Bob Hancock on Pseudomonas which was excellent but I was falling asleep in my chair so decided to call it a night.

I popped my second melatonin which seemed to work. I woke at 4am and 6am but managed to go back to sleep each time. This was much better than I expected.

I have virtually no recollection of the next day. I know I went to several sessions of talks, and I must have spent some time preparing my presentation. Most of the talks had been delivered in a pretty serious style and I debated with myself how many Ozzie gags I could get away with. Scott, a Kiwi, encouraged me to put my Ricky Ponting teeth-spitting slide in.

On Tuesday my talk went down well. I got plenty of laughs during my 15 minutes talk and loads of positive feedback. This was a high-point, it was downhill from here.