075-077.html
来自「linux-unix130.linux.and.unix.ebooks130 l」· HTML 代码 · 共 107 行
HTML
107 行
<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=075-077//-->
<!--UNASSIGNED1//-->
<!--UNASSIGNED2//-->
<CENTER>
<TABLE BORDER>
<TR>
<TD><A HREF="072-075.html">Previous</A></TD>
<TD><A HREF="../ewtoc.html">Table of Contents</A></TD>
<TD><A HREF="078-079.html">Next</A></TD>
</TR>
</TABLE>
</CENTER>
<P><BR></P>
<H4 ALIGN="LEFT"><A NAME="Heading10"></A><FONT COLOR="#000077">Using BOOTACTV</FONT></H4>
<P>A slight modification of the last boot process is replacing the MBR with a utility called <TT>BOOTACTV</TT> which prompts for the partition to boot from. This requires a non-DOS–compatible copy of the boot sector to be written, so it should be used only when Linux will be the dominant operating system and when LILO is not booting the other operating systems properly.</P>
<P>When in place, the Master Boot Record holds a copy of <TT>BOOTACTV</TT>. When booted, <TT>BOOTACTV</TT> allows you to make a choice of which operating system to boot. <TT>BOOTACTV</TT> can then read a boot sector from a partition to load that operating system.</P>
<P>To install <TT>BOOTACTV</TT>, follow these steps:</P>
<DL>
<DD><B>1.</B> Boot Linux as usual. Make sure you have a boot floppy disk in case of problems.
<DD><B>2.</B> Copy your existing Master Boot Record to a floppy disk in case of problems. The command to copy the MBR from the main drive (<TT>/dev/hda</TT>) to a floppy using 512 character blocks (the default) is
<!-- CODE SNIP //-->
<PRE>
dd if=/dev/hda of=/fd/MBR bs=512 count=1
</PRE>
<!-- END CODE SNIP //-->
<DD><B>3.</B> Use the setup or LILO installation program to copy LILO into the boot sector of the Linux partition (<I>not</I> the Master Boot Record).
<DD><B>4.</B> Install <TT>BOOTACTV</TT> into the Master Boot Record. The <TT>BOOTACTV </TT>utility is usually called <TT>bootactv.bin</TT> and should be in the current directory when you install it into the MBR with the following command:
<!-- CODE SNIP //-->
<PRE>
dd if=bootactv.bin of=/dev/hda bs=446 count=1
</PRE>
<!-- END CODE SNIP //-->
<DD><B>5.</B> Reboot the machine to boot <TT>BOOTACTV</TT> from the Master Boot Record.
</DL>
<P>Your machine should load <TT>BOOTACTV</TT> and allow you to boot any other operating system on a partition. If Linux or another operating system does not boot, use your boot floppy disk to start Linux. If only Linux doesn’t boot, the boot sector LILO for the Linux partition is not working and can be rewritten using the setup or LILO configuration utilities. If none of the partitions will boot, remove <TT>BOOTACTV</TT> by replacing the old Master Boot Record with the following command:</P>
<!-- CODE SNIP //-->
<PRE>
dd if=/fd/MBR of=/dev/hda bs=446 count=1
</PRE>
<!-- END CODE SNIP //-->
<P>You can also reinstall the Master Boot Record from within DOS, if you have a DOS boot floppy. When in DOS, issue the following command:
</P>
<!-- CODE SNIP //-->
<PRE>
fdisk /mbr
</PRE>
<!-- END CODE SNIP //-->
<BLOCKQUOTE>
<P><FONT SIZE="-1"><HR><B>Tip: </B><BR>If you don’t want to alter your Master Boot Record but have more than one partition dedicated to Linux, you can install <TT>BOOTACTV</TT> on one of the partition’s boot sectors and use the <TT>fdisk</TT> utility to toggle the active partition. However, if the hard disk is repartitioned or the file systems are altered in size, the boot sector has to be rewritten. To write <TT>BOOTACTV</TT> to the fourth primary hard disk partition, for example, copy the existing MBR to the partition’s boot sector, then install <TT>BOOTACTV</TT> with the following commands:
<!-- CODE SNIP //-->
<PRE>
dd if=/dev/hda of=/dev/hda4 bs=512 count=1
dd if=bootactv.bin of=/dev/hda4 bs=446 count=1
</PRE>
<!-- END CODE SNIP //-->
<HR></FONT>
</BLOCKQUOTE>
<H4 ALIGN="LEFT"><A NAME="Heading11"></A><FONT COLOR="#000077">DOS and Linux</FONT></H4>
<P>Most Linux installations coexist with DOS and use the DOS Master Boot Record. In this case, the MBR is read and the active partition (set by <TT>fdisk</TT>) is booted automatically. This is one of the safest installation methods because no changes to the DOS-installed Master Boot Record are performed, and it is easy to remove or reconfigure partitions at any time without worrying about compatibility with the MBR.</P>
<BLOCKQUOTE>
<P><FONT SIZE="-1"><HR><B>Note: </B><BR>Later versions of DOS (6.00 or higher) overwrite an existing MBR if installed after Linux. This makes it impossible to boot Linux from the MBR, although DOS will boot. Fix the problem by running LILO again or by making the Linux partition active.<HR></FONT>
</BLOCKQUOTE>
<P>The active partition can be changed at any time using the <TT>fdisk</TT> utility or the Linux utility <TT>activate</TT>. The setup program within Linux can usually change the boot partition, too. Only one partition on a hard disk can be active at a time. Some operating systems, including Linux, let you change your mind about which operating system to boot after the active partition has been read, assuming a delay was built into the boot process. Linux, for example, can display the <TT>boot:</TT> prompt and wait for a reply or a timeout to occur before starting to boot Linux.</P>
<P>To use this approach for Linux, simply install LILO into the boot sector of the Linux partition. To make it bootable, run <TT>fdisk</TT> and set that partition number as the active partition. Rebooting the machine will boot into the active partition.</P>
<P>When Linux is replaced or removed, the boot sector of the new operating system overwrites the Linux partition’s boot sector, requiring no changes to the MBR.</P><P><BR></P>
<CENTER>
<TABLE BORDER>
<TR>
<TD><A HREF="072-075.html">Previous</A></TD>
<TD><A HREF="../ewtoc.html">Table of Contents</A></TD>
<TD><A HREF="078-079.html">Next</A></TD>
</TR>
</TABLE>
</CENTER>
</td>
</tr>
</table>
<!-- begin footer information -->
</body></html>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?