SysVinit/runlevels

From ArchWiki
< SysVinit
Revision as of 16:58, 20 October 2009 by Bubla (Talk | contribs) (created list of runlevels and how to enter them during bootup)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

If something goes wrong with your Arch setup in such way that you are completely helpless when the system boots up, you may need this.

For example, if you use some deffective display drivers, the system may freeze when the X server starts. If you have a display manager in your startup daemons list, you need to take full control of your system before that daemon starts.

And how do you do that?

What you need is called "booting to another runlevel". This basically determines in what state the system will be when the boot sequence terminates. Normally you finish in the multi-user mode with all daemons started (=runlevel 3).

List of Arch runlevels

And what are the possible runlevels?

  • 1: Single user (maintainance mode): You want to use this one if you have problems.
  • 3: Multi user: Normal mode
  • 5: Multi user with X11: The same as 3?
  • 0: Halt
  • 6: Reboot
  • 2, 4: Not used

Take a look to "/etc/inittab" to see how it works.

Runlevel invocation

You specify what runlevel you would like to enter on the kernel commandline. You just have to pass the number of the desired runlevel as an option on that commandline, so it may look like this if you are in trouble and you want to use single user mode (only the last number is important here :-)

linux /vmlinuz26 ... root=/dev/sda2 ro 1

And yes, in a case when you can't boot, you will have to append the runlevel number to the the kernel command line in the boot manager during bootup.

Other distros

Runlevels exist in all Linux distributions, but they are generally different. Generally the runlevel 1 is usually single-user "emergency mode"