This wide- and large- screen layout may not work quite right without Javascript.

Maybe enable Javascript, then try again.

Home Fiddling with PCs

Single User Mode



"Single user mode" can be useful for self-maintenance of Unix-derived systems (e.g. Linux), when very occasionally the automatic maintenance procedures don't do their job. But it's often rather murky exactly what "single user mode" really means, how to invoke or enter it (is a boot required?), and what specifically to use it for. Redhat/Fedora/CentOS distributions of Linux have attempted to clarify the situation, partly by introducing some new terminology.

Historical Unix Runlevels

The original Unix booted up in stages ...and could return back down to any of these stages. The stages were called "runlevels" (sometimes colloquially also called "modes"). Bootup went through most of these stages in sequence, as specified by the instructions /etc/inittab and under the directory /etc/rc.d. Stages could be returned to with the init command. Originally there were eight stages, named s(ingle), 0, 1, 2, 3, 4, 5, and 6. Runlevels 0 and 6 merely specified transitional states; Runlevel 0 was on the way to a system "halt", and Runlevel 6 was on the way to a system "restart"; these two runlevels were not used for normal operation, nor were they part of the bootup sequence.

Almost as soon as the original Unix was distributed, users began expressing unhappiness with the single runlevel, typically desiring it to be password-protected. Unix responded by subdividing the single runlevel into two. One subflavor of single was available only at bootup and required entry of the root password in order to enter commands at the console. The other subflavor of single was available via the init command and pretty much matched the original single runlevel. Sometimes some attempt was made to distinguish the two subflavors by letter case (s vs. S).

Calling the two sub-runlevels by the same name (single) was of course confusing. But since only a few administrators were ever expected to use either sub-runlevel, the confusing terminology didn't seem like a big deal.

Modern Unix-derived Runlevels

Modern Unix-derived systems, such as the various distributions of Linux, typically have only a few meaningful runlevels, for example

So modern Unix-derived systems typically use only some of the runlevels and ignore the rest. Runlevel 0 is still used to specify a "halt" and runlevel 6 is still used to specify a "restart".

Modern Unix-derived systems brought even wider divergence to the two sub-runlevels of single (not only password required or not, but also root partition mounted read-only or read-write, and other disk partitions mounted or not). In many cases the confusion continued (or even worsened).

Redhat/Fedora/CentOS Single and Emergency Runlevels

Redhat-Fedora-CentOS has attempted to clarify the situation by elevating the sub-runlevels to full runlevels and giving them different names. In these systems, the runlevels are now Emergency, S(ingle), 0, 1, 2, 3, 4, 5, and 6. From the point of view of the init command, the runlevels are S(ingle), 0, 1, 2, 3, 4, 5, and 6 as always. The emergency runlevel is avalable only at bootup. The init command knows nothing about it, and there's no way to return to it.

In Redhat-Fedora-CentOS systems, the single runlevel is not password-protected, and has all disk partitions mounted read-write. The emergency runlevel, used for some very low-level maintenance operations such as correcting disk errors, is password-protected, and has only the root disk partition mounted (and even that only read-only). (Unlike many Unix-derived systems, for repairing a disk either emergency mode or a separate boot system is needed; what's called single mode will not work for repairing a disk on a Redhat/Fedora/CentOS system.) Both modes rejoin the normal boot sequence when the user logs out (^D), rather than by using either the init or the mount commands or physically rebooting.

Using Single and Emergency Runlevels

While neither single nor emergency runlevels are used in routine operation, or even for routine recovery from an abrupt shutdown (such as a power outage), they may be helpful for performing some maintenance procedures. Often an easy way to perform such maintenance procedures is to boot a completely different OS, then access the system that needs maintenance from the alternate OS. This booting of a different OS is typically done with a LiveCD. However sometimes it's easier to just use the same OS to perform maintenance on itself. Self-maintenance is the purpose of single and emergency runlevels.

The emergency runlevel is particularly useful, as it allows disk partitions that remain problematic -even after the the automatic mechanisms have tried to handle the issue- to be repaired or replaced without booting a separate OS. The single runlevel may be less useful for modern Unix-derived systems, especially those which have only one terminal for only one user anyway, and particularly since system daemons (continuously running background processes) can be stopped and started individually anyway.

Booting To Runlevel: Single

  1. Turn on the Redhat/Fedora/CentOS system PC
  2. Watch while any diagnostics configured by the BIOS run (depending on your BIOS configuration, this may take anywhere from no time at all to over a minute)
  3. The screen will go totally black for a couple seconds
  4. The word GRUB will appear at the top left of the screen
  5. A boot selection screen will begin to display
  6. Press the ESC key
  7. The boot selection screen will finish displaying, and the cursor will be on the line specifying which OS to boot (probably the first and only data line)
  8. Press the e key
  9. Another boot selection screen will display, this one with three lines
  10. Press the down arrow key (so the cursor is on the middle line that says kernel)
  11. Press the e key again
  12. Type a blank (spacebar, to separate new parameter from old)
  13. Type the full word single
  14. Press the Enter key
  15. Press the b key
  16. Wait while system boots up to the single runlevel and logs you in
  17. Perform necessary mid-level maintenance that must be done while no GUI is active, no other users have ever logged on, and the system "daemons" (continuously running background processes) have not been started yet
  18. At the prompt press the ^D key to logout
    (do not attempt to use mount -o remount ... as you would in some other Unix-derived systems)
  19. Wait (several tens of seconds?) while the system boots up all the way

The single runlevel is also accessible from a running system without rebooting, by using the init s command. The intention is the single runlevel will behave exactly the same whether it's entered from bootup or from the init command; however there's always some possiblity this won't actually be the case.

Booting To Runlevel: Emergency

  1. Turn on the Redhat/Fedora/CentOS system PC
  2. Watch while any diagnostics configured by the BIOS run (depending on your BIOS configuration, this may take anywhere from no time at all to over a minute)
  3. The screen will go totally black for a couple seconds
  4. The word GRUB will appear at the top left of the screen
  5. A boot selection screen will begin to display
  6. Press the ESC key
  7. The boot selection screen will finish displaying, and the cursor will be on the line specifying which OS to boot (probably the first and only data line)
  8. Press the e key
  9. Another boot selection screen will display, this one with three lines
  10. Press the down arrow key (so the cursor is on the middle line that says kernel)
  11. Press the e key again
  12. Type a blank (spacebar, to separate new parameter from old)
  13. Type the full word emergency
  14. Press the Enter key
  15. Press the b key
  16. Wait while system boots up to the emergency runlevel
  17. A prompt will appear--
    Give root password for maintenance
    (or type Control-D to continue):
  18. Type the root password
  19. Press the Enter key
  20. A root command line prompt will appear
  21. Perform necessary low-level maintenance, such as fsck of some disk partitions
  22. At the prompt press the ^D key to logout
    (do not attempt to use mount -o remount ... as you would in some other Unix-derived systems)
  23. Wait (several tens of seconds?) while the system boots up all the way


Location: (N) 42.67995, (W) -70.83761
 (North America> USA> Massachusetts> Boston Metro North> Ipswich)

Email comments to Chuck Kollars
Time: UTC-5 (USA Eastern Time Zone)
 (UTC-4 summertime --"daylight saving time")

Chuck Kollars headshot Chuck Kollars' other web presences include Chuck's books and Chuck's movies.

You may also wish to look at Dad's photo album.

All content on this Personal Website (including text, photographs, audio files, and any other original works), unless otherwise noted on individual webpages, are available to anyone for re-use (reproduction, modification, derivation, distribution, etc.) for any non-commercial purpose under a Creative Commons License.