📄 lsg04.htm
字号:
<META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">
<SCRIPT>
<!--
function displayWindow(url, width, height) {
var Win = window.open(url,"displayWindow",'width=' + width +
',height=' + height + ',resizable=1,scrollbars=yes');
}
//-->
</SCRIPT>
</HEAD>
-->
<LINK REL="ToC" HREF="index.htm">
<LINK REL="Index" HREF="htindex.htm">
<LINK REL="Next" HREF="lsg05.htm">
<A NAME="I0"></A>
<H2>Linux System Administrator's Survival Guide lsg04.htm</H2>
<P ALIGN=LEFT>
<HR ALIGN=CENTER>
<P>
<UL>
<UL>
<UL>
<LI>
<A HREF="#E68E19" >Installing LILO</A>
<UL>
<LI>
<A HREF="#E69E44" >Handling Disk Problems</A>
<LI>
<A HREF="#E69E45" >Using the LILO Makefile</A>
<LI>
<A HREF="#E69E46" >Updating LILO</A></UL>
<LI>
<A HREF="#E68E20" >Linux and Hard Disk Layouts</A>
<LI>
<A HREF="#E68E21" >The Boot Sector</A>
<LI>
<A HREF="#E68E22" >The Boot Process</A>
<UL>
<LI>
<A HREF="#E69E47" >Installing a Dedicated Linux Hard Disk</A>
<LI>
<A HREF="#E69E48" >Using BOOTACTV</A>
<LI>
<A HREF="#E69E49" >Installing DOS and Linux</A>
<LI>
<A HREF="#E69E50" >Using BOOTLIN</A>
<LI>
<A HREF="#E69E51" >Automated LILO Creation</A>
<LI>
<A HREF="#E69E52" >Setting Boot Parameters</A></UL>
<LI>
<A HREF="#E68E23" >The Map Installer</A>
<UL>
<LI>
<A HREF="#E69E53" >Map Installer Command-Line Options</A>
<LI>
<A HREF="#E69E54" >Map Installer Configuration File Options</A></UL>
<LI>
<A HREF="#E68E24" >Boot Images</A>
<LI>
<A HREF="#E68E25" >Disk Parameter Table</A>
<LI>
<A HREF="#E68E26" >Removing or Disabling LILO</A>
<LI>
<A HREF="#E68E27" >Troubleshooting LILO</A>
<LI>
<A HREF="#E68E28" >Summary</A></UL></UL></UL>
<HR ALIGN=CENTER>
<A NAME="E66E5"></A>
<H1 ALIGN=CENTER>
<CENTER>
<FONT SIZE=6 COLOR="#FF0000"><B>Chapter 4</B></FONT></CENTER></H1>
<BR>
<A NAME="E67E8"></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 Linux uses to load the operating system kernel. Whenever you change or move the Linux kernel, you must invoke LILO to rebuild a map of the kernel locations. LILO is versatile—it can boot Linux kernels from any type of filesystem, including floppy disk, as well as from other operating systems. This chapter looks at LILO, the way hard disks are laid out with Linux, the boot process, the most common boot processes, and LILO's interactions with each. This information should help you install and use LILO effectively.
<BR>
<P>Several versions of LILO are available. Most current versions support one of two different directory structures. The more traditional (and older) structure resides in the /etc/lilo directory. The newer structure has files scattered in several directories, including /etc, /sbin, and /boot. Because the older /etc/lilo structure is the most common, it is used for examples in this chapter. If you are using the new structure (check for the existence of /etc/lilo), substitute the new pathnames as necessary.
<BR>
<BR>
<A NAME="E68E19"></A>
<H3 ALIGN=CENTER>
<CENTER>
<FONT SIZE=5 COLOR="#FF0000"><B>Installing LILO</B></FONT></CENTER></H3>
<BR>
<P>Most systems will have LILO already installed and configured. If your system already has LILO installed, you can skip this section unless you want to update your version. A quick installation procedure is available with most versions of Linux to install a minimum set of LILO. This procedure is described in the file QuickInst.old or QuickInst.new, depending on the version of Linux. You can only use the QuickInst routines for a first-time LILO installation or to replace an existing LILO set. You cannot use them for updates as any existing configuration information is overwritten.
<BR>
<P>A full installation of LILO requires that all the files in the LILO distribution archive (usually called lilo.<I>xxx</I>.tar.gz where <I>xxx</I> is the version number) are extracted into a directory other than /etc/lilo. (Otherwise, installation will fail if the final destination is the same as the source directory.) After the distribution files are located in a temporary directory, follow these steps:
<BR>
<OL>
<LI>Check the Makefile for valid configuration information (see the following LILO Makefile section).
<BR>
<BR>
<LI>Compile LILO. If you want to use the older /etc/lilo directory structure, issue the first command that follows. If you want to use the new directory structure, issue the second command.
<BR>make -f Makefile.old
<BR>make -f Makefile.new
<BR>
<LI>Copy all the LILO files to the target directory with one of the following commands, depending on whether you selected the new or old directory structure:
<BR>make -f Makefile.old install
<BR>make -f Makefile.new install
<BR>
<LI>Check the directories. You should see the following files: any_d.b, boot.b, chain.b, disktab, lilo, os2_d.b. If the files do not exist or errors are generated in the process, restart the installation. Check the Makefile for accurate information. Once LILO has been installed properly, you can use it to install a boot process.
<BR>
<BR>
</OL>
<BLOCKQUOTE>
<BLOCKQUOTE>
<HR ALIGN=CENTER>
<BR>
<NOTE>Before you can compile LILO for use, you have to configure the kernel by running make config. All kernel header files must be in the directory /usr/include/linux for LILO to compile properly. The LILO installation and compilation process should be run from a Bourne shell (or complete compatible). Problems have been reported with versions of the Korn shell when LILO is compiled, so use /bin/sh or /bin/bash.</NOTE>
<BR>
<HR ALIGN=CENTER>
</BLOCKQUOTE></BLOCKQUOTE>
<BR>
<A NAME="E69E44"></A>
<H4 ALIGN=CENTER>
<CENTER>
<FONT SIZE=4 COLOR="#FF0000"><B>Handling Disk Problems</B></FONT></CENTER></H4>
<BR>
<P>Some systems may have difficulty with hard disks that do not allow the disk parameters (heads, sectors per track, and cylinders) to be read. If you get error messages about bad geometry or the LILO installation fails with disk errors, the disk parameters are a likely source of trouble, especially if you're dealing with SCSI disks and hard disks with a capacity of 1G or more.
<BR>
<P>In this case, you must manually enter the disk parameters into the file disktab. The section "Disk Parameter Table" later in this chapter discusses this step in more detail. Edit the disktab file as explained to include the disk parameters. Then test the new LILO configuration by copying it to a floppy disk and booting from it. Follow these steps:
<BR>
<OL>
<LI>Change to the LILO directory (usually /etc/lilo).
<BR>
<BR>
<LI>Execute the following command to copy the LILO configuration to the floppy. Substitute the kernel image name after the image parameter.
<BR>echo image=kernel_name | ./lilo -C - -b /dev/fd0 -v -v -v
<BR>
<LI>Reboot your system from the floppy disk.
<BR>
<BR>
</OL>
<P>If the configuration is correct, LILO will read the floppy disk for the boot loader, and then load the kernel from the hard disk. If everything boots properly and you can move around the filesystem, the disk parameters are correct. If you can't access the hard disk filesystem, the parameters are incorrect and should be entered again.
<BR>
<BR>
<A NAME="E69E45"></A>
<H4 ALIGN=CENTER>
<CENTER>
<FONT SIZE=4 COLOR="#FF0000"><B>Using the LILO Makefile</B></FONT></CENTER></H4>
<BR>
<P>The LILO Makefile supplied with the LILO installation files is valid for most installations, although you should carefully check all the entries. LILO uses either the Makefile, which contains all the instructions for a C compiler to compile a binary from the source code, or another file called /etc/lilo/config.defines. If the config.defines file exists, Makefile is ignored. For most purposes, editing the Makefile is sufficient, although if you plan to use LILO a lot, the config.defines file is a better alternative because it isn't overwritten with new versions of LILO.
<BR>
<P>The Makefile has several parameters that control the compilation process. You may need to change some of the values, depending on your system requirements. Check the following parameters in the Makefile and ensure that the values they have set are what you want:
<BR>
<UL>
<LI>IGNORECASE makes image names case insensitive. This parameter is active by default and should be left alone.
<BR>
<BR>
<LI>NO1STDIAG does not generate diagnostic messages when read errors are encountered in the boot loader. This parameter is disabled by default. It's best to leave it disabled unless you don't care about the error messages.
<BR>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -