How to increase your linux system loading speed
February 28th, 2007 mysurface Posted in Admin, Misc, runlevel | Hits: 15604 | 1 Comment »
Linux can be run on various run level, for run level 0 is shutdown, and run level 6 is restart and usually run level 1 is single user linux.
By default, fedora and red hat will running run level 5 and Ubuntu is running 2. By knowing what run level of your linux distro init, you can further tweak your system by stopping wanted services. The easiest way is to manipulate the symlinks in /etc/rcX.d, where ‘X’ is your default run level. For the case of Ubuntu, it is /etc/rc2.d.
Thats why to shutdown my system, I can do
sudo init 0
In /etc/rcX.d, it contains symlinks looks as bellow:
K19hplip S11klogd S20powernowd S91apache2
K20festival S13gdm S20rsync S98noip2
K20nvidia-kernel S19cupsys S20samba S98usplash
K20wifi-radar S19mysql S20ssh S99acpi-support
They are all symlinks, the real scripts contain in /etc/init.d. S indicate the service will be loaded during initialization of your system, and K indicate Kill, means stop service. So, the simple hack is changing the file name from S to K
Let say I would like to turn off apache from loaded during startup, I do
sudo mv {S,K}91apache2
Turn it on back,
sudo mv {K,S}91apache2
Okay, we cannot assume we are running on run level 2 or 5. It must be a way to know what run level we are running. Check out /etc/inittab
You will find a line show as bellow, which indicate that your default run level is 2.
id:2:initdefault:
But, Eh! WTF, why Ubuntu Edgy do not have inittab?!! How am I suppose to know what run level am I running now?
Ubuntu Edgy abandon the convention way of manipulate run level but replace with upstart.
To know what is your previous and current run level if your system uses upstart, type
runlevel
The output:
N 2
First column indicate the previous run level, N means None. Follow by current run level, which is 2.







August 2nd, 2008 at 1:57 pm
[...] How to increase your linux system loading speed Linux can be run on various run level, for run level 0 is shutdown, and run level 6 is restart and usually run level 1 i… [...]