Explination of Linux Run Levels

terminal-glossy.jpg

Many people get confused when trying to boot in to a runlevel other than runlevel 5, for example runlevel 3, disabiling the GUI front end with which most users are familiar. Hopefully this howto will help answer the questions “How do I disable X” or “How do I boot without X” or even “How do I get to single user mode.”

Requirements

One requirement of this document is to have an understanding of what runlevels are, how changing runlevels will impact your system, and what services may or may not be started. In general this is beyond the scope of this document but I will give a quick run down of things as listed in /etc/inittab.

Mode Directory Description
0 /etc/rc.d/rc0.d Halt
1 /etc/rc.d/rc1.d Single-user mode
2 /etc/rc.d/rc2.d Not used (user-definable)
3 /etc/rc.d/rc3.d Full multi-user mode (no GUI interface)
4 /etc/rc.d/rc4.d Not used (user-definable)
5 /etc/rc.d/rc5.d Full multiuser mode (with GUI interface)
6 /etc/rc.d/rc6.d Reboot

As you can see you use runlevels everytime you shutdown (runlevel 0) or reboot (runlevel 6) your machine. Most users boot to runlevel 5 with X11 support and a GUI login. Some however, boot to Full multiuser mode (runlevel 3) and may choose to “startx” manually once logged in. Single user mode (runlevel 1) can be very handy if you have forgotten your root password or are having trouble booting for any number of reasons. Full multi user mode (runlevel 3) is desirable when you are having trouble with X11 and would like to repair your xorg configuration or when running a server where you do not want the added overhead of having X running.

Editing /etc/inittab to change your default runlevel

  1. Open /etc/inittab in your favorite editor (I use nano).
    su -c 'nano -w /etc/inittab'
  2. On about line 18 you will see a line like the one shown below.
    id:5:initdefault:
  3. You simply change the “5″ in this case to the runlevel you desire. Save the file and exit.

Changing your current run level

  1. You can change runlevels using the telinit or init commands as in the example below.
    su -c 'telinit 3'

No Posts Found

Comments are closed.