[SWLUG] What to do if there is a problem at startup...

Steve Hill steve at nexusuk.org
Sat Oct 22 17:30:11 UTC 2005


On Sat, 22 Oct 2005, Rhys Hardwick wrote:

> devices at all, therefore no login, no fixing the udev program.  Putting
> 'single' at the end of the kernel startup line in grub did no good.  I

"single" or "1" still run some of the init scripts (rc.sysinit for 
example).  So if your problem is in a script that still gets run that's no 
good.

A useful trick is starting the kernel with "init=/bin/sh" on the kernel 
commandline - this tells it to start the shell instead of init.  You'll 
end up with a very basic system booted up (only the root fs mounted, and 
that's probably mounted readonly) but it gives you a system working enough 
to hack at files on the disk.
Remount the root fs with something like "mount -o remount,rw /" and mount 
stuff like /proc if you need it and any other filesystems.
Since init isn't running there's nothing to handle the shutdown correctly 
so you can't use the "shutdown" command - instead you need to unmount as 
many filesystems as you can and remount the root fs as readonly (mount -o 
remount,ro /).  Then just hit reset or the power button.

> I was wondering if this was the best way of recovering from a problem

Well, if you can't boot in single user mode then your only options are to 
use a boot CD or boot with init=/bin/sh as I described above.  A boot CD 
will probably give you a nicer environment to work with, but booting 
with init=/bin/sh is a handy trick to have up you sleeve in case you don't 
have a boot disk, you're using a system without a CD drive or your like me 
and far too lazy to actually _find_ a boot disk. :)

-- 

  - Steve
    xmpp:steve at nexusuk.org   sip:steve at nexusuk.org   http://www.nexusuk.org/

      Servatis a periculum, servatis a maleficum - Whisper, Evanescence




More information about the Swlug mailing list