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!

CarpeNoctem
  • 2,397
  • 4
  • 23
  • 32

2 Answers2

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.

  • 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? – CarpeNoctem Feb 16 '10 at 09: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. – CarpeNoctem Feb 16 '10 at 09: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. –  Feb 17 '10 at 04:41
1

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

fpmurphy
  • 841
  • 6
  • 13