Re: [nottingham] nottingham - linux open evening Thurs Nov 15th

From: Graeme Fowler (graeme@graemef.net)
Date: Sun 21 Oct 2001 - 12:57:53 BST


On Sun, 21 Oct 2001, Matthew Rose wrote:
> Try LILO: linux emergency init=/bin/sh
> which will do te minimum on booting and dump you right into a root
> shell.

Be Very Careful when doing this, it drops you into a dirty filesystem. Do
the absolute minimum necessary to sort out the problem and then use the
shutdown command to reboot (with the full path).

Also, you may not need 'emergency' after linux - in desperate times I
usually just use "linux init=/bin/sh". This bypasses the normal init
scripts, of which the one we're interested in (on RH at least) is
rc.sysinit. You'd do well to familiarise yourselves with the internals of
that script, as it's the one which decides what filesystems to check and
how to handle the check return codes at boot time.

Note that just typing 'exit', 'logout' or hitting CTRL-D will result in a
stalled system from a script-bypassed boot sequence, since the system will
not know how to drop you back to runlevel 0.

To summarise:

LILO: linux init=/bin/sh
<wait>
# /usr/bin/passwd root
<new root pw>
<new root pw>
# /sbin/shutdown -r now

...which still might hang (due to the lack of as 'real' init process), but
at least you just set the root pw so when you power cycle your
recalcitrant little beast and it asks for the password to complete a
filesystem check, you know what it is. At least... you should ;-)

G

--------------------------------------------------------------------
http://www.lug.org.uk http://www.linuxportal.co.uk
http://www.linuxjob.co.uk http://www.linuxshop.co.uk
--------------------------------------------------------------------



This archive was generated by hypermail 2.1.3 : Thu 22 Nov 2001 - 13:18:18 GMT