Saturday, June 6, 2009

Debian installer on Xen post-install

Here are a few things that I like to do to a Xen domU that's been installed by the Debian lenny installer:

# for foo in hooks scripts/init-premount; do 
bar=/usr/share/initramfs-tools;
mkdir -p $bar/disabled/$foo;
dpkg-divert --divert $bar/disabled/$foo/thermal --rename $bar/$foo/thermal;
done
# update-initramfs -tu
# update-rc.d -f hwclock.sh remove
# update-rc.d -f hwclockfirst.sh remove
#


The first couple of 'lines' disable the loading of thermal modules from the initial RAM disk. The last two lines disable reading from and wiring to the hardware clock (as it doesn't exist in the domU).

The following lines are mostly for me. I like to have 'xvda1' and 'xvda2' mapped to separate logical volumes on the dom0 and this makes Debian's grub implementation grumpy. It's worth doing, so that you can resize these logical volumes without messing with the partition table that would otherwise have been created on 'xvda'.

# sed -i /grub/d /etc/kernel-img.conf
# perl -pi -e 's#/boot(/[^-]+)-\S+(\s|$)#$1$2#' /boot/grub/menu.lst
#


The first line stops the Debian kernel packages' post installation scripts from running 'update-grub', which fails when no '/dev/xvda' exists. This does, however, mean that the grub menu will not be updated when a new kernel is installed. The second line mitigates this by updating the menu file to use the links in '/', rather than the specific paths to the files in '/boot/'. This should allow pygrub to boot new kernels as they are installed, even though the grub menu will not be updated.

Wednesday, February 18, 2009

Linux to Solaris

For some time I've been interested in Solaris (particularly OpenSolaris) but I've never had the time or interest to take my explorations beyond installing the system and doing basic SysAdmin tasks. While reading some comments on an interesting blog post about 'The Enterprise Linux problem', I saw the following link:

http://opensolaris.org/os/community/advocacy/immigrants/

It provides links to some great posts that will help experienced SysAdmins get used to Solaris.

Thursday, February 5, 2009

Comparison of console management techn{iques,ology}

Here's a great bit of work by Ian Durkacz (University of Edinburgh, School of Informatics, April 2007) which compares various methods of remotely connecting to the console of a Linux server:

http://www.dice.inf.ed.ac.uk/units/infrastructure/Projects/06-Consoles/consoleoptions.pdf

It covers KVMoIP, multi-port serial cards, serial concentrators, IPMI and Dell Remote Access Cards (DRAC) and provides rough per-server prices.

Tuesday, February 3, 2009

Pipe viewer

"Pipe viewer is a terminal-based tool for monitoring the progress of data through a pipeline. It can be inserted into any normal pipeline between two processes to give a visual indication of how quickly data is passing through, how long it has taken, how near to completion it is, and an estimate of how long it will be until completion."

http://www.catonmat.net/blog/unix-utilities-pipe-viewer/

Wednesday, January 21, 2009

Add partition devices on linux

I often end up with a Linux block device or file which contains a PC partition table. The `kpartx` utility (part of the Linux multipath-tools) can create device nodes for partitions which were not detected at boot.

# kpartx -av /dev/loop1
add map loop1p1 : 0 144522 linear /dev/loop1 63
#