Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Linux+ Certification Bible.pdf
Скачиваний:
46
Добавлен:
15.03.2015
Размер:
3.78 Mб
Скачать

518

Part VI Troubleshooting and Maintaining System Hardware

Using the System Boot Disk

6.6 Use systems boot disk(s) and root disk on workstation and server to diagnose and rescue file system

If your system fails and won’t restart, you can rescue your system instead of installing it from scratch and recovering your data from backup tape. The use of a system boot rescue disk can quickly get your system operational again by booting directly to your hard drive and allowing you to make changes so that the boot process can continue properly.

A boot/rescue disk is one of your most important troubleshooting tools. Always have one on hand, and update it when you update your system.

Types of boot disks

You can make several different types of boot disks, and many can be combined onto one disk to give you the most options and utilities for rescuing a system.

Boot Disk: A bootable diskette that contains the Linux kernel. This can point to a root file system located on another disk, such as your hard drive.

Root/Rescue Disk: A disk containing a root file system that can run the Linux system from the floppy disk. This disk doesn’t necessarily have to be a boot disk.

Utility Disk: A disk containing all the system utilities that you need to rescue a file system. This should include utilities such as mount, fsck, and the vi editor.

Be aware that a basic boot disk doesn’t contain a root file system; it merely points to the location of the root partition on the original drive.

Creating a boot disk

To create a boot disk, you need to copy a version of the kernel and the boot loader LILO to the boot disk. Use the following general steps to create a boot disk:

1.Insert a floppy disk into the drive and mount it. If you have not formatted it yet, use the following command to create a Linux file system on the floppy:

mke2fs /dev/fd0

2.Mount it:

mount -t ext2 /dev/fd0 /mnt

3.Copy the contents of your /boot partition to the floppy disk: cp -dp /boot/* /mnt

Chapter 17 Troubleshooting the Boot Process

519

4.Create a new lilo.conf on the floppy by adding these commands (hda1 assumes that your system is on the first partition of the first hard drive):

boot = /dev/fd0 root = /dev/hda1

5.Install lilo on floppy with:

/sbin/lilo -C /mnt/lilo.conf

This disk enables you to boot from the floppy, and to mount a root file system from your hard drive. Use this disk if you are having problems with LILO and the master boot record. With this disk, you will be able to boot into your system and make the appropriate changes to fix the system. These changes usually involve running /sbin/lilo to install it back into the master boot record.

Most Linux distributions also come with a bootable installation CD-ROM, which can perform the same functions as the boot floppy diskette.

Creating a rescue/utility disk

The drawback of having only a boot disk is that you won’t be able to boot into the root file system on your main Linux machine if you are having problems it. You would benefit more by having a minimal root file system and some disk utilities on your boot floppy to help troubleshoot severe boot problems.

This process can vary quite a bit, depending on the Linux distribution that you are using. Most distributions come with their own bootable installation CD-ROM, which contains an excellent rescue environment for recovering systems.

Keep these points in mind when creating a rescue/utility disk:

Kernel: Try to use a compressed version of your kernel if at all possible. Some distributions already have a compressed version of the kernel, usually called vmlinuz, which fits much better on a floppy disk.

Basic File System: Copy as many directories that you need to your floppy disk to be able to boot into a functional system. For example, at the very least you need /dev, /proc, /bin, /etc, /lib, /usr, and /tmp.

Utilities: You need several basic utilities to be able to rescue your system, including programs, such as fsck, mount, and the vi editor, and even basic commands, such as ls, cp, mv, and shells.

Config files: You need many of your config files from /etc, such as fstab, lilo.conf, and rc/init scripts.

Соседние файлы в предмете Операционные системы