up previous
Up: What is Rescue Mode? Previous: Unable to boot Linux

Hardware/software problems

- There can be as many different situations under this category as there are systems running Linux. Things like failing hard drives and forgetting to run LILO after building a new kernel are just two things than can keep you from booting . If you can get into rescue mode, you might be able to resolve the problem - or at least get copies of your most important files.

What do you need to get into rescue mode?

To enter rescue mode, you'll need a rescue disk set. This set consists of two diskettes that contain the files necessary to boot into rescue mode.

If you elected to make a boot diskette while you were installing , you're halfway there! The first diskette in a rescue disk set is this boot diskette.

Now on to the second diskette...

The second diskette is called the rescue diskette. It is produced by writing an image file onto a diskette. The image file is called rescue.img, and is located in the images directory on the first CD-ROM.

To gain access to this file, you'll first need to mount your CD-ROM.

Start by inserting the CD-ROM in your system's CD-ROM drive. You'll need to do this while logged in as root.

Type the following command:


\begin{tscreen}\begin{tex2html_preform}\begin{verbatim}mkdir /mnt/cdrom\end{verbatim}\end{tex2html_preform}\end{tscreen}

Now, type:


\begin{tscreen}\begin{tex2html_preform}\begin{verbatim}mount /dev/cdrom /mnt/cdrom\end{verbatim}\end{tex2html_preform}\end{tscreen}

You may get an error message from the first command saying that the file exists. That's fine; we just want to make sure that there is a /mnt/cdrom directory on your system. The second command should issue an informational message that /dev/cdrom is being mounted read-only.

Some systems may not recognize /dev/cdrom. If this is your case, you'll have to replace /dev/cdrom in the command with the appropriate device name for your CD-ROM.

Next, issue the following command (again, while logged in as root):


\begin{tscreen}\begin{tex2html_preform}\begin{verbatim}cd /mnt/cdrom/images\end{verbatim}\end{tex2html_preform}\end{tscreen}

then type:


\begin{tscreen}\begin{tex2html_preform}\begin{verbatim}ls\end{verbatim}\end{tex2html_preform}\end{tscreen}

to list the contents of the images directory.

You should see a file named rescue.img. This is the rescue diskette image file. Next, put a diskette in your first diskette drive, and enter the following command:


\begin{tscreen}\begin{tex2html_preform}\begin{verbatim}dd if=rescue.img of=/dev/fd0 bs=1440k\end{verbatim}\end{tex2html_preform}\end{tscreen}

Your system's diskette drive should start writing to the diskette. After a minute or so, the dd command will complete, and you'll get your shell prompt back.

Wait for your diskette drive's access light to go out, and that's it!

You now have a rescue disk set. Label this diskette something like '' BL2000 rescue diskette'' and store it someplace safe.

Let's hope you never have to use it.

If you should ever need to use rescue mode, here's how.

Boot your system with the boot diskette in the first diskette drive. At the LILO Boot: prompt, enter the word rescue. You will see the usual kernel messages as the Linux kernel starts up.

Eventually, it will ask you to insert the next diskette, and press Enter. Remove the boot diskette, insert the rescue diskette, and press Enter.

The rescue diskette will be read into memory. After a minute or so, you should see the shell prompt. That's it - you're in rescue mode!

Now what?

When it comes to rescue mode, that's a bit like asking, ''how long is a piece of string?'' What you require depends a great deal on what your system's problem is, your level of Linux expertise, and several variables we haven't even thought of yet. So we can't give you explicit instructions.

But we can tell you what programs you have access to while in rescue mode.

Here's the list:


\begin{tscreen}\begin{tex2html_preform}\begin{verbatim}badblocks bash bzip2
cat ...
...il tar
traceroute umount vi
vim\end{verbatim}\end{tex2html_preform}\end{tscreen}

You're likely to be unfamiliar with most, if not all of these commands. However, the commands do have man pages. Once you begin to feel more comfortable with commands, you should consider familiarizing yourself them through the man pages. (You may not have that luxury if you have to use these commands...)

You've worked with some pretty useful commands for your system so far. You may not have known much about the location of those files in the directory, however.

For more information about the Linux filesystem, including navigation and working with other useful commands to help you understand your system, turn to the next chapter.


up previous
Up: What is Rescue Mode? Previous: Unable to boot Linux
linux@bestlinux.net