?? rhl04.htm
字號:
<HTML>
<HEAD>
<TITLE>Red Hat Linux Unleashed rhl04.htm </TITLE>
<LINK REL="ToC" HREF="index-1.htm" tppabs="http://202.113.16.101/%7eeb%7e/Red%20Hat%20Linux%20Unleashed/index.htm">
<LINK REL="Index" HREF="htindex.htm" tppabs="http://202.113.16.101/%7eeb%7e/Red%20Hat%20Linux%20Unleashed/htindex.htm">
<LINK REL="Next" HREF="rhl05.htm" tppabs="http://202.113.16.101/%7eeb%7e/Red%20Hat%20Linux%20Unleashed/rhl05.htm">
<LINK REL="Previous" HREF="rhl03.htm" tppabs="http://202.113.16.101/%7eeb%7e/Red%20Hat%20Linux%20Unleashed/rhl03.htm"></HEAD>
<BODY BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" VLINK="#800080">
<A NAME="I0"></A>
<H2>Red Hat Linux Unleashed rhl04.htm</H2>
<P ALIGN=LEFT>
<A HREF="rhl03.htm" tppabs="http://202.113.16.101/%7eeb%7e/Red%20Hat%20Linux%20Unleashed/rhl03.htm" TARGET="_self"><IMG SRC="purprev.gif" tppabs="http://202.113.16.101/%7eeb%7e/Red%20Hat%20Linux%20Unleashed/purprev.gif" WIDTH = 32 HEIGHT = 32 BORDER = 0 ALT="Previous Page"></A>
<A HREF="index-1.htm" tppabs="http://202.113.16.101/%7eeb%7e/Red%20Hat%20Linux%20Unleashed/index.htm" TARGET="_self"><IMG SRC="purtoc.gif" tppabs="http://202.113.16.101/%7eeb%7e/Red%20Hat%20Linux%20Unleashed/purtoc.gif" WIDTH = 32 HEIGHT = 32 BORDER = 0 ALT="TOC"></A>
<A HREF="rhl05.htm" tppabs="http://202.113.16.101/%7eeb%7e/Red%20Hat%20Linux%20Unleashed/rhl05.htm" TARGET="_self"><IMG SRC="purnext.gif" tppabs="http://202.113.16.101/%7eeb%7e/Red%20Hat%20Linux%20Unleashed/purnext.gif" WIDTH = 32 HEIGHT = 32 BORDER = 0 ALT="Next Page"></A>
<HR ALIGN=CENTER>
<P>
<UL>
<UL>
<UL>
<LI>
<A HREF="#E68E26" >Using LILO to Boot Off the Hard Drive</A>
<UL>
<LI>
<A HREF="#E69E29" >LILO Command-Line Arguments</A>
<LI>
<A HREF="#E69E30" >Configuration Parameters</A>
<LI>
<A HREF="#E69E31" >The boot Prompt</A>
<LI>
<A HREF="#E69E32" >Uninstalling LILO</A>
<LI>
<A HREF="#E69E33" >Map Installer Errors</A>
<LI>
<A HREF="#E69E34" >LILO Error Codes</A></UL>
<LI>
<A HREF="#E68E27" >Using BOOTLIN Instead of LILO</A>
<LI>
<A HREF="#E68E28" >Restoring the MBR</A>
<LI>
<A HREF="#E68E29" >Summary</A></UL></UL></UL>
<HR ALIGN=CENTER>
<A NAME="E66E4"></A>
<H1 ALIGN=CENTER>
<CENTER>
<FONT SIZE=6 COLOR="#FF0000"><B>4</B></FONT></CENTER></H1>
<BR>
<A NAME="E67E4"></A>
<H2 ALIGN=CENTER>
<CENTER>
<FONT SIZE=6 COLOR="#FF0000"><B>LILO</B></FONT></CENTER></H2>
<BR>
<P>Whenever you hear about Linux, you'll also hear about LILO. LILO is the boot loader used by Linux to load the operating system kernel. Whenever the Linux kernel is changed or moved, LILO must be invoked to rebuild a map of the kernel locations. LILO is
versatile; it can boot Linux kernels from any type of file system, including floppy disk, as well as from other operating systems.
<BR>
<P>This chapter looks at LILO, the way hard disks are laid out with Linux, the boot process, and the most common boot processes and LILO's interactions with each. This should help you install and use LILO efficiently and effectively.
<BR>
<BR>
<A NAME="E68E26"></A>
<H3 ALIGN=CENTER>
<CENTER>
<FONT SIZE=5 COLOR="#FF0000"><B>Using LILO to Boot Off the Hard Drive</B></FONT></CENTER></H3>
<BR>
<P>LILO (which means LInux LOader) is a bit tricky to use if you are not familiar with it and its purpose. You need to install the LILO program, which changes the boot sector of your hard drive to allow you to choose between a DOS or a Linux partition as
the boot source partition. LILO is included with Red Hat Linux and is installed automaically when you load the system from CD-ROM.
<BR>
<P>Some of the features of LILO include the following:
<BR>
<UL>
<LI>It is independent of the file system. You can use LILO with DOS, UNIX, OS/2, and Windows NT.
<BR>
<BR>
<LI>It can replace the master boot record on your hard drive.
<BR>
<BR>
<LI>It can use up to 16 different boot images on several partitions on your hard drive. Each image can be protected by a password.
<BR>
<BR>
<LI>It provides support for boot-sector, map-file, and boot images to reside on different disks or partitions.
<BR>
<BR>
</UL>
<P>Using LILO may seem risky at first; it can ruin your hard drive or leave you with a system that you cannot boot. To prepare yourself for this mishap, keep a boot disk handy. Also, you have to do this installation as root, so be careful.
<BR>
<P>If you have already installed Red Hat Linux, the LILO files will exist on your hard drive. If you are about to install Red Hat Linux, the LILO installation routine will be activated automatically as part of the installation process. If you want to redo
the LILO system at any time, though, you can run the program /sbin/liloconfig.
<BR>
<P>The liloconfig program is easy to use and asks several questions about your system. The sheer number of possibilities cannot be completely covered here, but here are the terms with which you must be familiar:
<BR>
<UL>
<LI>/dev/hda and /dev/hdb refer to both IDE hard drives 1 and 2 on your system. Individual partitions on each hard drive are referred to as /dev/hda1, /dev/hda2, /dev/hda3, and so on for drive 1. Similar to this are the partitions for drive 2: /dev/dhb1
and so on.
<BR>
<BR>
<LI>SCSI hard drives are referred to as /dev/sda and /dev/sdb for drive 1 and 2, respectively.
<BR>
<BR>
<LI>The Master Boot Record (MBR) is the first boot sector of your drive that contains the partitioning information and boot-strap code. LILO will change this sector and make it incompatible with DOS. The DOS MBR program simply loads MS-DOS from the boot
sector, which in turns loads command.com.
<BR>
<BR>
</UL>
<P>The liloconfig program asks you where you want to install LILO. If you are running multiple operating systems and plan to switch between them often, try installing on the Linux partition superblock. If you will use Linux primarily or only, install on
the Master Boot Record. You will then be asked about the ability to load other operating systems from the boot prompt, and you get to identify each operating system and provide a name for it. This lets you start DOS, for example, from the boot prompt by
entering the name you assigned to DOS partition.
<BR>
<P>After the liloconfig program has run, it will create a file called lilo.conf for you in the /etc directory. If you already have this file in your /etc directory, you can edit it manually using any ASCII editor. Of course, depending on how your system is
set up, the contents of your Linux installation may vary. A sample lilo.conf file for a system containing both DOS and Linux looks like this:
<BR>
<PRE>
<FONT COLOR="#000080">boot=/dev/hda
map=/boot/map
install=/boot/boot.b
prompt
timeout=50
image=/vmlinuz
root=/dev/hda2
label=linux
other=/dev/hda1
label=dos
table=/dev/hda</FONT></PRE>
<P>In this lilo.conf file, you can see two different kernels that can be booted from /dev/hda. The first image is the default image, called vmlinuz. The other image is labeled DOS for the DOS partition. Typing dos at the boot prompt will boot this
partition.
<BR>
<BR>
<A NAME="E69E29"></A>
<H4 ALIGN=CENTER>
<CENTER>
<FONT SIZE=4 COLOR="#FF0000"><B>LILO Command-Line Arguments</B></FONT></CENTER></H4>
<BR>
<P>The LILO configuration is written to disk using the /sbin/lilo command. The /sbin/lilo installer accepts several command-line options. A few of the more usual ones are listed here.
<BR>
<UL>
<LI>-C <config_file>. Specifies the configuration file that is used by the map installer. If -C is omitted, /etc/lilo/config is used. In this example, you would use /etc/lilo.conf.
<BR>
<BR>
<LI>-q. Lists the currently mapped files.
<BR>
<BR>
<LI>-r <root_directory>. Changes the directory to the specified directory before doing anything else. This is useful when running the map installer while the normal root file system is mounted somewhere else, for example, when recovering from an
installation failure with an install disk.
<BR>
<BR>
<LI>-t. Test only. Performs the entire installation procedure without replacing the map file or writing the modified boot sector. This can be used in conjunction with the -v option to verify that LILO will use sane values.
<BR>
<BR>
<LI>-v. Be verbose about what it's doing. If you don't do this, the installation process will not display any messages or status information.
<BR>
<BR>
<LI>-u [ device_name ]. Restores the backup copy of the specified boot sector. The name is normally derived from its present name.
<BR>
<BR>
<LI>-V. Prints the version number and exits.
<BR>
<BR>
</UL>
<BR>
<A NAME="E69E30"></A>
<H4 ALIGN=CENTER>
<CENTER>
<FONT SIZE=4 COLOR="#FF0000"><B>Configuration Parameters</B></FONT></CENTER></H4>
<BR>
<P>The /etc/lilo.conf file can have the following parameters. All of these can be set from the command line, but storing them in a configuration file is more reliable. The following options are available to you:
<BR>
<UL>
<LI>boot=<boot_device>. Sets the name of the device that contains the boot sector. If boot is omitted, the boot sector is read from (and possibly written to) the device that is currently mounted as root.
<BR>
<BR>
<LI>linear. Generates linear sector addresses instead of sector/head/cylinder addresses. Linear addresses are translated at run time and do not depend on disk geometry. Note that boot disks, where linear is used, may not be portable.
<BR>
<BR>
<LI>install=<boot_sector>. Installs the specified file as the new boot sector. If install is omitted, /etc/lilo/boot.b is used as the default.
<BR>
<BR>
<LI>disktab=<disktab_file>. Specifies the name of the disk parameter table. The map installer looks for /etc/lilo/disktab if disktab is omitted.
<BR>
<BR>
<LI>map=<map_file>. Specifies the location of the map file. If map is omitted, the file /etc/lilo/map is used.
<BR>
<BR>
<LI>message=<message_file>. Specifies a file containing a message that is displayed before the boot prompt. No message is displayed when waiting for a Shift key after printing "LILO." The FF character ([Ctrl L]) clears the local screen. The
size of the message file is limited to 65,535 bytes. The map file has to be rebuilt if the message file is changed or moved. The default file for messages is the /etc/boot.message file. Use this file to display boot options for your LILO configuration.
<BR>
<BR>
<LI>verbose=<level>. Turns on lots of progress reporting. Higher numbers give more verbose output.
<BR>
<BR>
<LI>backup=<backup_file>. Copies the original boot sector to <backup_file> (which may also be a device, such as /dev/null) instead of to /etc/lilo/boot.<number>.
<BR>
<BR>
<LI>force-backup=<backup_file>. Like backup, but overwrites an old backup copy if it exists. backup=<backup_file> is ignored if force-backup appears in the same configuration file.
<BR>
<BR>
<LI>prompt. Forces entering the boot prompt without expecting any prior key presses. Unattended reboots are impossible if prompt is set and timeout isn't.
<BR>
<BR>
<LI>timeout=<tsecs>. Sets a time out (in tenths of a second) for keyboard input. If no key is pressed for the specified time, the first image is automatically booted. Similarly, password input is aborted if the user is idle for too long. The default
timeout is infinite.
<BR>
<BR>
<LI>serial=<parameters>. Enables control from a serial line. The specified serial port must be initialized, and LILO is accepting input from it and from the PC's keyboard. Sending a break on the serial line corresponds to pressing the Shift key on
the console in order to get LILO's attention. All boot images should be password-protected if the serial access is less secure than access to the console—that is, if the line is connected to a modem. The parameter string has the syntax
<port>,<bps><parity><bits>. The components <bps>, <parity>, and <bits> can be omitted. If a component is omitted, all following components have to be omitted as well. Additionally, the comma has to be omitted only
if the port number is specified.
<BR>
<BR>
</UL>
<UL>
<UL>
<P><port>. The number of the serial port, zero-based. 0 corresponds to COM1.
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -