Grosstadtgeflüster

Depois de um longo tempo sem novos posts de música segue mais uma ótima alternativa de banda alemã…
Uma ótima mistura de música eletrônica com rock alternativo de primeira! Recomendo a todos!

LVM em Red Hat Kickstart

Normalmente ao preparar um esquema de particionamento para um kickstart utilizamos diretamente partições primárias e/ou extendidas no disco, porém é possível fazer todo o preparo diretamente com a utilização de LVM de uma forma bem simples e prática.

Considere o esquema de particionamento abaixo:

Não LVM:
/boot – 128MB

LVM:
/ – 10GB
/home – 20GB
/var – 35GB
swap – 8GB

As entradas no kickstart para limpar a tabela de partições e aplicar o esquema acima serão as seguintes:

clearpart –all
part /boot –fstype ext3 –size=128
part pv.4 –size=0 –grow
volgroup VolGroup00 pv.4
logvol / –fstype ext3 –name=root –vgname=VolGroup00 –size=10240
logvol /home –fstype ext3 –name=usr –vgname=VolGroup00 –size=20480
logvol /var –fstype ext3 –name=var –vgname=VolGroup00 –size=35840
logvol swap –fstype swap –name=swap –vgname=VolGroup00 –size=8192

Caso você queira fixar a partição /boot em um determinado disco (por exemplo /dev/sda) é possível adicionando a opção “–ondisk=sda” na linha referente ao /boot. A opção –grow especificada ao criar o pv (phisical volume) informa que todo o restante do disco será utilizado para o LVM.

Mais informações sobre opções disponíveis para kickstart podem ser encontradas na documentação oficial Red Hat.

VirtualBox running Red Hat Guests

Recently I was using a Red Hat guest on my notebook’s VirtualBox, but with the VM started I noticed that one of my 2 core processor was lost, getting 60% to 100% of CPU load with the guest system totally idle. While testing the same VirtualBox with a Debian and an ArchLinux guest (simultaneously), the processor usage didn’t beat 10% of processor use with the guests idle.

Looking for some information on VirtualBox forums and on CentOS bugtracker, I found some information that shows up how to solve this problem in a very simple way, just changing the default divider kernel parameter to 10 (adjusting the system clock rate to 100Hz) directly at boot time.

Note: Since Red Hat Enterprise Linux 5.1 / CentOS 5.1 the default system clock rate that is set to 1000Hz and can be changed at boot time, with no need to recompile you kernel, remember that Xen guests don’t need the system clock rate to be modified because they already have a 250Hz kernel.

For those that are not familiar changing kernel parameters, just edit your grub menu.lst file (usually /boot/grub/menu.lst), add divider=10 in the end of the kernel line and reboot your system.

Ps. Sorry for the long time without new posts… Now I’m back!

Python-MySQLdb Upgrade Problem

Recently I got an error while running some Python scripts on a Red Hat Enterprise Linux 3, specifically when importing the MySQLdb module, with the the following error:

ImportError: cannot import name ImmutableSet

After some research I found that when upgrading the module to version 1.2.1 (or newer) the file sets.py, that was used on 1.2.0 or prior versions, still on system and this doesn’t contain ImmutableSet that’s defined as a default bult-in set in the recent versions of MySQLdb.

To solve this problem (tested on Python 2.4 and 2.6) just remove the sets.py from your MySQLdb installation directory.

Changing Gnome Panel Font Color

Sometimes we want to create or change the Gnome panel background color, but when we use a dark or black background is quite dificult to see the fonts at the main menu and clock for example. To solve this problem, we can simple change the panel font colors directly editing the .gtkrc-2.0 file in our home directory:

luizxx@Revy ~ $ vi .gtkrc-2.0

Then add the following lines to your file:

style “modpanel”
{
fg[NORMAL] = “#FFFFFF”
}
widget “*PanelWidget*” style “modpanel”
widget “*PanelApplet*” style “modpanel”
widget “*fast-user-switch-applet*” style “modpanel”

Now you can logout and logon to activate the changes, or you can simply reload the panel with:

luizxx@Revy ~ $ killall gnome-panel

Note that you can change the fg[NORMAL] value to any color you want to use, from #000000 to #FFFFFF.