Linux is a hard operating system, with strong security, and a stable kernel (operating system core) and a lot of flexibility, but that can be your worst nightmare if you write the wrong commands: It's easy to destroy a Linux system if you ask it to do it.
One of the more tipical situations is to have a Linux system that doesn't boot. That is a simple problem, but it's possible you feel to be naked, because you are not able to write anything to your Linux, because it doesn't start!!
The more typical non-boot situations I have found are:
- The owner of the installation forbid the root password
- The new and incredible Linux kernel recently installed give you a kernel panic
- LILO hangs in the boot process and the kernel doesn't start
- You have installed a new Linux and it doesn't start up
There is a lot of problems that can cause any of the problems named before, but it's clear that in all those situations the first problem we have is that we cannot access a shell, so we cannot write the needed commands to solve the problem. In this page I'll try to solve the more usual problems, but feel free to write a comment if you cannot solve your problem with this tips to help you and complete the page.
So, the first thing we have to do is to access our crashed Linux. There are a few ways, depending of the nature of the problem:
The best problem is to doesn't remember the root password. To solve it we have to start the boot process, pressing the SHIFT key when LILO shows on the screen. A prompt will apear. If we press the TAB key we'll see the available kernels we have. We'll choose the first one usually called linux, so we'll write the following command at LILO prompt:
LILO: linux init=/bin/sh
What we are saying is that Linux has to start executing at first step of the boot process the shell, so we'll access the operating system without entering any password. Now we have to execute another command, because during the boot process the root partition is mounted as read-only, so we need to remount it read-write to reset the password:
# mount -o rw,remount /
Now we can execute the passwd command without parameters to reset the root password.
To solve that problem we need a new kernel to boot the operating system. Under Debian , and installing the new kernel using the dpkg tool, the system save the previous kernel as an
old kernel.
When you see the LILO word during the startup process, you can press the SHIFT key to enter a boot command. The TAB key it give us the list of kernels, and writing the name of another kernel in place of linux will boot a previous kernel. Now we'll be able to uninstall the new kernel.
That problem can be solved with a live-cd or the install CDs of our distribution. Under Debian you can use the first or five CD (or the DVD of the distribution) to start a Debian install. At the first screen of the install process press the CTRL+F2 keys to switch to a shell. The following command mounts the root filesystem and executes the lilo to reinstall it:
# mount /dev/hda1 /mnt
# chroot /mnt
# lilo
# exit
It's clear that you have to replace hda1 for your root partition. The root partition is usually located under hda1 for a Linux only disk or hda2 for a dual boot Windows and Linux disk.
The last step when you install an operating system is to enable the disk to boot. If there is a problem during this step, or you cancel it, the operating system is correctly installed but the computer doesn't know that the installation was done.
To tell the computer that all is wright and it can start our new operating system we can start again the installation process and execute the same steps of problem
numbered 3 (LILO hangs) in this page.