070-072.html

来自「linux-unix130.linux.and.unix.ebooks130 l」· HTML 代码 · 共 101 行

HTML
101
字号
<HTML>

<HEAD>

<TITLE>Linux Unleashed, Third Edition:Using LILO</TITLE>

<SCRIPT>
<!--
function displayWindow(url, width, height) {
        var Win = window.open(url,"displayWindow",'width=' + width +
',height=' + height + ',resizable=1,scrollbars=yes');
}
//-->
</SCRIPT>
</HEAD>

 -->




<!--ISBN=0672313723//-->

<!--TITLE=Linux Unleashed, Third Edition//-->

<!--AUTHOR=Tim Parker//-->

<!--PUBLISHER=Macmillan Computer Publishing//-->

<!--IMPRINT=Sams//-->

<!--CHAPTER=4//-->

<!--PAGES=070-072//-->

<!--UNASSIGNED1//-->

<!--UNASSIGNED2//-->



<CENTER>

<TABLE BORDER>

<TR>

<TD><A HREF="067-070.html">Previous</A></TD>

<TD><A HREF="../ewtoc.html">Table of Contents</A></TD>

<TD><A HREF="072-075.html">Next</A></TD>

</TR>

</TABLE>

</CENTER>

<P><BR></P>

<H4 ALIGN="LEFT"><A NAME="Heading4"></A><FONT COLOR="#000077">LILO Makefile</FONT></H4>

<P>The LILO <TT>Makefile</TT> supplied with the LILO installation files is valid for most installations, although you should carefully check all the entries. LILO uses either <TT>Makefile</TT> or another file called <TT>/etc/lilo/config.defines</TT>. If the <TT>config.defines</TT> file exists, <TT>Makefile</TT> is ignored. For most purposes, editing the <TT>Makefile</TT> is sufficient, although if you plan to use LILO a lot, the <TT>config.defines</TT> file is a better alternative because it isn&#146;t overwritten with new versions of LILO.</P>

<P>There are a number of parameters that should be checked in the <TT>Makefile</TT> before you go on. Table 4.1 summarizes these parameters and explains what they do.</P>

<TABLE WIDTH="100%"><CAPTION ALIGN=LEFT><B>Table 4.1.</B>LILO <TT>Makefile</TT> parameters.

<TR>

<TH COLSPAN="2"><HR>

<TR>

<TH WIDTH="30%" ALIGN="LEFT">Parameter

<TH WIDTH="70%" ALIGN="LEFT">Meaning

<TR>

<TD COLSPAN="2"><HR>

<TR>

<TD><TT>IGNORECASE</TT>

<TD>Makes image names not case sensitive. Active by default.

<TR>

<TD VALIGN="TOP"><TT>NO1STDIAG</TT>

<TD>Does not generate diagnostic messages when read errors are encountered in the boot loader. Disabled by default.

<TR>

<TD VALIGN="TOP"><TT>NOINSTDEF</TT>

<TD>If the install option is omitted from the command line, don&#146;t install a new boot sector. Instead, modify the old one. Disabled by default.

<TR>

<TD VALIGN="TOP"><TT>ONE_SHOT</TT>

<TD>Disables the command line timeout if any key is pressed. Disabled by default.

<TR>

<TD VALIGN="TOP"><TT>READONLY</TT>

<TD>Prevents overwriting of the default command line sector of the map file. Disabled by default.

<TR>

<TD COLSPAN="2"><HR>

</TABLE>

<H4 ALIGN="LEFT"><A NAME="Heading5"></A><FONT COLOR="#000077">Updating LILO</FONT></H4>

<P>If you want to update an existing version of LILO with a newer one, the process is the same as a first-time installation except that existing configuration files are renamed to <TT>.old</TT> automatically. For example, <TT>chain.b</TT> is renamed to <TT>chain.old</TT>. If the new version of LILO behaves properly, the <TT>.old</TT> files can be deleted.</P>

<P>Whenever you update the version of LILO, you must update the boot sector to add the new locations and map file format. To update the boot sector, simply run LILO.</P>

<H3><A NAME="Heading6"></A><FONT COLOR="#000077">Linux and Hard Disk Layouts</FONT></H3>

<P>To understand how LILO works, it is necessary to understand how a hard disk is laid out. You probably already know that a hard disk is essentially a set of concentric tracks, radiating out from the center of the disk platter. Each track is divided into a number of sectors.

</P>

<P>Hard disks are identified by the number of platters (or, more accurately, the number of heads: The number of platters can be greater than the number of heads because one or more surfaces&#151;typically the top and bottom&#151;might not be used for data storage), the number of tracks per inch of disk platter (measured radially), and the number of sectors per track. The capacity of each sector leads to the total capacity of the disk by multiplying the number of sectors per track, the number of tracks, and the number of platters with heads.</P>

<P>Linux is usually integrally tied with DOS, so it is useful to look at the way DOS uses a hard disk. A single-purpose (single DOS operating system, for example) hard disk (and most floppy disks) have a boot sector followed by a data area that includes an administrative block.</P>

<P>The boot sector is the first sector on the hard disk and is read when the system starts to load the operating system. The boot sector essentially contains a bootstrap to direct the machine to the startup routines.</P>

<P>The administrative block is usually part of the data area, although it is commonly not accessible directly by users. The administrative area contains the administrative tables that show file locations in terms of <TT>head/track/sector</TT>. DOS uses the File Allocation Table (FAT), while UNIX and Linux use the superblock or i-node tables. The administrative table is not usually read until the boot process has been started.</P>

<P>The data area is used to store files (including the operating system startup code). Each file on the hard disk will have an entry in the administrative block that indicates the filename and physical location on the hard disk. Other information is usually also stored in the administrative block (such as owner, permissions, date and time, and so on, depending on the operating system).</P>

<P>When there is lots of space on a hard disk, you will probably want to install more than one partition (probably supporting more than one operating system, such as providing both DOS and Linux on the same disk). You can create up to four &#147;primary&#148; partitions on a DOS disk.</P>

<BLOCKQUOTE>

<P><FONT SIZE="-1"><HR><B>Warning:&nbsp;&nbsp;</B><BR>Some operating systems allow more than four partitions, but if you are going to use DOS on the same hard disk, don&#146;t create more than four primary partitions. Extended partitions can be used to provide more than four logical disk drives. An extended partition is a primary partition that is further subdivided.<HR></FONT>

</BLOCKQUOTE>

<P>A partition table is written to the first sector (boot sector) of each hard disk (not each platter) that contains the details of the partition table. This sector is sometimes called the <I>Master Boot Record</I> or MBR. The only difference between a Master Boot Record and a boot sector is that the MBR contains partition information. Hard drives have boot sectors usually called MBRs whereas floppies have boot sectors with no MBR, although the two terms are used interchangeably. A partition table is written to the start of each extended partition, when they exist on a hard disk. Linux boot sectors are created by a program called the <I>map installer</I>.</P>

<P>When several partitions are used on a hard disk, they are referred to by Linux as <TT>/dev/hda1</TT>, <TT>/dev/hda2</TT>, and so on. Extended partitions would be numbered <TT>/dev/hda5</TT>, <TT>/dev/hda6</TT>, and so on (because only four primary partitions are allowed). The entire hard disk is called <TT>/dev/hda</TT>. A second hard disk would be <TT>/dev/hdb</TT> (with partitions <TT>/dev/hdb1</TT>, <TT>/dev/hdb2</TT>, and so on). Other letters in the disk names may be used, depending on the type of hard disk and its adapter. For example, a SCSI hard disk may be called <TT>/dev/sda1</TT> instead of <TT>/dev/had</TT> (used for IDE and EIDE drives).</P><P><BR></P>

<CENTER>

<TABLE BORDER>

<TR>

<TD><A HREF="067-070.html">Previous</A></TD>

<TD><A HREF="../ewtoc.html">Table of Contents</A></TD>

<TD><A HREF="072-075.html">Next</A></TD>

</TR>

</TABLE>

</CENTER>





</td>
</tr>
</table>

<!-- begin footer information -->





</body></html>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?