Tips Linux Explorers   All Things Linux Forum   Great Linux Links   LinuxClues.com   Hometown   Email 



PCLOS .92 PERFORMANCE TWEAKS
( Only for the advanced user ! )



Our good friend Ivan ( aka Ikerekes ) did sent me some interesting tweaks for PCLos .92, but you do need a good basic knowledge of Linux before you throw yourself at it . . . but the result is certainly rewarding . . . here is the full and uncensored text:

QUOTE (Ikerekes)
A p.92 install and fine tune experience.

First of all, I am a pclos developer, specialized in hardware and the maintainer of the mklivecd set of scripts.
Painfully enough the only hardware I own a 3 year old Compaq Presario, with a VIA based KM266 mobo AMD XP2200+, 512M RAM, and 2 ATA-133 HD one is 60G the other is 120G. I have quite a few distro installed, Suse 10, Mandriva 2006, cooker, Knoppix 4, Kanotix, Mephis, Fedora FC4, Peanut, Arabian, Frugalware... Sorry I almost forgot (K)ubuntu ? - but above all PCLOS in a few flavours.

I have pre4 fully unstable upgarded with kernel 2.6.14 the oldest but the most cutting edge.

I have all kind of 8.1, 9, 9.1 upgraded with exp repo.

You can imagine the junk what I have collected, tested and not removed during the years. Although my mail directory is shared between the different partitions, and I have a huge shared area, where I am downloading iso's mirroring repos, my home directory is not shared, since I have rpm, deb, tgz, and arch based distroes, and they all like to set up the .rc files differently.

So as I used to do with winders, time to time I like to start from fresh, clear install, customize with the setup what I know I will use, and can't be without.

Today morning when the .92 showed up, I set just to do that. My current "production" install is a fully upgraded .90, but I downloaded, tested all the 4 test iso's (sent a lot's of bug report, fixes, improvements to Texstar, so I knew fairly well what I can expect).

After burning the iso, boot the livecd with the tried and trusted cheat codes,
"livecd acpi=off nolapic xres=1280x1024 splash=no" my p.92 just came up perfect.
Just a little explanations: My VIA mobo requires acpi=off nolapic, otherwise it has interrupt problems. I hate when I have to manually make my screen larger, or run XFdrake to adjust my resolution, and the splash=no because I like to see if there is anything a problem during the livecd boot.

The first order of business is to install the dkms-7174 NVIDIA rpm.
I have a Riva TNT-2 card, which is "legacy" so I can use only the legacy driver and I am lazy to reinstall the driver by hand every time I reinstall the kernel, and I do that a lot. The nicest thing about unionfs that you can install with synaptic any package while you are running off the livecd, and if you install after that to the HD, the modifications are remembered so the first time you boot form the HD it will already come with the needed NVIDIA driver. I know that Texstar plans to issue the NVIDIA, and ATI versions, where this step would be automatic, but patience is not my strong side.
The only thing worth mentioning during this step, that when you first start synaptic, you have to click on the update button to get the full package list, which is not on the CD for obvious space constraint. (The stripped source code needed by the 3-rd party drivers, on the other hand, is preinstalled).

Comes a rather un-eventful 25 minutes, until the livecd-install copies everything to my pre-allocated /dev/hdb15 and, reboot.

I always install my lilo in the beginning of the install partition, I don't trust my MBR to the livecd-install, (after all it is my code), and so the first reboot is into my "production" partition. A quick check that the newly installed pclos92 partition has all the necessary kernel and initrd links in the /boot, rerun the lilo -v and comes the moment of truth, booting into p.92.

Booting nicely, NVIDIA splash screen comes up as it supposed to, the KDM login screen has only my userid and root (guest is removed) all the passwords are working, so I can start on the customization.

The first thing is to customize the initrd. Now, that requires a little bit of explanation. The kernel, starting with 2.4 is huge, doesn't fit on a standard floppy (That's why we can't create boot floppies easily), and the number of different device drivers is growing every day. If the kernel would have all the drivers compiled in it, it would require huge amount of RAM. To minimize the footprint in the memory, all the device drivers compiled as modules, and the kernel during the boot process loads only those drivers, which absolutely necessary. The livecd during the hwdetect phase loads all and every possible drivers in order to "catch" the right device driver required by the various sata, scsi, usb devices, but unfortunately there is no sure way to tell which driver is in use, which one is just loaded but not in use yet, or which one is not needed at all, because the pc doesn't have that type of device.
After the hard disk install the first thing the loader loads (besides the kernel) an mini operating system, so small that it fits entirely in memory, that's why it is called initial ram disk, or initrd for short. This initrd has to have the necessary device drivers to mount the root (/) file system and all the programs and data it contains. If you install the livecd for example on sata, scsi, or usb hard disk, the initrd should contain the necessary sata, scsi or usb drivers. In order to not miss any, the livecd install includes all of them rather than miss some. It does this by editing the /etc/sysconfig/installkernel file's INITRDOPTS= parameter, telling which modules to include in the initrd. That has both advantages and disadvantages.
* Pro: If you latter decide to upgrade your pc's slow ide harddrive with faster scsi or sata drive, it is just plug and play, the drivers are already there.
* Cons: since you are loading a tons of drivers on every boot it is lot slower, and require more RAM, i.e. your performance suffers.
* Solution: customize the initrd.
To do this, you have edit the /etc/sysconfig/installkernel INITRDOPTS= parameter, leaving only those drivers which required.
Since I don't have no scsi, no sata, no usb HD, my installkernel is rather simple:

[root@localhost config]# cat /etc/sysconfig/installkernel
# -*- Mode: shell-script -*-
# $Id: installkernel.sysconfig,v 1.14 2004/06/29 04:50:42 prigaux Exp $
# Configuration option when installing a kernel and initrscript.

# Set this to yes if you never want link from /boot/vmlinuz to the
# kernel.
NOLINK=""

# Set this to yes if you don't want to add entry to your bootloader
NOENTRY=""

# If you want to pass options to the "make-initrd" helper script you
# can do it here.
INITRDOPTS=""

More specific examples are here:  www.pclinuxonline.com

After you customized the installkernel, you will have to regenerate the initrd.img. That's easily accomplished by reinstalling the current kernel, or installing a higher kernel.

Note: If you reinstalling the current kernel you have to delete your current initrd.img (the file the /boot/initrd.img links to) to force the installkernel script to regenerate the initrd and rerun the lilo.
I choose to install the 2.6.13-oci2 kernel, so I didn't have to delete the initrd.

The next step was PCC->System->Configure System services.
Quite logically the less nonessential services you start at the boot, faster your system will boot. How do you tell which are essential which are not?
It is easy. If you see any service with the boot checkmark and, with stopped state, it is non-essential. In my case for example hplip since I don't have any hp printer, mdadm, since I don't have any raid device, or acpi and acpid, since I boot with acpi=off. If you don't know what the service is doing the info button will give you a short explanation, but clearly if the service marked stopped with the boot checkmark, it can't be essential otherwise you would not be able to boot. Next you might want to mark some services started on boot, that's strictly your preference and it requires a little bit of research.
I marked the dkms service (since I want to recompile the NVIDIA driver if I change a kernel) and marked the sshd service, since some times I want to take over my home machine from the office.
Once this was over, I edited my /etc/fstab to automount my shared directories and my "production" pclos partitions, copied over a few directories and files from my "production" pclos, to preserve such custom setups as .mozilla directory for bookmarks and cookies, .skype directory for contact lists. kontactrc from the ~/.kde/share/config for my email setup, but not much more.

To setup the desktop to my liking is not more than a half an hour exercise, and if I redo from scratch, I know that I got a clean setup.

After reboot (that one is really fast, because I normally set my desktop to autologin my userid into KDE) the only thing remained to issue an
rpm -qa|sort>/tmp/p92.list command. Of course I had a similar command on my production pclos. BTW. this just creates a sorted list of all the rpm's installed on this system.
Using Kompare it is very easy to identify the differences between my 2 installs, and install with apt-get or synaptic, only those packages what I know I am going to use (and maybe uninstall packages what i know for sure won't use)

The result: A clean, streamlined, optimized, up to date system, ready for all the abuses, I normally inflict on my systems.



Thanks for sharing that with us Ivan !!


Bruno



PS: More tips for PCLos see: www.pclinuxonline.com/wiki


-- Dec 6 2005 --


Tips Linux Explorers   All Things Linux Forum   Great Linux Links   LinuxClues.com   Hometown   Email