Monthly Archives: July 2009

Take over packagelist from one Debian to another

In order to sync the state of installed packages from one Debian or Ubuntu to another one, the following process can be helpful. Make a packagelist on the original machine:

dpkg --get-selections > myselections.txt

Transfer the packagelist (myselections.txt) over to the new machine and do the following there:

apt-get update
dpkg --set-selections < myselections.txt
apt-get -u dselect-upgrade

Setup of Sun Grid Engine

Sun Grid Engine facilitates computing in distributed computer networks. Its setup is just documented here. Its not nearly complete though.

Setup log

Enter the database directory
or hit  to use default [/usr/local/sge-root/default/spooldb] >>
# ------------------
We can install the startup script that will
start berkeleydb at machine boot (y/n) [y] >> 

cp /usr/local/sge-root/default/common/sgebdb /etc/init.d/sgebdb
/usr/sbin/update-rc.d sgebdb
# ------------------
Please give the basic configuration parameters of your Grid Engine
installation:

   

The pathname of the spool directory of the execution hosts. User >sge<
must have the right to create this directory and to write into it.

Default: [/usr/local/sge-root/default/spool] >>
# ------------------
You should now enter the command:

   source /usr/local/sge-root/default/common/settings.csh

if you are a csh/tcsh user or

   # . /usr/local/sge-root/default/common/settings.sh
# ------------------
Please now login to all hosts where you want to run an execution daemon
and start the execution host installation procedure.

If you want to run an execution daemon on this host, please do not forget
to make the execution host installation in this host as well.

All execution hosts must be administrative hosts during the installation.
All hosts which you added to the list of administrative hosts during this
installation procedure can now be installed.

You may verify your administrative hosts with the command

   # qconf -sh

and you may add new administrative hosts with the command

   # qconf -ah 
# ------------------
# Editieren globaler Variablen
qconf -mconf global

Known errors and fixes

To fix

/usr/local/sge-root/util/arch: line 256: [: too many arguments

insert in line 247

libc_string=2.7 

Adjust Cacti for fine grained Input Data

Cacti is a fine graphing solution for all sorts of use cases. It only has problems with with small range inputs. The result are graphs which lack labels, i.e. being hard to read. This code adjustments fixes this. The following lines in /usr/share/cacti/site/lib/rrd.php need to be adjusted:

if ($graph["auto_scale"] == "on") {
    switch ($graph["auto_scale_opts"]) {
        case "1": /* autoscale ignores lower, upper limit */
            $scale = "--alt-autoscale" . RRD_NL;
            break;

The replacement consists of:

if ($graph["auto_scale"] == "on") {
    switch ($graph["auto_scale_opts"]) {
        case "1": /* autoscale ignores lower, upper limit */
            $scale = "--alt-autoscale --alt-y-grid" . RRD_NL;
            break;

Diskless Boot a Linux System (Debian)

 

In order to boot a Linux system disklessly from a server on your local network, these steps outline the necessary steps. Beware that this is just a brain dump. This documentation is not intended to be fool proof nor is it a copy'n paste howto. It just gives an oversimplified guide to the process.

Configure and build grub

First, grub has to be built supporting network boot with a couple of network drivers (pxegrub). Therefore, a patch from http://os.inf.tu-dresden.de/~adam/grub/0.97/ needs to be applied to grub's source. Then, the build process can be done with the following shell script:

#!/bin/bash
export CC=gcc-3.4
for i in 3c90x e1000 eepro100 pcnet32 rtl8139 r8169 tg3; do
        make clean
        ./configure --enable-diskless --enable-pxe --enable-$i
        make
        cp stage2/pxegrub /boot/pxe-boot/pxegrub/pxegrub.$i
done

make clean
./configure --enable-diskless --enable-pxe --enable-3c90x \\
       --enable-e1000 --enable-tg3 --enable-pcnet32
make
cp stage2/pxegrub /boot/pxe-boot/pxegrub/pxegrub.3c90x_e1000_tg3_pcnet32

Kernel build process

Now, a new kernel has to be compiled. Therefore, get the most recent kernel from http://www.kernel.org. Unpack and configure with IP: kernel level autoconfiguration = YES and IP: DHCP support from networking options and nfs from filesystem options.

Compilation is done by

make && make modules && make modules_install

or on AMD64 systems by

make ARCH=x86_64 menuconfig && make ARCH=x86_64 && make ARCH=x86_64 modules && make ARCH=x86_64 modules_install

Now, arch/i386/boot/bzImage can be taken as the new kernel.

Build new initramfs

Edit /etc/initramfs-tools/initramfs.conf to suit the netboot purpose:

MODULES=netboot
BOOT=nfs
NFSROOT=auto

Execute mkinitramfs -o initrd-netboot.img /lib/modules/<kernel_version>

Now, put the new initrd-netboot.img and bzImage into pxegrub's menu.lst.

Preparation of the boot image

The debian package debootstrap help prepping the network boot image, but it need to be installed first:

aptitude install debootstrap

Now, the following line creates a fully functional boot image:

debootstrap --include=nfsbooted,dhcp3-client,procps,passwd,vim,\
                      less,configure-debian,udev,console-common \
            lenny . http://ftp.de.debian.org/debian/

A few customisations and then it's done:

  • edit etc/hostname to your needs
  • create a valid hosts file: cp /etc/hosts etc/hosts
  • change root password by using chroot .
  • copy modules into new root: cp -a /lib/modules/<netboot_kernel_version> lib/modules/
  • boot!
  • Inside the new system: aptitude update && aptitude install openssh-server common-keymap && configure-debian --all