Archive for Feb. 2008

Battlefield – Bad Company

Great trailer of the next part of the Battlefield series.

My iBook will die! :’(

After having massive problems with my iBook last week, my worst fears became true today. A technician of Gravis (German Mac dealer) told me the Logical Board is broken. Repairing the iBook would be disproportional expensive, because it is already from 2005. Even it breaks my heart, I have to split up with my iBook.

Thank you for the nice times we had and rest in peace my lovely iBook!

Installing domU on single partition

First start with partitioning the partition (in my case it is /dev/sda4) by executing fdisk /dev/sda4. I’ve used the following layout:

Device Boot Start End Blocks Id System
/dev/sda4p1 1 16654 133773223+ 83 Linux
/dev/sda4p2 16655 16898 1959930 82 Linux swap / Solaris

After finishing this step it may be possible that you need to reboot the server, because the kernel can’t read the new partition table. Pay attention on the output which is written to the screen after quitting fdisk.

Now we need to install the package multipath-tools to get the tool kpartx. This is necessary to create the appropriate files in dev to access the partitions of the partition.

Installing multipath-tools
aptitude install multipath-tools

Create files in dev
kpartx -a -v /dev/sda4

This command will create the files sda4p1 and sda4p2 in /dev/mapper. Now we are able to format the root-filesystem and to create the swap area of the new domU.

mke2fs -j /dev/mapper/sda4p1 && mkswap /dev/mapper/sda4p2 && swapon /dev/mapper/sda4p2

When the formatting process is finished, we can start installing the OS for the new domU to the partition. In my case I’ve had a second harddisk (/dev/sdb) on which a Debian Etch has been installed. So I just sync the content of this disk to the new filesystem.

mkdir /mnt/source
mkdir /mnt/target
mount /dev/sdb1 /mnt/source
mount /dev/mapper/sda4p1 /mnt/target
rsync -avxH --numeric-ids /mnt/source /mnt/target
cp -av /lib/modules/2.6.22-14-xen /mnt/target/lib/modules/
umount /mnt/target
umount /mnt/source

After installing the guest OS you should be able to boot the freshly created domU with the Xen-Hypervisor. My domU-config (/etc/xen/domu.example.com) to achieve this goal looks like like below.

arch = os.uname()[4]
if re.search('64', arch):
arch_libdir = 'lib64'
else:
arch_libdir = 'lib'
kernel = "/boot/vmlinuz-2.6.22-14-xen"
ramdisk = "/boot/initrd.img-2.6.22-14-xen"
builder='linux'
memory = 1024
name = "domu.example.com"
vcpus=2
vif = [ 'bridge=xenbr0' ]
disk = [ 'phy:sda4,sda,w' ]
root = "/dev/sda1 ro"
extra = "2 TERM=xterm xencons=tty console=tty1 clock=jiffies"
device_model = '/usr/' + arch_libdir + '/xen/bin/qemu-dm'
boot="c"
sdl=0
vnc=0
vncpasswd=''
stdvga=0
serial='pty'

Let’s come to the end and start the domU!
xm create domu.example.com

Installing Xen 3.1 under Ubuntu

Let’s install Xen under Ubuntu. The installation is very uncomplicated so start with installing the necessary packages.

sudo aptitude install xen-hypervisor xen-utils xen-tools linux-image-xen

After this step run update-grub to make sure that the hypervisor is added to menu.lst. The command will show some output.

Searching for GRUB installation directory ... found: /boot/grub
Searching for default file ... found: /boot/grub/default
Testing for an existing GRUB menu.lst file ... found: /boot/grub/menu.lst
Searching for splash image ... none found, skipping ...
Found Xen hypervisor 3.1, kernel: /boot/vmlinuz-2.6.22-14-xen
Found kernel: /boot/vmlinuz-2.6.22-14-server
Found kernel: /boot/memtest86+.bin
Updating /boot/grub/menu.lst ... done

Now it is time to restart the box to boot the hypervisor. There are a lot of different commands to reboot a Linux box. I prefer init 6. When the OS comes up without any problem, everything should be fine. You can approve if the right kernel is loaded by executing uname -a.

Adapt Ubuntu for my Needs

After the initial installation I change different things for my claims. Do not forget to update your system before the following steps. This can be done by executing the following commands:

aptitude update
aptitude safe-upgrade

  1. Remove CD repository from /etc/apt/sources.list.
  2. Install vim to get my favourite text editor.
    aptitude install vim
  3. Enable syntax highlighting in /etc/vim/vimrc.
  4. Remove # from the following rows in ~/.bashrc to make daily business easier.
    # alias ll='ls -l'
    # alias la='ls -A'
    # alias l='ls -CF'
  5. Install some other often used tools.
    aptitude install mc traceroute lynx screen

Lebenslang Grün Weiß

Song about the best football club in the world!

Installing Ubuntu

Alright, let’s start installing Ubuntu Linux on the server. You can find my hardware specs in previous post in German. First of all download the iso image from an Ubuntu mirror of your choice. I have got the image from the Link below:

Download

After downloading the image burn it to a cd and boot the computer/server from it. Most of the time you can follow the instructions on the screen. I’ve changed the harddisk layout for my needs. Because I’m going to install Xen on the server, I decided to use the following partitioning:

Device Boot Start End Blocks Id System
/dev/sda1 * 1 1216 9767488+ 83 Linux
/dev/sda2 1217 1459 1951897+ 82 Linux swap / Solaris
/dev/sda3 1460 13617 97659135 83 Linux
/dev/sda4 13618 30515 135733185 83 Linux

  • /dev/sda1 will be mounted to /
  • /dev/sda2 is the swap area
  • /dev/sda3 will be mounted to /home for storing images for the domU’s
  • /dev/sda4 will be exported as one harddisk to a special domU

During the package selection I choose only SSH-Server. Everything else will be installed after finishing the installation. So if everything is ready, reboot into your fresh installed Ubuntu Linux.

Server Upgrade

Mein Server hat endlich neue Hardware spendiert bekommen. Es handelt sich dabei leider auch nicht um komplett aktuelle Hardware, aber immerhin besser als die alte AMD-Möhre. Die Ausstattung sieht nun wie folgt aus:

  • Gehäuse: Supermicro 1HE
  • Mainboard: Supermicro PDSMi+
  • CPU: Intel Pentium 4 3,0 GHz auf Sockel 775
  • RAM: 4 GB DDR2 von Kingston
  • Festplatte: 250 GB SATA2 von Western Digital

Hoffen wir darauf, dass der Server schön stabil läuft. Als OS wird darauf ein 64Bit Ubuntu 7.10 zum Einsatz kommen. Die Installation werde ich in einem weiteren Post näher beschreiben.

Hallo Welt!

Nun gehör ich also auch zur bloggenden Spezies. Mal schauen wie oft ich es schaff hier neue Beiträge zu posten. In den Beiträgen wird es vor Allem um Linux, hin und wieder um mein Privatleben und alles was sonst noch so berichtenswert ist gehen.