Saturday, 19th September 2009

In memory of Keith Floyd

Posted by David @ 19:36

Steak mealThis post is partly inspired by The Food Pornographer, but mostly in memory of the original-and-best TV chef Keith Floyd, who died this week.

Floyd was by far the most passionate and inspirational TV chef to ever grace our screens. Over the years his shows were instrumental in fomenting my love of food, as well as being highly educational and inspirational, uniquely covering everything from peasant food to elaborate feasts. The combination of food and travel is one of my favourite things, due in no small part to his shows. I must get to his restaurant in Thailand sometime soon, presuming it stays around.

In an attempt to pay tribute to Floyd, I thought I’d try to cook something vaguely cheffy for the first time ever, instead of the quick/easy/lazy dishes I usually make. So I cooked a well-seasoned fillet steak in olive oil and butter, served with a stack of sweet potato chips and portabello mushrooms (cooked in the steak pan while the meat was resting). It’s not perfect (the plate seems unbalanced, maybe needs some other kind of veg), but it was really, really tasty. Naturally I consumed a fair amount of wine during the preparation – doing otherwise would just be disrespectful :-)

So long Floyd. As Marco Pierre White said, “a little piece of Britain…died which will never be replaced”.

Sunday, 19th July 2009

Sometimes laziness…

Posted by David @ 16:52

…pays off.

For example, having been too lazy to make a serious attempt to remove the thorny mass that’s been threatening to take over my garden, it has now borne fruit – some nice ripe blackberries, to be precise.

Blackberries - small

Likewise the rapidly-expanding plant/weed that’s taking over my garden path is frequently full of bees, which are somewhat endangered at the moment, so I’d better not remove it…

Monday, 27th April 2009

Changes…

Posted by David @ 18:42

Some may have noticed that I’ve recently outright deleted half the content of my site. Most of it was pretty old and generally not very interesting. I’m working on a new site which will have less random/rubbish/irrelevant content, but will incorporate lots of nice web 2.0-ey features. If I manage to find some way to produce nice graphics despite not having any graphical-design ability, it may even look nice ;-)

I’ve also taken a few tentative steps into microblogging with Identi.ca (mirrored on Twitter if you’re that way inclined).

It’ll all be coming Real Soon Now™.

Sunday, 18th January 2009

New Year’s Resolution #367

Posted by David @ 17:04

Must stop buying things I read about in Wired

Saturday, 25th October 2008

Installing Debian with root on iSCSI

Posted by David @ 13:21

You know, if a normal person wanted a diskless Debian install, they’d use NFS – a widely supported way to have a root filesystem on a network share and therefore reasonably easy to set-up. I however, wanted to have the root filesystem on iSCSI since it’s a nice, fast way of achieving the same thing. I’m now going to document how I achieved this for those who wish to do the same, but first: if you want an easy solution, use NFS. Seriously. You need to have some experience as a Linux sysadmin, developer and Debian user to make this work.

HERE BE DRAGONS

You’re still reading? OK then, here goes.

The first step is to configure your iSCSI target, which I won’t go into here. You may find my previous post, Playing with iSCSI, helpful. Now grab a copy of the Debian netinst CD image, burn it to CD and boot from it on the machine you want to install on. Note: it’s essential that you have another machine already running the version of Debian that you’re installing.

Using another machine, you now need to get a copy of the open-iscsi sources. You should do this on a Debian system running the same version of Debian, with the same kernel on the same architecture as you are installing. Simply run:

apt-get source open-iscsi

You now need to make some modifications to the open-iscsi source to make it work in the Debian Installer environment (and in initramfs, which we’ll come to later). The changes are minimal, but for convenience I’ve produced a patch:

open-iscsi-initrdfix.patch

Change into the directory containing the open-iscsi source, and apply the patch as follows:

patch -p1 < /path/to/open-iscsi-initrdfix.patch

Now simply type make to build open-iscsi. This will build the open-iscsi userspace applications and the necessary kernel modules. If you find that open-iscsi refuses to build kernel modules with a complaint like the following:

make[1]: *** No rule to make target `linux_2_6_26′, needed by `kernel_check’. Stop.

Then don’t worry – this simply means that you can avoid compiling the modules, and will need to copy them from the running kernel instead.

You now need to copy some files, plus a few modules from the running kernel, to a USB pen-drive. From the open-iscsi directory you need the following (ignore the .ko files if the kernel modules didn’t build):

usr/iscsid
usr/iscsiadm
kernel/libiscsi.ko
kernel/iscsi_tcp.ko
kernel/scsi_transport_iscsi.ko

Plus the following files from your running kernel:

/lib/modules/`uname -r`/kernel/crypto/crc32c.ko
/lib/modules/`uname -r`/kernel/lib/libcrc32c.ko

If the open-iscsi kernel modules didn’t build before, copy the following too:

/lib/modules/`uname -r`/kernel/kernel/drivers/scsi/iscsi_tcp.ko
/lib/modules/`uname -r`/kernel/drivers/scsi/libiscsi.ko
/lib/modules/`uname -r`/kernel/drivers/scsi/scsi_transport_iscsi.ko

Now on the machine you’re installing on, begin the Debian installation and continue normally until after the stage where the network is configured. Now switch to a console (Alt+F2), insert your USB pen-drive and mount it. Copy the files off it and place them in /tmp.

You now need to create /etc/iscsi/initiatorname.iscsi with content like the following:

InitiatorName=iqn.1993-08.org.debian:01.665f5fd03076

The actual name isn’t important, just make something up (as long as it’s in the above format).
Now remove your USB pen-drive (important!) and run the following commands to get iSCSI going:

insmod /tmp/libiscsi.ko
insmod /tmp/scsi_transport_iscsi.ko
insmod /tmp/iscsi-tcp.ko
insmod /tmp/libcrc32c.ko
insmod /tmp/crc32c.ko
/tmp/iscsid
/tmp/iscsiadm -m discovery -t sendtargets -p <iscsi target ip address>:<port>
/tmp/iscsiadm -m node -L all

That will load all the required modules, discover your target and then connect to it. All being well, it will appear as a SCSI disk (check dmesg). Now you can continue the install normally. At the final stage of the install DON’T allow the system to reboot – the installed system can’t boot yet.

I decided that I wanted to boot using BOOTP and TFTP. You might want to boot from USB, a flash card or something else, in which case you’re on your own – I’m going to document how to boot using BOOP and TFTP. On your iSCSI target machine (or any machine, actually) configure the required daemons and drop in the Debian netboot files – you may wish to use Preparing Files for TFTP Net Booting as a guide.

Now that your installation is finished, you need to copy some files off the installed system to your pen drive. You need the initramfs and the kernel from /mnt/target/boot/ directory, named initrd.img-<kernelversion> and ‘vmlinuz-<kernelversion>. You also need the entire /etc/iscsi directory.

Now copy the files onto the machine you configured as your TFTP server, and put the kernel image into your tftp directory (probably /tftpboot). You now need to modify the initramfs image to add the iSCSI bits.

First, decompress the initramfs image into an empty directory:

gzip -dc <initramfs image> | cpio -id

Now, you need to copy in the contents of the pen drive to the right places. Copy the /etc/iscsi directory from the pen drive to etc/ in the directory containing the decompressed initramfs image. Also copy the iscsid binary to sbin/, and the iscsiadm binary to bin/.
Now you need to add the following to the end of scripts/init-premount/udev (we need to add it to one of the scripts run at the start of the boot process, and this is as good a place as any):

/bin/ipconfig -c dhcp -d eth0
/sbin/iscsid -f &
/bin/iscsiadm -m node -L all

You also need to copy in the kernel modules, into the correct paths:

lib/modules/<kernelversion>/kernel/crypto/crc32c.ko
lib/modules/<kernelversion>/kernel/lib/libcrc32c.ko
lib/modules/<kernelversion>/kernel/drivers/scsi/iscsi_tcp.ko
lib/modules/<kernelversion>/kernel/drivers/scsi/libiscsi.ko
lib/modules/<kernelversion>/kernel/drivers/scsi/scsi_transport_iscsi.ko

And finally, you need to edit the init script to reference the root partition, e.g:

export ROOT=/dev/sda1

Now re-create the initramfs image by running the following in the root of the directory in which you decompressed the image, and save it to your tftp directory:

find . | cpio -H newc -o > /tftpboot/initrd.img-<kernelversion>

That’s it. Ensure your TFTP server is fully configured, modify the PXE configuration to point to your kernel and initramfs image, then you can restart your system and hopefully you’ll get root on iSCSI…

linky