Ricing up Karmic Koala

26 November 2009 in Uncategorized

Having recently upgraded to (or freshly installed) Ubuntu Karmic Koala, you’re no doubt seeking ways to improve your experience. While this release is arguably the best yet, there are still a few performance-related foibles that can be fixed by the enterprising user.

I began using Linux in Fall of 1989, and have since learned many things that help me day-to-day. Being dedicated to the community, I thought I’d share some of my knowledge, to help make Ubuntu faster and more usable than ever.

unix

Linux in the days of yore.

Let’s start with the configuration file used by the Bourne-again shell, .bashrc. As the configuration file for the most popular shell used with Linux, it plays an important part in how friendly the command line is.

The $PS1 was unveiled by Sony in 1994, achieving worldwide release in 1995. It was discontinued in early 2006, though it is still in use by a large number of Linux distributions. In order to greatly speed up the shell, you might try replacing the antiquated $PS1 with a $PS3, introduced in late 2006 and featuring a vast array of features.

To do this, open a terminal and run sed -i 's/$PS1/$PS3/g' ~/.bashrc. If you want to apply your changes immediately use source ~/.bashrc

Once you’ve done this, your shell should be running orders of magnitude faster.

A little usability tip, now. I find it to be useful to get coloured output from ls and grep, so echo -e "alias ls='ls --color=auto'\nalias grep='grep --color=auto'" > ~/.bashrc and you’ll have colour for both commands. The former may already be provided by the default Karmic Koala .bashrc. While alias duplication has never hurt anybody, output redirection often has.

On to lower-level optimizations. With the quest for lower boot times, cruft has been trimmed down. Less services are started at boot time, and in general, the boot process is highly optimized. However, nobody’s perfect, and there are number of flaws that cause the boot process to be delayed. For example, the file /boot/vmlinuz has its name not for any logical reason, (some rationalize it as the ‘z’ indicating compression, which is untrue) but instead originated as a typo which has become so ingrained that boot loader developers have had to work around it, to the detriment of boot time.

koala

Some say Ubuntu's performance is stuck up a tree.

Note that since these are low-level system modifications, they all require superuser privileges. It’s tiresome to prepend each with sudo so you might instead su root or, if you don’t have a root password set, sudo su.

Due to the slow execution speed of the boot loader, checking various locations for the Linux kernel executable delays the boot by several seconds. To remedy this, you can mv /boot/vmlinuz /boot/vmlinux and your system should boot several seconds faster, as the boot loader need not do as many heuristics.

Next, the filesystem. During boot, a number of files are accessed and modified, and the writes that the system must do to update the timestamps on these files slows the boot process. To combat this, you can use a text editor of choice (I recommend vim) to edit the fstab file, as such: vim /etc/fstab and change every instance of defaults to defaults,noatime. Noa time is a new method of time-stamping that is both more accurate and faster than regular time-stamping, using Noa units, which are directly analogous to Swatch Beats.

A very important step that many users miss is the device tree. With a generic configuration, most devices will be mounted at /dev/sd*, but this is sub-optimal for performance. What few know is that each category in the device tree is intended for a family of devices. For your benefit, here’s a list of several common device prefixes:

  • /dev/fd: Floppy and Flash drives.
  • /dev/hd: Hard disk drives and high-definition televisions.
  • /dev/lp: Line printers and vinyl records.
  • /dev/sd: Solid-state drives and Secure Digital cards.
  • /dev/tty: Cannot be mentioned in polite company.

If you wish to determine which device names your storage devices are using, run fdisk -l. If you find your hard drives are using the /dev/sd prefix, worry not! You can run a simple for loop to correct the issue: cd /dev/ && for i in sd*; do mv $i $(echo $i | sed 's/sd/hd/'); done

The loop can be modified as you see fit. Keep in mind that as hard disk drives and high-definition televisions are quite different, the shared driver for the two device families is rather generic and bloated. The hard disk’s read/write heads operate on the platters in a similar manner to a cartridge and needle reading a 12″ LP. As such, you may wish to do the following to optimize your hard disks: cd /dev/ && for i in hd*; do mv $i $(echo $i | sed 's/hd/lp/'); done

Another large performance bottleneck is the number of TTYs spawned by default. Each getty process uses up to several hundred kilobytes of memory, and given that Ubuntu spawns six by default, they can eat up a substantial portion of your resources. While no longer bleeding edge, my Thinkpad 760 ED is still formidable with its 16 MB of RAM and 133 MHz Pentium, and yet Ubuntu would waste a substantial percentage of my memory if I didn’t disable the needless TTYs.

To remove them, edit the appropriate file, vim /etc/default/console-setup and change line seven’s range from"/dev/tty[1-6]" to "/dev/tty[1-2]", and then rm /etc/event.d/tty{3..6}.

As any experienced user knows, all the great things in the world run on steam: Locomotives, kettles, the majority of ships from the 19th to 20th century, and, of course, politicians. For this reason, it’s highly recommended to install sl, a package available in the Universe repository, as it provides an adequate quantity of steam.

Congratulations! If you’ve made it this far, you now have a highly-optimized system and are ready to impress your friends with the responsiveness of your computer.

Lastly, a bit of inspirational prose:

Sudo or do not, there is no
-bash: try: command not found

  • Share/Bookmark
26 November 2009 Uncategorized

13 Comments to Ricing up Karmic Koala

  1. Hahaha this is hilarious. Thanks for the lulz.
    I don’t think Ubuntards will get the joke though!

  2. luser on 26 November 2009
  3. Though i have lot of things to ask, the very first thing is:

    “checking various locations for the Linux kernel executable delays the boot by several seconds.”

    – How are ensuring that, this is searched for several seconds in each boot ?! Is there any proof in official websites ?!

  4. sathiya on 27 November 2009
  5. I’m pretty sure a similar post to ubuntuforums.org would have got you banned for violating:

    don’t post dangerous commands or instructions not even for fun – IT’S NOT FUNNY.

    I’m a computer illiterate and only b/c someone who linked to this said it was satire did have an inkling you were making a joke.

    @luser

    You’re probably right – let’s make them destroy their computers, they’re stupid, they deserve it. After all, they did it themselves we’re not to blame.

    Reminds of fun with the SET command in the good old dos days:

    SET f=”format c:”
    SET n=y
    SET y=n

    You know the joke succeeded when your friend, after distinctly saying ‘no’ to

    ‘Will now format c: [y/n]?’

    Is greeted with

    ‘c: successfully formatted’

  6. leeees on 27 November 2009
  7. Haha, the backlash at this is hilarious.

    If you can’t rub two brain cells together and notice glaring factual errors like “/dev/lp: Line printers and vinyl records.” and the screenshot of BSD, you deserve the results of blindly running commands.

  8. foobarnix on 27 November 2009
  9. You missed a trick: if you’re going to go to all that effort upgrading your $PS1 to $PS3, why even bother loading X? In fact, just “sudo apt-get remove xorg” and you’ll see whole orders of magnitude of improvement in boot time!

  10. col on 27 November 2009
  11. Maybe add a warning label to this post?

    “If you can’t rub two brain cells together and notice glaring factual errors like “/dev/lp: Line printers and vinyl records.” and the screenshot of BSD, you deserve the results of blindly running commands.”

    Most of the destructive commands are before the parts of very obvious satire. also the screenshot isn’t that obvious. nobody deserves to be punished for innocent ignorance.

  12. austin on 27 November 2009
  13. Linux in 1989?? Really?

  14. dan on 30 November 2009
  15. Just wondering, aside from the sillified explanation, isn’t mounting with noatime considered pretty decent advice?

  16. Noam Samuel on 5 December 2009
  17. This is awesomely dangerous advice. Now I know which website I’ll _not_ be recommending to my friends. I can’t believe I started reading thinking this was a serious article. I only worry for the day when this website makes a frontpage on google.

  18. You're NOT funny. on 6 December 2009
  19. The thing that really sucks about this is that you could actually be a useful person. You’re obviously intelligent. The problem is that you’re an elitist prick.

    I’m an Ubuntu user and I could hardly call myself a retard. I’ve lately been ricing my 10.04 installation (boot processes, kernel tweaking, etc.). And making it more secure.

    I have a hunch you already know how to do a large majority of what I’m already doing.

    BTW: I actually do have a system that only has 8MB RAM and it runs perfectly well with Ubuntu 10.04 with a GUI and all my tools.

  20. MTecknology on 8 January 2010
  21. Oh dear, you are really desperate.

    I’m wondering – why ‘ubuntard’, since ‘bastard’ is much more precise?

  22. Nikolay on 20 February 2010

Leave a comment






Subscribe to receive your Secret Decoder Ring!

Follow our Twats



No WWW - For a better web

Subscribe
  • Steve:
    I stumbled onto this blog while reading some of my normal "news" regarding the L...
  • Kris Gesling:
    Sorry but I just to join the campaign for reason and logic but I couldn't stand ...
  • Amy:
    haha.. Well. Good to see that ya're finally up and running again. :D And i prom...
  • Steve:
    Having personally given up on any kind of volunteering in 2006 it should be note...
  • forkbomb:
    I've given up on editing Wikipedia excepting those occasional situations where I...