[opentrend solutions limited]

The Company

Services

Information

Get Firefox!

Bypassing init from lilo to boot a badly damaged system

If your Linux system is badly damaged, it may be that init won't start correctly, making it impossible to get into single user mode.

Alternatively, for whatever reason, no one present may know the root password and you have to legitmately get into the system.

These steps will get you into the Linux box as long as there is no bootloader protection set (eg lilo password).

1. Boot the system. You might like to hit ctrl-alt-del on the console if the system is currently up. Although ctrl-alt-del is defineable in the /etc/inittab, most Linux admins leave it doing some sort of reboot or halt function.

2. Hit the shift key to get to the boot: prompt.

3. Determine what the name of your kernel image is. This is often Linux and that is what we will use for this example.

4. Type: Linux init=/bin/sh

This will boot the kernel image Linux and call /bin/sh as the init process. The init process is always process id 1 on a unix system, and is called the grandfather of all processes (ie, apart from certain pseudo processes under Linux, the init process is the only process started by the kernel on a unix system. All others are decended from the init process). By default the init process is /sbin/init which looks in the /etc/inittab file to proceed with the bootstrap process.

5. The system will now boot with a root shell on the console. No other processes will be running.

6. The root filesystem is probably mounted read-only (ro) so we need to make sure it is mounted read-write. This is safe to do even if the filesystem is mounted read-write already.

Type: mount -n -o remount,rw /

7. You now have access to your system. You'll need to mount any filesystems that you need, etc.

8. Fix your system. This is outside the scope of this document :)

9. Rebooting. Once fixed you'll want your system running normally again. I've found the best way to do this is to type the reboot command.

Good luck