Category Archives: Posteet

Lenny, Xen domU and amd64

There is not yet a xen-amd64 domU kernel for Lenny. There might not be one on release day. Discussion here: http://groups.google.com/group/linux.debian.devel/browse_thread/thread/8940430a093bbda5/546883797d0cbdf9

Fortunately, someone builds a 2.6.26-xen-amd64 kernel.
Add this to your sources.list:
deb http://kernel-archive.buildserver.net/debian-kernel/waldi/xen-extra/ all main

Install these packages:
linux-image-2.6.26-1-xen-amd64
linux-modules-2.6.26-1-xen-amd64

Fix the “new Xen console” problem (xen now uses hvc0 for its console):
If you use pygrub, in grub.conf on the domU add these kernel parameters : console=hvc0 xencons=tty
title Debian 2.6.26
kernel /boot/vmlinuz-2.6.26-1-xen-amd64 ro root=/dev/sda1 console=hvc0 xencons=tty
initrd /boot/initrd.img-2.6.26-1-xen-amd64

If you don’t use pygrub, specify extra = “console=hvc0 xencons=tty” in your virtual machine xen config file.

Use at your own risk 😉

By the way, this fixed a nasty bug for me: php5-cli used to segfault a lot when using linux-image-2.6.18-6-xen-amd64 under Lenny. It’s stable now.

Edit: linux-image-2.6.26-1-xen-amd64 is now available in unstable 🙂

RPM query output formatting (print your arch!)

By default, rpm doesn’t print a package’s arch when you query it with rpm -q. On a x86_64 system, you’ll see something like that:

[root@earth ~]# rpm -q libselinux
libselinux-1.33.4-5.el5
libselinux-1.33.4-5.el5

not very usefult, is it ?

To make rpm print the arch, well it’s easy, just use the –qf (–queryformat) option, with the ARCH tag:

rpm -qa --qf "%{NAME} %{ARCH}\n"

To know all the printable tags:

rpm --querytags

For example, this will give you something similar to rpm -q, but with the arch at the end of the line:

rpm -qa --qf "%{NAME}-%{VERSION}-%{RELEASE} %{ARCH}\n"
[root@earth ~]# rpm -q --qf "%{NAME}-%{VERSION}-%{RELEASE} %{ARCH}\n" libselinux 
libselinux-1.33.4-5.el5 x86_64
libselinux-1.33.4-5.el5 i386

rpmdb: Lock table is out of available object entries

source: Racker Hacker

rpm hangs after printing this error : “rpmdb: Lock table is out of available object entries”.

First, kill (-9) all hanged rpm processes. Then remove the corrupted databases, and rebuild them.

rm /var/lib/rpm/__db.*
rpm --rebuilddb

Tip: if this happens on a server, check that yum-updatesd is not running. yum-updatesd can be the source of such errors. yum-updatesd is evil. I don’t think that yum-updatesd is useful on a server anyway.
chkconfig yum-updatesd off
service yum-updatesd stop

Arkeia backup fails with “Drive is reserved”

source: support arkeia

Drive locked or reserved
Question
The backup fails with “Drive is locked”?
The backup fails with “Drive is reserved”?
Answer
Arkeia uses lock files to prevent other processes from accessing
and obtaining an Arkeia resource that is in use by a running process.
The drive defintion file also contains the PID of the Arkeia Backup
Process (arkbkp). When the PID is active, the drive is considered
locked or reserved.

CAUSE #1

The drive definition file in locked in the Arkeia Configuration

Message : drive list is locked
Message : drive master file is locked

Arkeia uses lock (.lck files), to prevent different process
from accessing the file at the same time.

CAUSE #2

The drive is reserved by an Arkeia process:

Message : Drive “drivename” is already reserved, try later ..

Arkeia processes reserves the drive in order to use it for I/O operations.
The PID of the process is added in the Drive Definition file. (ex: PID “432432”).

SOLUTIONS:

1) If the drive definition file is locked, then no other process can access this file.

To remove this lock, you must stop all running processes:

– Stop all backup and restore jobs
– Exit the Arkeia GUI
– Stop Arkeia using /opt/arkeia/bin/arkboot stop
– Kill all remaining processes
ps -ef |grep ark
kill -15 PID
– Now start Arkeia and the GUI

2) The drive is reserved by an Arkeia process:

Sometimes the drive is reserved while the process which reserved as terminated
or hung.
To correct the issue, you must remove the PID from the file.

– Check the drvxxxx.lst file for the PID
cd /opt/arkeia/server/dbase/f3drv
cat drvxxxxx/drvxxxxx.lst | grep PID
– Check the process list to see if the PID is still active.
Mormally it is arkbkp or arkrst.
ps -ef |grep ark
– kill the process if you know it is hung or not active.
– Now delete the PID line from the drvxxxxxx.lst file
– Restart Arkeia using:
/opt/arkeia/bin/arkboot stop
/opt/arkeia/bin/arkboot start

EOF

Redirecting output of the bash keyword time

time command > timelog doesn’t work, because time outputs to stderr
time command 2> timelog doesn’t work either, because time actually is a bash keyword, and it’s always run in a subshell

Redirecting the output of time can be achieved by executing the whole command in a block, then redirecting its output:
{ time command; } 2> timelog

Note: Linux also provides a time binary (/usr/bin/time), but with a different output (and might be less efficient ?)

source