A Blog Less Ordinary

The blog of Dave Ingram

Restoring from LVM and VMWare disks

I recently had to restore a server that failed to boot after a power cut. This machine was a Linux VMWare host, and it had three Linux guest virtual machines that were running at the time. While we had full backups available, I decided to set myself the challenge of recovering the entire images, to save the pain of a complete rebuild.

The host server partitions were LVM-formatted volumes on top of hardware RAID-1, and each of the virtual hosts were partitioned with LVM too, internally. This means that the restore process will not be at all trivial. With just a complete image of the host system, I would need to restore (deep breath) files on a partition on an LVM logical volume (inside a volume group, on a physical volume) in a VMWare hard disk stored on LVM (logical volume inside volume group of physical volumes) inside a disk image that is itself a file on a disk. How very convoluted.

I used a Gentoo system to restore the data, although any Linux system with the appropriate packages should be able to do it. No searches turned up information on doing all of this, and I had to come up with some of it myself, so I thought I would document the process.

Continue reading →

mod_sqltemplate: A distraction from work

I’ve begun the long and (hopefully) interesting task of working on mod_sqltemplate. �I have not yet found a tutorial or guide to working with APR’s DBD API (the database abstraction layer for the Apache Portable Runtime), so I’ll write one and publish it here as I go along…

Modules for Apache and PHP

The number of projects I have in mind just keeps growing… I really need to get something together to organise them, and remember them! But here are two more to add to the list: an Apache module for dynamic configuration generation and a PHP framework inside an extension. Read on for a monster post with more information…

Continue reading →

HackWeekend: an introduction

So I’ve decided now that, as I have some free time and I will soon have some disposable income, that it’s time to start on an idea that’s been brewing for a little while: HackWeekend. This is a radical departure from some of my previous ideas, in that it’s a social thing.

When we were coming to the end of our time at university (and consequently our time as housemates), my good friend Alex Yong and I decided that this should not be the end, and we should all get together regularly afterwards. As we technical types aren’t that good at small talk, we thought that rather than just meeting up and chatting, we should actually have an aim in mind. An independent idea from another friend (Dave Durant) around the same time was that he and I should get together for a weekend sometime with lots of Red Bull and pizza and very little sleep, and to see what we could code/prototype.

Continue reading →

In-place array uniq in C

I’ve been developing Insight even though the uni project has come to an end, because it’s fun! I also want to make it more stable and eventually release it under an open-source licence of some kind. There will be an update coming soon, I promise! I now have Internet, so I can write up some things… Anyway, one of the interesting things I wanted to do for Insight was an in-place form of uniq for an array, ideally without any additional memory allocation. It seems that this is something nobody else has done yet! So I set about doing it myself… For those of you who are unfamiliar with the Linux/UNIX command uniq, it takes a sorted list and removes any duplicates. This is almost exactly what I’m trying to do, with one caveat: I need to keep the “discarded” duplicates. What happens is that I have an array containing a number of strings, and these have all been dynamically allocated via malloc() or calloc(). If I just remove or overwrite their pointers, they’ll vanish and cause a memory leak. While I’ve now fixed a large number of leaks thanks to Valgrind, I’m trying to actively avoid any possibility of adding them. Read on for the details… Continue reading →

A funny thing happened today…

So, today our ceiling fell in. With about as much warning as that! I was in our kitchen, preparing a cheese toastie for lunch. I opened the oven to put it under the grill to melt, while talking to one of my housemates. Suddenly he yelled “Move… MOVE!” and shoved me back. Up until he did that, I assumed he was just kidding around. And then, a fraction of a second later, the ceiling above the oven collapsed, showering down dust, plaster, bricks, and a bit of old copper piping. A brick went through the space the back of my head had been occupying just a heartbeat before. Needless to say, my plans for lunch were ruined 🙁 It would have been one hell of an excuse for not handing in my project report on time though! To see pictures, read more… Continue reading →

Insight: An update

Just a very brief update for the last few days:

One more update before I get back to coding… Insight now has an official logo!

Insight logo

Insight: Where am I now, and where next?

So I’ve been in Deep Coding Mode� for quite a while. What have I got to show for it?

Well, the short answer is that Insight is now a functioning file system… for a given definition of “functioning”.

Continue reading →

Insight: The current plan

As it comes time to work on my project again, it’s time to take stock and work out what my plan of action should be.

Looking at the code I have already, I think it’s clear that there is no way I will be able to write a kernel-level file system driver within the 2-3 weeks I have left. Fortunately, I had more or less expected this (as writing kernel code would be likely to take quite a while and be quite complex!) so I’m retreating to my fallback position: a FUSE-wrapped program that will interface with the metadata store.

Also on the cards is the use of Check as a C unit testing framework for my tree code – if I have time. At the moment, getting something to work is far more important than proving it is correct or works in all cases.

Finally, I need to come up with and write the demo programs, and I will shortly be posting about this and then asking the Twitterverse for ideas 🙂

Time to enter Deep Coding Mode.

No more exams!

So my exams have finally finished… it’s a very surreal feeling. Still got the project to go, but my time at university is even closer to being over. I don’t think it’s really sunk in yet.

Once the exam was over, a group of us headed to get some drinks, and came away with four bottles of cheap champagne sparkling white wine (“We’ve just finished our exams and want quantity over quality. What have you got?”) and headed to the Union to consume it. Sadly things got slightly out of hand there, but I eventually headed back home after completely failing to work out how I could get to Camden (because I managed to completely forget the Tube existed).

Came back after the post-exam celebrations to find these stashed in the kitchen:

Six 2L bottles of Old Rosie scrumpy

My cider has arrived!

So, next stop: project. The due date now seems incredibly close!

GitHub Google+ Twitter
This website uses a Hackadelic PlugIn, Hackadelic SEO Table Of Contents 1.7.3.