Ubuntu 9.04 (Jaunty Jackalope) customized for performance on a Nexoc Osiris E705III (Clevo M570RU-U) laptop
Ubuntu 9.04 (Jaunty Jackalope) customized for performance on a Nexoc Osiris E705III (Clevo M570RU-U) laptop
I am going to describe how I have customized Ubuntu in my notebook in order to make it faster and more responsive.
I like Debian because of its fantastic package manager and the many thousands of precompiled packages and I like Ubuntu because of the fact that most hardware is configured out-of-the-box (or nearly).
However, when I installed the beta version of Ubuntu 9.04 (Jaunty Jackalope) on my Nexoc Osiris E705III (Clevo M570RU-U) laptop, I encountered a very serious bug.
To make a long story short, the file system is labeled as read-only and when updating the kernel via Synaptic and the system becomes unusable. Apparently, this bug is specific to the 64-bit Jaunty kernel 2.6.28-11 and it only pertains to certain hardware configurations. The problem is solved by letting fsck run upon reboot and accepting all changes. Apparently the bug has not yet been fixed as for April 25 2009, one day after the official release of the stable version. An alternative solution proposed in the bug track system comments is compiling from source the Linux kernel 2.6.29.1 (the latest at the time of this writing). This is what I actually did.
In addition to building the kernel, I have also installed LXDE Desktop Environment and performed a few other tweaks which, together, render the system very stable, faster and more responsive.
In general, the steps I followed are mutually independent and therefore can be performed separately.
This post was written only for me to remember what I did, if you decide to follow these instructions, please, be aware that you are doing it at your own risk.
STEPS:
1) Compilation of the 2.6.29.1 kernel
2) Installation of the proprietary NVIDIA drivers
3) Tuning swappiness
4) Installing the prerelease 64-bit version of the Adobe Flash Player plugin
5) Installing the LXDE Desktop Environment
Compilation of the 2.6.29.1 kernel (adapted from this blog)
1. Download the full kernel (2.6.29.1 at the time of this writing): # wget -c http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.29.1.tar.bz2
2. # sudo -i
3. $ apt-get install build-essential kernel-package ncurses
4. $ mv linux-2.6.29.1.tar.bz2 /usr/src/
5. $ cd /usr/src
6. $ tar xvfj linux-2.6.29.1.tar.bz
7. $ ln -s linux-2.6.29.1 linux
8. $ cd linux
9. $ cp /boot/config-2.6.28-11-generic .config (we wil use your existing working configuration as a basis for building the new kernel)
10. $ make menuconfig
11. General setup –> change from SLUB to SLAB – Choose SLAB allocator (SLAB).
12. Processor type and features: uncheck Tickless System (Dynamic Ticks), set Processor family (mine is Core 2), set Preemption model to Preemptable kernel (Low Latency desktop), set Timer frequency (1000 Hz).
13. Exit and save the new .config file
14. $ make-kpkg clean
15. $ make-kpkg –append-to-version=-vanilla kernel_image –initrd binary (”-vanilla” is descriptive text only, you can change it or leave it out entirely). This will take a while.
16. $ cd .. (go up one directory to where the new files are after compiling is completed)
17. $ dpkg -i linux-image-2.6.29.1*.deb linux-headers-2.6.29.1*.deb (installs the kernel and modules)
18. $ update-initramfs -u
19. Now you can reboot into your new kernel. However, if you had previously installed the proprietary NVIDIA drivers, you will be better off downloading the latest version, as explained below, before rebooting.
As I had previously installed the NVIDIA proprietary drivers for the old kernel, I see some configuration errors at stage 17 and 18, due to the fact that the package manager can not install the NVIDIA modules for the new kernel. You can ignore them.
Installation of the proprietary NVIDIA drivers
1. I downloaded the drivers from the NVIDIA website. In my case: # wget -c http://us.download.nvidia.com/XFree86/Linux-x86_64/180.51/NVIDIA-Linux-x86_64-180.51-pkg2.run (keep in mind that I have installed the x86_64 version of Ubuntu)
2. Then I rebooted into the new kernel.
3. If the X-server is not longer working, do not worry and go to a console. If it is, go to a console anyway by pressing CTRL+ALT+F1
4. # sudo -i
5. In order to prevent possible conflicts I removed the NVIDIA modules: $ apt-get remove nvidia*
6. $ /etc/init.d/gdm stop
7. Cd into the directory where you have downloaded the NVIDIA drivers to
8. $ sh ../NVIDIA-Linux-x86_64-180.51-pkg2.run (and follow the instructions, I answered “yes” to all the questions)
9. Reboot
Tuning swappiness
I will reduce swappiness to 15, which means that swap memory (slow for it is in the hard drive) will only be used when 85% or more of the RAM is in use.
1. # sudo gedit /etc/sysctl.conf (add the line “vm.swappiness = 15″ and save the file)
2. # sudo swapoff -a
3. # sudo swapon -a
Installing the 64-bit prerelease version of the Adobe Flash Player plugin
1. If you had already installed the 32-bit plugin and you have a 64-bit OS, you can remove it: # sudo apt-get remove nspluginwrapper
2. Download the new plugin: # wget -c http://download.macromedia.com/pub/labs/flashplayer10/libflashplayer-10.0.22.87.linux-x86_64.so.tar.gz
3. # tar zxvf libflashplayer-10.0.22.87.linux-x86_64.so.tar.gz
4. # mkdir ~/.mozilla/plugins
5. # mv libflashplayer.so ~/.mozilla/plugins/
6. Restart Firefox
This will only install the plugin for Mozilla-based browsers and the current user. If you wish, you can also install it system-wide for all users.
Installing the LXDE Desktop Environment
Gnome and KDE are very nice, but the are becoming bigger and bigger. If you want or need a really lighter desktop environment, LXDE can be a good choice. It is not as fashionable and fully-featured as the main stream desktops are, but it is faster and requires less resources, which may be crucial for low-end and old systems.
1. Install LXDE: # sudo apt-get instal lxde
2. LXDE has its own network manager (lxnm), however, installation of lxnm currently requires uninstallation of the Gnome network manager. If, provisionally or definitively, you prefer to keep using the Gnome network manager, do not install lxmn and just make the Gnome network manager available for LXDE # sudo gedit /etc/xdg/autostart/nm-applet.desktop (change the line “OnlyShowIn=GNOME;XFCE” to “OnlyShowIn=GNOME;XFCE;LXDE” and save).
3. You can now logout and choose an LXDE session before logging in again
UPDATE:
I have just compiled the 2.26.29.2 kernel with additional configuration options from:
http://izanbardprince.wordpress.com/2009/03/26/how-to-fix-ubuntu-jaunty-warning-hacks-ahead/
NOTE: I am now running 2.26.30.
If you follow the pulseaudio instructions from that blog, do not forget to add the concerned users to the relevant pulseaudio groups and install the required packages as explained here:
https://wiki.ubuntu.com/PulseAudio
NOTE: I do not recommend PulseAudio.
Regarding performance, I forgot to mention that when I originally installed Jaunty, I created three primary ext4 partitions (plus extended swap):
1) /
2) /home
3) /home/username/apps
The third partition is for resource-intensive applications which may render the system slow if installed in the root partition and/or for programs which make a very intensive use of the hard-drive.
Yay! You fixed my Nvidia – thank you
Jaunty upgrade broke it.
I’m having a problem on Intrepid 64 with the above procedure – the apt-get says that ncurses package doesn’t exist.
of course, the makeconfig doesn’t work without the ncurses package
try
# sudo apt-get install ncurses-base ncurses-bin
in any case I think there is an X version of makeconfig which does not need ncurses.
thanks – this worked perfectly.
I, however, have now encountered another problem:
test ! -f Makefile || \
/usr/bin/make ARCH=xen distclean
make[2]: Entering directory `/usr/src/linux-source-2.6.27′
Makefile:528: /usr/src/linux-source-2.6.27/arch/xen/Makefile: No such file or directory
make[2]: *** No rule to make target `/usr/src/linux-source-2.6.27/arch/xen/Makefile’. Stop.
make[2]: Leaving directory `/usr/src/linux-source-2.6.27′
make[1]: *** [real_stamp_clean] Error 2
make[1]: Leaving directory `/usr/src/linux-source-2.6.27′
make: *** [CLN-common] Error 2
The above happens when I try to clean/build the new kernel (make-kpkg). The kernel sources were downloaded using synaptic (I’m just trying to optimize my current kernel on Intrepid).
Now, I know I’m asking a lot of newbie questions. Please, have patience and thanks for your help
I am not sure to understand what you are trying to do. It seems you are trying to build the 2.6.27 xen kernel under Ubuntu Jaunty? If so, what for?
The kernel I compiled was this one:
http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.29.2.tar.bz2
Hi!
I solved all the issues with your hint above regarding the ncurses. Then I, instead of trying to use the packages from ubuntu for compilation (the sources from synaptic), I used your method, described above (wget).
Yaaay, it works
:D
Thanks!!!
Hey, when I get to the step: tar xvfj linux-2.6.29.1.tar.bz (btw I assume you just forgot the “2″ here) the console goes crazy and lists hundreds of errors.
They all mostly look like some variation of this:
“linux-2.6.29.1/virt/kvm/ioapic.c
tar: linux-2.6.29.1/virt/kvm/ioapic.c: Cannot open: No such file or directory
linux-2.6.29.1/virt/kvm/ioapic.h
tar: linux-2.6.29.1/virt/kvm/ioapic.h: Cannot open: No such file or directory
linux-2.6.29.1/virt/kvm/iodev.h
tar: linux-2.6.29.1/virt/kvm/iodev.h: Cannot open: No such file or directory”
Do you know what the problem is?
Thanks!
I have not clue. Maybe the downloaded file is corrupted or not complete. Try downloading it again with “wget -c” and see what happens. I am running linux-2.6.29.3 now and it is fine. 2.6.29.4 is now the stable version. You may want to try that one:
wget -c http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.29.4.tar.bz2
Hi
15. $ make-kpkg –append-to-version=-vanilla kernel_image –initrd binary
this command gives me errors. What should I put there? I am trying to install kernel 2.6.29.4 in ubuntu 9.04 on my laptop. Current version of kernel is 2.6.28.12
Sotiris:
The problem is that this stupid WordPress converts — (two hyphens) into a long hyphen):
make-kpkg –append-to-version=-vanilla kernel_image –initrd binary
There are two hyphens before “append-to-version” and before “initrd”. In general, everywhere you see a long hyphen, there should be two hyphens.
Hi,
So I managed to update the kernel thanks to your tutorial, but now I keep running into a small “error” everytime I update or install a package via synaptic. It seems to be harmless, but it is annoying. I get this popup everytime: “An error occured: E: linux-image-2.6.29.4-vanilla: subprocess post-installation script returned error exit status 2″
And if I look into the terminal, this always seems to be the common part:
Processing triggers for menu …
Errors were encountered while processing:
linux-image-2.6.29.4-vanilla
E: Sub-process /usr/bin/dpkg returned an error code (1)
A package failed to install. Trying to recover:
Setting up linux-image-2.6.29.4-vanilla (2.6.29.4-vanilla-10.00.Custom) …
Running depmod.
Finding valid ramdisk creators.
Using mkinitramfs-kpkg to build the ramdisk.
initrd.img(/boot/initrd.img-2.6.29.4-vanilla
) points to /boot/initrd.img-2.6.29.4-vanilla
(/boot/initrd.img-2.6.29.4-vanilla) — doing nothing at /var/lib/dpkg/info/linux-image-2.6.29.4-vanilla.postinst line 588.
vmlinuz(/boot/vmlinuz-2.6.29.4-vanilla
) points to /boot/vmlinuz-2.6.29.4-vanilla
(/boot/vmlinuz-2.6.29.4-vanilla) — doing nothing at /var/lib/dpkg/info/linux-image-2.6.29.4-vanilla.postinst line 588.
Running postinst hook script update-grub.
Searching for GRUB installation directory … found: /boot/grub
Searching for default file … found: /boot/grub/default
Testing for an existing GRUB menu.lst file … found: /boot/grub/menu.lst
Searching for splash image … none found, skipping …
Found kernel: /boot/vmlinuz-2.6.29.4-vanilla
Found kernel: /boot/vmlinuz-2.6.28-11-generic
Found kernel: /boot/memtest86+.bin
Updating /boot/grub/menu.lst … done
Examining /etc/kernel/postinst.d.
run-parts: executing /etc/kernel/postinst.d/dkms
run-parts: executing /etc/kernel/postinst.d/nvidia-common
run-parts: /etc/kernel/postinst.d/nvidia-common exited with return code 20
Failed to process /etc/kernel/postinst.d at /var/lib/dpkg/info/linux-image-2.6.29.4-vanilla.postinst line 1186.
dpkg: error processing linux-image-2.6.29.4-vanilla (–configure):
subprocess post-installation script returned error exit status 2
Errors were encountered while processing:
linux-image-2.6.29.4-vanilla
Yes. This issue is explained above:
“As I had previously installed the NVIDIA proprietary drivers for the old kernel, I see some configuration errors at stage 17 and 18, due to the fact that the package manager can not install the NVIDIA modules for the new kernel. You can ignore them.”
The solution is also explained above. A bit more in detail:
1) Download the latest drivers for your card. It seems you have an NVIDIA card. For mine they are NVIDIA-Linux-x86_64-185.18.14-pkg2.run at the time of this writing.
2) Go to a console by pressing CTRL+ALT+F1 and login.
3) # sudo -i
4) In order to prevent possible conflicts I removed the NVIDIA modules: $ apt-get remove nvidia*
5) Stop gdm: $ /etc/init.d/gdm stop
6) Cd into the directory where you have downloaded the NVIDIA drivers to
7) $ sh ../NVIDIA-Linux-x86_64-185.18.14-pkg2.run (The name of the file may be different in your case. Follow the instructions, I answered “yes” to all the questions)
8 ) $ reboot
Hi
Thanks for the tutorial. I’m upgrading from default jaunty install to 2.6.30 kernel from kernel.org.
Everything went fine until step 18 dpkg -i which is throwing an error.
here is the relevant output. This is from the second time I ran it.
——-# dpkg -i linux-image-2.6.30-vanilla_2.6.30-vanilla-10.00.Custom_amd64.deb
(Reading database … 210135 files and directories currently installed.)
Preparing to replace linux-image-2.6.30-vanilla 2.6.30-vanilla-10.00.Custom (using linux-image-2.6.30-vanilla_2.6.30-vanilla-10.00.Custom_amd64.deb) …
Done.
Unpacking replacement linux-image-2.6.30-vanilla …
Running postrm hook script /sbin/update-grub.
Searching for GRUB installation directory … found: /boot/grub
Searching for default file … found: /boot/grub/default
Testing for an existing GRUB menu.lst file … found: /boot/grub/menu.lst
Searching for splash image … none found, skipping …
Found kernel: /boot/vmlinuz-2.6.30-vanilla
Found kernel: /boot/vmlinuz-2.6.28-11-generic
Found kernel: /boot/memtest86+.bin
Updating /boot/grub/menu.lst … done
Setting up linux-image-2.6.30-vanilla (2.6.30-vanilla-10.00.Custom) …
Running depmod.
Finding valid ramdisk creators.
Using mkinitramfs-kpkg to build the ramdisk.
Not updating initrd symbolic links since we are being updated/reinstalled
(2.6.30-vanilla-10.00.Custom was configured last, according to dpkg)
Not updating image symbolic links since we are being updated/reinstalled
(2.6.30-vanilla-10.00.Custom was configured last, according to dpkg)
Running postinst hook script update-grub.
Searching for GRUB installation directory … found: /boot/grub
Searching for default file … found: /boot/grub/default
Testing for an existing GRUB menu.lst file … found: /boot/grub/menu.lst
Searching for splash image … none found, skipping …
Found kernel: /boot/vmlinuz-2.6.30-vanilla
Found kernel: /boot/vmlinuz-2.6.28-11-generic
Found kernel: /boot/memtest86+.bin
Updating /boot/grub/menu.lst … done
Examining /etc/kernel/postinst.d.
run-parts: executing /etc/kernel/postinst.d/dkms
run-parts: executing /etc/kernel/postinst.d/nvidia-common
run-parts: /etc/kernel/postinst.d/nvidia-common exited with return code 20
Failed to process /etc/kernel/postinst.d at /var/lib/dpkg/info/linux-image-2.6.30-vanilla.postinst line 1186.
dpkg: error processing linux-image-2.6.30-vanilla (–install):
subprocess post-installation script returned error exit status 2
Errors were encountered while processing:
linux-image-2.6.30-vanilla
——
any ideas?
emk
OK I seem to have forgotten to install the headers in step 17
emk
Edward: Yes, in addition what you see is the nvidia drivers problem as explained above (in the post and in the comments). This happens because you installed the nvida drivers for the Ubuntu kernel via apt-get (aptitute, synaptic, restricted drivers manager or whatever you used). When you install the vanilla kernel, dpkg tries to install the nvidia drivers for that kernel but it does not know how. Hence the error. The solution I found is uninstalling all the nvidia packages and install the drivers manually as explained before.
Hey,
So I followed your steps again by manually installing NVIDIA, but I still get these errors…any ideas?
I removed all nvidia stuff and the errors appear to be gone. y laptop has no nvidia soI did not have to reinstall them. However when I removed the nvidia stuff I had to do a purge.
sudo apt-get remove –Purge nvidia*
thanks
emk
Pingback: Back to good old Debian « Koroshiya Itchy
Pingback: #! CrunchBang Linux « Koroshiya Itchy
Pingback: KANOTIX 64 bit « Koroshiya Itchy