2

Please, I am not looking for a rehash of what's stated in RedHat's documentation regarding emergency mode. I would like to know what steps are involved from the time grub hands off to the kernel to the time you get a emergency mode login prompt.

I imagine /sbin/init is completely bypassed and therefore rc.sysinit bypassed as well. I don't however know what isn't bypassed or how emergency mode differs (intimately) with init=/bin/sh.

What sort of steps does the kernel take when given the emergency argument at boot time? Thanks!

2 Answers 2

2

Normal situation:

  1. bios initialization
  2. bootloader
  3. kernel initialization
  4. init starts and enters your runlevel & execute:
    • /etc/rc.d/rc.sysinit
    • /etc/rc.d/rc and /etc/rc.d/rc?.d/
    • /etc/rc.d/rc.local
  5. X display manager

In emergency mode you bypass 'rc.sysinit' and runs only 'sulogin' script by default. To see what is happening on your system see /etc/inittab.

3
  • That's mostly what I was looking for, now I know emergency mode is passed as an argument to /sbin/init. Thanks! What is the boot process when you pass init=/bin/sh to the kernel on boot? I imagine the kernel no longer calls /sbin/init and instead calls /bin/sh. Is this correct? Feb 16, 2010 at 9:04
  • I tested my assumption regarding init=/bin/sh by passing init=/sbin/init. The system booted as normal so I imagine that init=/bin/sh does in fact cause the kernel to execute sh in place of init, versus as some sort of argument to init or something else. Feb 16, 2010 at 9:09
  • Yes, one of last things kernel initialization does is invoke execve() on the argument you pass to it by init=whatever if it fails it tries to run init from several locations if that fails you end up with /bin/sh.
    – user4999
    Feb 17, 2010 at 4:41
1

No scripts are processed and you are given a root shell. Requires a password. Uses PAM if configured.

1
  • Not telling me anything I don't already know, but that doesn't make your answer any less correct. Thanks. Feb 16, 2010 at 3:21

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .