Files
oldlinux-files/docs/Install-Guide/install-guide-2.2.2/node164.html
2024-02-19 00:23:35 -05:00

109 lines
5.4 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3O//DTD W3 HTML 2.0//EN">
<!Converted with LaTeX2HTML 95.1 (Fri Jan 20 1995) by Nikos Drakos (nikos@cbl.leeds.ac.uk), CBLU, University of Leeds >
<HEAD>
<TITLE>4.2.2 Using LILO</TITLE>
</HEAD>
<BODY>
<meta name="description" value="4.2.2 Using LILO">
<meta name="keywords" value="gs">
<meta name="resource-type" value="document">
<meta name="distribution" value="global">
<P>
<BR> <HR><A NAME=tex2html3860 HREF="node165.html"><IMG ALIGN=BOTTOM ALT="next" SRC="next_motif.gif"></A> <A NAME=tex2html3858 HREF="node162.html"><IMG ALIGN=BOTTOM ALT="up" SRC="up_motif.gif"></A> <A NAME=tex2html3854 HREF="node163.html"><IMG ALIGN=BOTTOM ALT="previous" SRC="previous_motif.gif"></A> <A NAME=tex2html3862 HREF="node1.html"><IMG ALIGN=BOTTOM ALT="contents" SRC="contents_motif.gif"></A> <A NAME=tex2html3863 HREF="node250.html"><IMG ALIGN=BOTTOM ALT="index" SRC="index_motif.gif"></A> <BR>
<B> Next:</B> <A NAME=tex2html3861 HREF="node165.html">4.3 Shutting Down</A>
<B>Up:</B> <A NAME=tex2html3859 HREF="node162.html">4.2 Booting the System </A>
<B> Previous:</B> <A NAME=tex2html3855 HREF="node163.html">4.2.1 Using a boot </A>
<BR> <HR> <P>
<H2><A NAME=SECTION00622000000000000000>4.2.2 Using LILO</A></H2>
<A NAME=seclilo>&#160;</A>
<P>
<A NAME=4276>&#160;</A>
<A NAME=4277>&#160;</A>
Another method of booting is to use LILO, a program which resides in the
boot sector of your hard disk. This program is executed when the system is
booted from the hard disk, and can automatically boot up Linux from a kernel
image stored on the hard drive itself.
<P>
<A NAME=4278>&#160;</A>
<A NAME=4279>&#160;</A>
<A NAME=4280>&#160;</A>
LILO can also be used as a first-stage boot loader for several operating
systems, allowing you to select at boot time which operating system (such
as Linux or MS-DOS) to boot. When you boot using LILO, the default
operating system is booted unless you press <IMG BORDER=0 ALIGN=BOTTOM ALT="" SRC="img244.gif">, <IMG BORDER=0 ALIGN=BOTTOM ALT="" SRC="img245.gif">, or
<IMG BORDER=0 ALIGN=BOTTOM ALT="" SRC="img246.gif"> during the bootup sequence. If you press any of these keys,
you will be provided with a boot prompt, at which you type the name of
the operating system to boot (such as ``<tt>linux</tt>'' or ``<tt>msdos</tt>'').
If you press <IMG BORDER=0 ALIGN=BOTTOM ALT="" SRC="img247.gif"> at the boot prompt, a listing of available
operating systems will be provided.
<P>
<A NAME=4287>&#160;</A>
The easy way to install LILO is to edit the configuration file,
<tt>/etc/lilo.conf</tt>,
and then run the command
<P><TT> # <em>/sbin/lilo</em>
<P></TT>
<P>
The LILO configuration file contains a ``stanza'' for each operating
system that you want to boot. The best way to demonstrate this is with
an example LILO config file. The below setup is for a system which has
a Linux root partition on <tt>/dev/hda1</tt>, and an MS-DOS partition on
<tt>/dev/hda2</tt>.
<P>
<P><TT> <PRE># Tell LILO to modify the boot record on /dev/hda (the first
# non-SCSI hard drive). If you boot from a drive other than /dev/hda,
# change the following line.
boot = /dev/hda
# Name of the boot loader. No reason to modify this unless you're doing
# some serious hacking on LILO.
install = /boot/boot.b
# Have LILO perform some optimization.
compact
# Stanza for Linux root partition on /dev/hda1.
image = /etc/Image # Location of kernel
label = linux # Name of OS (for the LILO boot menu)
root = /dev/hda1 # Location of root partition
vga = ask # Tell kernel to ask for SVGA modes at boot time
# Stanza for MSDOS partition on /dev/hda2.
other = /dev/hda2 # Location of partition
table = /dev/hda # Location of partition table for /dev/hda2
label = msdos # Name of OS (for boot menu)
</PRE> <P></TT>
<P>
<A NAME=4296>&#160;</A>
<A NAME=4297>&#160;</A>
The first operating system stanza in the config file will be the default
OS for LILO to boot. You can select another OS to boot at the LILO boot
prompt, as discussed above.
<P>
Remember that every time you update the kernel image on disk,
you should rerun <tt>/sbin/lilo</tt> in order for the changes to be
reflected on the boot sector of your drive.
<P>
Also note that if you use the ``<tt>root =</tt>'' line, above, there's no
reason to use <tt>rdev</tt> to set the root partition in the kernel image.
LILO sets it for you at boot time.
<P>
The Linux FAQ (see Appendix <A HREF="node225.html#appinfo">A</A>) provides more information on
LILO, including how to use LILO to boot with OS/2's Boot Manager.
<A NAME=4302>&#160;</A>
<A NAME=4303>&#160;</A>
<A NAME=4304>&#160;</A>
<A NAME=4305>&#160;</A>
<P>
<BR> <HR><A NAME=tex2html3860 HREF="node165.html"><IMG ALIGN=BOTTOM ALT="next" SRC="next_motif.gif"></A> <A NAME=tex2html3858 HREF="node162.html"><IMG ALIGN=BOTTOM ALT="up" SRC="up_motif.gif"></A> <A NAME=tex2html3854 HREF="node163.html"><IMG ALIGN=BOTTOM ALT="previous" SRC="previous_motif.gif"></A> <A NAME=tex2html3862 HREF="node1.html"><IMG ALIGN=BOTTOM ALT="contents" SRC="contents_motif.gif"></A> <A NAME=tex2html3863 HREF="node250.html"><IMG ALIGN=BOTTOM ALT="index" SRC="index_motif.gif"></A> <BR>
<B> Next:</B> <A NAME=tex2html3861 HREF="node165.html">4.3 Shutting Down</A>
<B>Up:</B> <A NAME=tex2html3859 HREF="node162.html">4.2 Booting the System </A>
<B> Previous:</B> <A NAME=tex2html3855 HREF="node163.html">4.2.1 Using a boot </A>
<BR> <HR> <P>
<BR> <HR>
<P><ADDRESS>
<I>Matt Welsh <BR>
mdw@sunsite.unc.edu</I>
</ADDRESS>
</BODY>