Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I made a bone-headed mistake in one of my init.d scripts which gets stuck in an infinite loop during the boot process and blocks the completion. I therefore can not get to a shell and fix it. How can I boot and not perform all the boot scripts? I have root if necessary.

share|improve this question
I think Red Hat used to have a feature where at some point in the boot it asked if you wanted to continue automatically or manually select for each service if it was to be started or not. I don't know if the feature is still available or if your error happens before that is possible. – ptman Jun 16 '11 at 4:00
up vote 6 down vote accepted

Passing 1 on the kernel line in the bootloader should start it in single user mode, which should not start the initscript unless it is severely broken. If booting into single mode does not work then you will need to get the install disc and boot into rescue mode using it.

share|improve this answer
in the grub menu press "e" to edit the menu selection, then 'e' again on the second line, which should contain kernel arguements, then "return" then 'b' on the line to boot it – bobby Jun 16 '11 at 2:00
you can also use "s" on the line for single user mode. easier to remember for some (like me). – Sirex Jun 16 '11 at 8:49
I confirm that this works. Got me out of a hole when I screwed up an init.d script. Simply logged on at run level 1, mounted the drive as RW and rm'd the offending script. Boom! – user189445 Sep 11 '13 at 6:07

As Ignacio suggested, the simplest solution is to boot into single user mode. To do this press any key on the countdown splash screen before it boots into the kernel. From here highlight the proper kernel and press e. Press e again to edit the cmdline and at the end at either S, s, single, or 1. Press return and then b to boot. This won't run your init script unless you've explicitly configured it to be part of single user mode, which is unlikely.

However, if you still have problems at this point, you don't need the install disk. You can add the following to your kernel command line:


This will cause the kernel to start /bin/bash as pid 1, rather than init. At this point none of the system initialization scripts will have run, so you should be able to take care of things. Note that you'll probably have a read-only root filesystem, which you should be able to take care of like this:

mount -o remount,rw /

...or you can remove the ro option from the kernel command line.

share|improve this answer
I dont believe this will work, at least not as simply as wished. RHEL uses an initrd, and I believe the only shell available on the initrd is nash, which really really sucks. But I could be wrong, going off memory. – Patrick Jun 16 '11 at 2:47
The initrd loads and transitions to the real root as normal. You're simply loading /bin/bash instead of /sbin/init. This is a common recovery scenario; nothing special happening here. – larsks Jun 16 '11 at 3:37
i believe larsks is correct, this is a viable option. – Sirex Jun 16 '11 at 8:50

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.