Silly Science Electronics, Programming and Hacking About

17May/130

Accessing partitions within an image or LVM volume used as an iSCSI target

I recently reinstalled the software on my NAS (open media vault) and tidied up the host name etc. As part of this I changed the name of the iSCSI target. This meant that my media PC wouldn't boot over the network (I set it up using XBMCbuntu using this guide - http://www.heath-bar.com/blog/?p=184). To solve this I managed to mount the partition on the NAS server itself and modify the necessary boot parameters.

To mount it I did the following:

  1. Install kpartx:
  2. sudo apt-get install kpartx

  3. Create a loopback device. This create /dev/mapper/loop0pX where X is the parition number
  4. sudo /sbin/losetup /dev/loop0 /dev/mapper/Target-LogicalVolume

  5. Mount the parition:
  6. sudo mount /dev/mapper/loop0p1 /tmp/iscsi-target-mnt

The reason I created the loopback device was because I kept receiving these errors:

$ sudo kpartx -a /dev/mapper/Target-LogicalVolume
device-mapper: reload ioctl failed: Invalid argument
create/reload failed on Target-LogicalVolume1
device-mapper: reload ioctl failed: Invalid argument
create/reload failed on Target-LogicalVolume2
device-mapper: reload ioctl failed: Invalid argument

Credit to http://www.skytale.net/blog/categories/5-Linux for pointing me in the right direction.

19Dec/121

MediaPC in a Xen Virtual Machine

The aim of this project was to get my MediaPC running as a VM host. This would allow me to run instances alongside my MediaPC, thus giving me a platform to experiment and develop things without having to setup separate machines etc.

I decided to use Xen on Ubuntu and found the Ubuntu Xen guide very useful.

Note: I never got this working - this is just documenting what I did and how it failed.

12Dec/1031

Installing gitorious on Ubuntu 10.04 HOWTO

I like using Git for my projects and I tend to host them outside of the computer I work on. I was finding the current way I was managing projects a bit cubersome so I decided to install Gitorious which gives you a nice web interface to manage it all!

Here are some instructions on installing Gitorious on your own Ubuntu 10.04 LTS server. The instructions from gitorious were a little out of date/confusing so I thought I would show you what I did to get it working successfully. It is based upon instructions from both gitorious' own instructions and some others they link to, plus some other digging/googling around [1][2] and [3].

Updated: Added some fixes/clarifications from the comments below! (If you spot any errors do please tell me!)

A few notes on this tutorial: Firstly - This tutorial is approaching it's first birthday which means (as with all things like this) it is getting somewhat outdated. With that in mind - approach with trepidation. I would read up on the relevant documentation from the developers yourself and make up your mind how helpful / relevant to you this whole process is.

Secondly - I have now moved to indefero (see http://www.indefero.net/open-source/) this is a lot easier to install and manage - offers all of the functionality that I have needed - which more than makes up for the lack of prettiness that gitorious had...

8Dec/103

rsync Backup / Dropbox style setup

Introduction
This tutoral/HOWTO is designed to help you setup an rsync back/dropbox style synced folder on the Netgear stora. The aim of this is to have a synced folder that will automatically back up to a remote location. The main reason that I wanted to do this was so that I could have a folder of documents backed up to my VPS and synced to my work machine and laptops.

It is similar in style to the 'dropbox' service. It is largely based on this HOWTO. It just covers a number of points for installing on the Stora!
This guide assumes you have a fully working package management system as described here - Installing a package manager and also assumes that you have SSH fully working.

25Sep/100

Useful Server Setup Tutorials

So I decided to take a leap and move VPS providers. Moving servers turns out to be hard work. Here is a list of useful stuff that I had to dig out again when setting up the new one -

As I find more of these I will update them as and when...