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

Chapter 16 Linux Troubleshooting Basics 485

configuration file, remember to restart the particular process or application that you are working on.

8.Use as many resources as possible: When you are stumped, don’t be afraid to use as many outside resources as possible. If you have a maintenance contract with your software or hardware vendor, call them immediately. Utilize resources on the Internet, such as technical and vendor Web sites with searchable troubleshooting databases.

9.Document your solution: After you have solved your problem, document the solution in detail. You may need this information again in the future if the same problem appears, and you can avoid the additional troubleshooting time by referring to your own notes.

Troubleshooting Resources

6.15 Locate troubleshooting resources and update as allowable (e.g., Web, man pages, howtos, infopages, LUGs)

A wide variety of resources are available for the Linux user and system administrator when troubleshooting problems. From the inception of Linux (and due to its Open Source model), most companies have never provided any official software support for Linux. Linux users and experts support the system by communicating with each other the tips and tricks that make Linux run smoothly. Any problem that you may have with a Linux system, you can bet that someone, somewhere, has already encountered the same problem and has created and documented a solution. The documentation support for Linux is massive, and several resources are available to you when troubleshooting a problem.

Know what is the best troubleshooting resource for the situation.

Documentation resources

A vast amount of documentation for Linux is available for administrators, developers, and users, who have all shared information on Linux configuration, troubleshooting, and general operating issues. This section details the different types of documentation that you can access when troubleshooting your Linux system.

MAN pages

MAN pages, or manual pages, are the original Unix way to look up information on specific commands and processes on your system by consulting an online manual. By using a command’s MAN page, you can find out exactly what the command does, how to execute it, and all of the options that you can use with the command. The MAN page is split into different sections, each giving the command name and its function, a synopsis of the syntax for the command, and a description, which lists all of the available options for that command.

486

Part VI Troubleshooting and Maintaining System Hardware

When troubleshooting, you often need to quickly check the options that you can use with a particular command — using the MAN page command is the fastest way to do so. To use the man command, simply type the name of the command that you want to look up:

man lilo

For example, here is a listing of the MAN page for the lilo command:

Name

lilo - install boot loader Synopsis

Main function:

/sbin/lilo - install boot loader

Auxiliary uses: /sbin/lilo -q - query map

/sbin/lilo -R - set default command line for next reboot /sbin/lilo -I - inquire path name of current kernel /sbin/lilo {-u|-U} - uninstall lilo

Description

lilo installs a boot loader that will be activated next time you boot. It has lots of options.

-v Increase verbosity. Giving one or more -v options will make lilo more verbose.

-q List the currently mapped files. lilo maintains a

file, by default /boot/map, containing the name and location of the kernel(s) to boot. This option will list the names therein.

-m map-file

Use specified map file instead of the default.

-C config-file

lilo reads its instructions about what files to map from its config file, by default /etc/lilo.conf. This option can be used to specify a non-default config file.

-d delay

If you have specified several kernels, and press Shift at boot-time, the boot loader will present you with a choice of which system to boot. After a timeout period the first kernel in the list is booted. This option specifies the timeout delay in deciseconds.

-D label

Use the kernel with the given label, instead of the first one in the list, as the default kernel to boot.

Chapter 16 Linux Troubleshooting Basics 487

-r root-directory

Before doing anything else, do a chroot to the indicated directory. Used for repairing a setup from a boot floppy.

-t Test only. Do not really write a new boot sector or

map file. Use together with -v to find out what lilo is about to do.

-c Enable map compaction. This will merge read requests from adjacent sectors. Speeds up the booting (especially from floppy).

-f disk-tab

Specify disk geometry parameter file. (The default is /etc/disktab.)

-i boot-sector

Specify a file to be used as the new boot sector. (The default is /boot/boot.b.)

-l Generate linear sector addresses instead of sector/head/cylinder addresses.

-P {fix|ignore}

Fix (or ignore) ‘corrupt’ partition tables, i.e., partition tables with linear and sector/head/ cylinder addresses that do not correspond.

-s save-file

When lilo overwrites the boot sector, it preserves the old contents in a file, by default /boot/boot.NNNN where NNNN depends on the device. This option specifies an alternate save file for the boot sector. (Or, together with the -u option, specifies from where to restore the boot sector.)

-S save-file

Normally, lilo will not overwrite an existing save file. This options says that overwriting is allowed.

-u device-name

Uninstall lilo, by copying the saved boot sector back. A time-stamp is checked.

-U device-name

Idem, but do not check the time-stamp.

-R command line

This option sets the default command for the boot loader the next time it executes. The boot loader will then erase this line: this is a once-only

488

Part VI Troubleshooting and Maintaining System Hardware

command. It is typically used in reboot scripts, just before calling ‘shutdown -r’.

-I label

The label of the running kernel can be found in the environment variable BOOT_IMAGE after startup. This command will print the corresponding path name on stdout.

-V Print version number.

The above command line options correspond to the key words in the config file indicated below.

-b bootdev

boot=bootdev

 

 

-c

compact

 

-d dsec

delay=dsec

 

-D label

default=label

 

-i bootsector

install=bootsector

 

-f file

disktab=file

 

-l

linear

 

-m mapfile

map=mapfile

 

-P fix

fix-table

 

-P ignore

ignore-table

 

-s file

backup=file

 

-S file

force-backup=file

 

-v

verbose=level

See Also

lilo.conf(5).

The lilo distribution comes with very extensive documenta-

tion.

Author

Werner Almesberger (almesber@bernina.ethz.ch).

Linux Documentation Project

The Linux Documentation Project was created to store all available Linux-related documentation, and to offer a central source for all types of documentation that is easy to navigate and search. It is a repository for all types of documentation, such as HOWTOs, guides, MAN pages, and information for new Linux users. For more information, see the home page of the Linux Documentation Project, which is located at www.linuxdoc.org.

The following sections list the types of documents that can be found through the Linux Documentation Project.

HOWTO

The Linux HOWTOs are detailed “how to” documents for specific subjects. A large number of HOWTO documents detail how to configure everything from PPP, to firewalls, to writing CDs. They come in a variety of formats, such as plain text, HTML, PDF, Postscript, and SGML.

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