⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ch04.htm

📁 linux-unix130.linux.and.unix.ebooks130 linux and unix ebookslinuxLearning Linux - Collection of 12 E
💻 HTM
📖 第 1 页 / 共 2 页
字号:


<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>

 -->






 











 

















<H1></H1>







<UL>



	<LI><A HREF="#Heading1">- 4 -</A>



	<UL>



		<LI><A HREF="#Heading2">Booting Linux</A>



		<UL>



			<LI><A HREF="#Heading3">System Commander</A>



			<LI><A HREF="#Heading4">Using LILO to Boot off the Hard Disk</A>



			<LI><A HREF="#Heading5">NOTE</A>



			<LI><A HREF="#Heading6">CAUTION</A>



			<UL>



				<LI><A HREF="#Heading7">Installing and Configuring LILO</A>



			</UL>



			<LI><A HREF="#Heading8">Listing 4.1. The /etc/lilo.conf file.</A>



			<LI><A HREF="#Heading9">CAUTION</A>



			<LI><A HREF="#Heading10">NOTE</A>



			<LI><A HREF="#Heading11">NOTE</A>



			<LI><A HREF="#Heading12">Listing 4.2. The /etc/lilo.conf file.</A>



			<LI><A HREF="#Heading13">TIP</A>



			<LI><A HREF="#Heading14">NOTE</A>



			<UL>



				<LI><A HREF="#Heading15">Configuration Parameters</A>



			</UL>



			<LI><A HREF="#Heading16">NOTE</A>



			<UL>



				<LI><A HREF="#Heading17">The boot: Prompt</A>



			</UL>



			<LI><A HREF="#Heading18">TIP</A>



			<UL>



				<LI><A HREF="#Heading19">Updating the Kernel</A>



				<LI><A HREF="#Heading20">Uninstalling LILO</A>



			</UL>



			<LI><A HREF="#Heading21">BOOTLIN</A>



			<LI><A HREF="#Heading22">Summary</A>



		</UL>



	</UL>



</UL>







<P>



<HR SIZE="4">







<H2 ALIGN="CENTER"><A NAME="Heading1<FONT COLOR="#000077">- 4 -</FONT></H2>



<H2 ALIGN="CENTER"><A NAME="Heading2<FONT COLOR="#000077">Booting Linux</FONT></H2>



<P><I>by Kamran Husain</I></P>







<P>IN THIS CHAPTER</P>







<UL>



	<LI>System Commander 



	<P>



	<LI>Using LILO to Boot off the Hard Disk 



	<P>



	<LI>BOOTLIN



</UL>







<P></P>







<P>This chapter covers various topics that basically could not fit in other chapters



and could not justify a chapter by themselves. We cover the following topics briefly



and provide locations where you can get more information:







<UL>



	<LI>Using System Commander



	<P>



	<LI>Booting off the hard drive



	<P>



	<LI>Installing LILO



	<P>



	<LI>Command-line options



	<P>



	<LI>Configuration parameters



	<P>



	<LI>The <TT>boot</TT> prompt



	<P>



	<LI>LILO Uninstallation



	<P>



	<LI>BOOTLIN



</UL>







<H3 ALIGN="CENTER"><A NAME="Heading3<FONT COLOR="#000077">System Commander</FONT></H3>



<P>Before we go on talking about LILO, let's see whether we have any alternatives



to hacking text configuration files and praying for it all to work.</P>



<P>The System Commander product is a very solid alternative to LILO. Yes, this means



that you have to pay money to use it. If time is important to you, use the System



Commander rather than LILO. It's easier to configure and set up. Plus you have great



support from the vendors. The only drawback I see to using System Commander is its



price tag of $99. However, after using it for the first installation with Linux,



Windows NT, and Windows 95 on the same machine, I would have no hesitation in paying



the requisite fees for it.</P>



<P>Boot into DOS off a floppy with CD-ROM drivers on it so that you can access the



System Commander files. If you have the product, use the disk to run the program



<TT>INSTALL.EXE</TT>.</P>



<P>System Commander lets you boot more than one kernel--up to 255, as a matter of



fact. Who wants that many kernels on one machine? The basic idea used by System Commander



is that it takes over the boot record and saves its configuration information in



each of the systems it boots from. The MBR is then &quot;taken over&quot; by the



System Commander software. When you boot, you are presented with a screen of bootable



kernels. Use the arrow keys to select the kernel of choice. Press Enter and you're



done. The System Commander uses the config- uration stored for the kernel you are



booting as its base. The kernel it boots doesn't know the difference.</P>



<P>More information on System Commander is available from the Web site <TT>http://www.v-com.com</TT>



or via telephone at (800) 648-8266. Using System Commander is easier, much easier,



than using LILO. It works with Windows NT, Windows 95, and even OS/2. Check it out.</P>



<P>Now let's get on with the LILO way of booting from the hard disk.



<H3 ALIGN="CENTER"><A NAME="Heading4<FONT COLOR="#000077">Using LILO to Boot



off the Hard Disk</FONT></H3>



<P>LILO is a generic boot loader for Linux written by Werner Almesberger. LILO (Linux



Loader) is a bit tricky to get used to at first, so pay attention to this section.



The Installation program with the Slackware disk installs LILO for you. You should



let the Installation program 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 originator. These programs are provided with most major releases, or you can



get them separately from one of the FTP sites.







<DL>



	<DT></DT>



</DL>











<DL>



	<DD>



<HR>



<A NAME="Heading5<FONT COLOR="#000077"><B>NOTE: </B></FONT>As of LILO Version



	8, a quick install script is available that should make LILO installation quick and



	easy. You can also see the LILO Quickstart Guide, by Matt Welsh, which should be



	available at <TT>sunsite.unc.edu:/pub/Linux/docs</TT>.



<HR>







</DL>











<DL>



	<DT></DT>



</DL>











<DL>



	<DD>



<HR>



<A NAME="Heading6<FONT COLOR="#000077"><B>CAUTION:</B> </FONT>Installing boot



	loaders is very dangerous. Be sure to have some means of booting your system from



	a different medium if you install LILO on your hard disk.



<HR>







</DL>







<P>Following are some of the features and disadvantages of LILO:







<UL>



	<LI>It is independent of the file system. You can use LILO with DOS, UNIX, OS/2,



	and Windows NT.



	<P>



	<LI>It can replace the master boot record on your hard drive.



	<P>



	<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.



	<P>



	<LI>It provides support for boot sector, map file, and boot images to reside on different



	disks or partitions.



	<P>



	<LI>It's a bit hard to configure, but it's free!



</UL>







<H4 ALIGN="CENTER"><A NAME="Heading7<FONT COLOR="#000077">Installing and Configuring



LILO</FONT></H4>



<P>Installing LILO seems frightening at first because it can ruin your hard drive



or leave you with a system into which 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 about which files you wipe away.</P>



<P>You can run the /sbin/liloconfig program and choose the configure option to reset



the values of LILO. The interface is something you will be familiar with after having



installed Linux. However, you will have to wade through selections for other devices



and menus to get to the LILO configuration parts. You can get to LILO configuration



directly by using the <TT>/sbin/liloconfig</TT> command. If you prefer a colorful



version of this program, you can try out <TT>/sbin/liloconfig-color</TT>.</P>



<P>First run <TT>/sbin/liloconfig</TT>. You are presented with the items in the menu



shown in Listing 4.1.



<H3 ALIGN="CENTER"><A NAME="Heading8<FONT COLOR="#000077">Listing 4.1. The



/etc/lilo.conf file.</FONT></H3>



<PRE><FONT COLOR="#0066FF">



# /sbin/liloconfig



mpsi:/sbin# liloconfig







LILO INSTALLATION







LILO (the Linux Loader) is the program that allows booting Linux directly from



the hard drive. To install, you make a new LILO configuration file by creating



a new header and then adding at least one bootable partition to the file. Once



you've done this, you can select the install option. Alternately, if you



already have an /etc/lilo.conf, you may reinstall using that. If you make a



mistake, just select (1) to start over.







1 -- Start LILO configuration with a new LILO header



2 -- Add a Linux partition to the LILO config file



3 -- Add an OS/2 partition to the LILO config file



4 -- Add a DOS partition to the LILO config file



5 -- Install LILO



6 -- Reinstall LILO using the existing lilo.conf



7 -- Skip LILO installation and exit this menu



8 -- View your current /etc/lilo.conf



9 -- Read the Linux Loader HELP file



Which option would you like (1 - 9)?



</FONT></PRE>







<DL>



	<DT><FONT COLOR="#0066FF"></FONT></DT>



</DL>











<DL>



	<DD>



<HR>



<A NAME="Heading9<FONT COLOR="#000077"><B>CAUTION:</B> </FONT>In Chapter 3,



	&quot;Installing Linux,&quot; during the discussion on the installation process,



	I recommended that you install LILO and have the setup program configure it for you.



	If you have already done so, you should be running this LILO installation procedure



	only if you have created a new kernel, added a new hard drive, or added another operating



	system to your Linux hard drive.



<HR>







</DL>







<P>If this is the first time you are installing LILO or if you are about to add a



new partition, you must start with a new header. If you already have LILO on your



machine, select Recycle (option 6) to use your old file. This program is very easy



to use and asks several questions about your system. The sheer number of possibilities



cannot be completely covered here, but following are the terms with which you must



be familiar:







<UL>



	<LI><TT>/dev/hda</TT> and <TT>/dev/hdb</TT> refer to both IDE hard drives 1 and 2



	on your system. Individual partitions on each hard drive are referred to as <TT>/dev/hda1</TT>,



	<TT>/dev/hda2</TT>, <TT>/dev/hda3</TT>, and so on for drive 1. Similarly, <TT>/dev/hdb1</TT>



	and so on for drive 2.



	<P>



	<LI>SCSI hard drives are referred to as <TT>/dev/sda</TT> and <TT>/dev/sdb</TT> for



	physical drives 1 and 2, respectively.



	<P>



	<LI>The Master Boot Record (MBR) is the first boot sector of your drive that contains



	the partitioning information and bootstrap code. LILO changes this sector and makes



	it incompatible with DOS. The DOS MBR program simply loads MS-DOS from the boot sector,



	which in turn loads <TT>command.com</TT>.



	<P>



	<LI>LILO can also install in the <TT>superblock</TT> for the file system with the



	primary Linux partition or onto a floppy disk if you would rather use a floppy disk



	to boot.



</UL>











<DL>



	<DT><B></B></DT>



</DL>











<DL>



	<DD>



<HR>



<A NAME="Heading10<FONT COLOR="#000077"><B>NOTE:</B> </FONT>LILO might not



	be able to work correctly with cylinders greater than 1023 for older disk controllers.



	Choose a lower number for the starting cylinder in case you have an old hard disk



	controller.



<HR>







</DL>











<DL>



	<DT></DT>



</DL>











<DL>



	<DD>



<HR>



<A NAME="Heading11<FONT COLOR="#000077"><B>NOTE:</B> </FONT>LILO's boot program



	can be stored only on the first hard disk.



<HR>







</DL>







<P>After the liloconfig program has run, it creates a file called <TT>lilo.conf</TT>

⌨️ 快捷键说明

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