294 lines
12 KiB
HTML
294 lines
12 KiB
HTML
<!--startcut ======================================================= -->
|
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
|
|
<html>
|
|
<head>
|
|
<META NAME="generator" CONTENT="lgazmail v1.1F.i">
|
|
<TITLE>The Answer Guy 35: How Many Ways Can I Boot Thee: Let Me Count Them</TITLE>
|
|
</HEAD><BODY BGCOLOR="#FFFFFF" TEXT="#000000"
|
|
LINK="#3366FF" VLINK="#A000A0">
|
|
<!-- ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: -->
|
|
<H4>"The Linux Gazette...<I>making Linux just a little more fun!</I>"</H4>
|
|
<P> <hr> <P>
|
|
<!-- ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: -->
|
|
<center>
|
|
<H1><A NAME="answer">
|
|
<img src="../../gx/dennis/qbubble.gif" alt="(?)" border="0" align="middle">
|
|
<font color="#B03060">The Answer Guy</font>
|
|
<img src="../../gx/dennis/bbubble.gif" alt="(!)" border="0" align="middle">
|
|
</A></H1>
|
|
<BR>
|
|
<H4>By James T. Dennis,
|
|
<a href="mailto:linux-questions-only@ssc.com">linux-questions-only@ssc.com</a><BR>
|
|
Starshine Technical Services,
|
|
<A HREF="http://www.starshine.org/">http://www.starshine.org/</A>
|
|
</H4>
|
|
</center>
|
|
|
|
<p><hr><p>
|
|
<!-- ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: -->
|
|
<H3 align="left"><img src="../../gx/dennis/qbubble.gif" height="50" width="60"
|
|
alt="(?) " border="0">How Many Ways Can I Boot Thee:
|
|
Let Me Count Them</H3>
|
|
|
|
|
|
<p><strong>From Wilke Havinga on Tue, 17 Nov 1998
|
|
(from the L.U.S.T List)</strong></p>
|
|
<!-- begin 17 -->
|
|
<P><STRONG><FONT COLOR="#000099"><EM>
|
|
<BR>>I understand that Linux cannot be on the slave drive.
|
|
</EM></FONT></STRONG></P>
|
|
<BLOCKQUOTE><IMG SRC="../../gx/dennis/bbub.gif" alt="(!)"
|
|
HEIGHT="28" WIDTH="50" BORDER="0"
|
|
>
|
|
You misunderstand. Linux can be installed on most
|
|
combinations of devices. You can have the kernel on any
|
|
drive where your loader can find it (for LILO that means
|
|
anywhere that your BIOS can access, for LOADLIN.EXE --- a
|
|
DOS program that means anywhere that DOS can access).
|
|
</BLOCKQUOTE>
|
|
<BLOCKQUOTE>
|
|
You could put your kernel completely outside of any
|
|
filesystem, laying it out at some arbitrary location on some
|
|
hard disk. So long as you can get your loader code to find
|
|
it --- you can load that kernel. (You could use the
|
|
<TT>/sbin/lilo</TT> utility to prepare this particular set of LILO
|
|
boot blocks and maps --- since it needs to find the kernel
|
|
image and it's a linux program. However you could hand
|
|
craft your own maps if you were really determined to have
|
|
a kernel laying on the unused portion of track zero or
|
|
on some part of your disk that was between or after the
|
|
defined partitions).
|
|
</BLOCKQUOTE>
|
|
<BLOCKQUOTE>
|
|
Once the kernel is loaded it looks for a root filesystem.
|
|
For any given kernel there is a compiled-in default.
|
|
This can be modified using the 'rdev' command (which
|
|
performs a binary patch of the kernel image). It can
|
|
also be overridden by supplying the kernel with a
|
|
command line parameter (root=). There are a number
|
|
of kernel command line parameters (all of the form:
|
|
option=value) --- these can be passed to it via the LILO
|
|
"prompt" or the <TT>/etc/lilo.conf</TT> append= directive, or on
|
|
the LOADLIN command line (among others).
|
|
</BLOCKQUOTE>
|
|
<BLOCKQUOTE>
|
|
Read the BootParam HOWTO and man page (section 7 of the
|
|
man pages) for details about kernel parameters.
|
|
</BLOCKQUOTE>
|
|
<BLOCKQUOTE>
|
|
You can boot a kernel directly from a floppy (just dd the
|
|
kernel image to the raw floppy). You can also use LILO on a
|
|
floppy. You can create a bootable DOS floppy with a copy of
|
|
LOADLIN and a linux kernel on it (with an AUTOEXEC.BAT if
|
|
you like). You can even use the SYSLINUX package (available
|
|
as DOS and linux binaries). This modifies a (non-bootable)
|
|
DOS formatted floppy to boot a Linux kernel (and is used by
|
|
the Linux Router Project and <A HREF="http://www.redhat.com/">Red Hat</A>
|
|
boot diskettes).
|
|
</BLOCKQUOTE>
|
|
<BLOCKQUOTE>
|
|
It is also possible to boot Linux from some sorts of
|
|
FlashROM and ROMdisk emulators and from other forms of ROM
|
|
installation. You can even boot Linux across a network
|
|
using a boot prom for those ethernet cards that support them
|
|
(for example).
|
|
</BLOCKQUOTE>
|
|
<BLOCKQUOTE>
|
|
Igel makes PC hardware with embedded versions of Linux for
|
|
their line of X terminals, thin clients and
|
|
"Ethermulation"<TT>/</TT>"Etherterminals" (thse boot from flash).
|
|
<A HREF="http://www.igelusa.com">http://www.igelusa.com</A>.
|
|
Also there are many discussions of
|
|
alternative boot methods and devices that are regularly
|
|
discussed on the "Embedded Linux" mailing list at
|
|
'<A HREF="http://www.waste.org/mail/?list=linux-embedded"
|
|
>http://www.waste.org/mail/?list=linux-embedded</A>'
|
|
</BLOCKQUOTE>
|
|
<P><STRONG><FONT COLOR="#000099"><EM><IMG SRC="../../gx/dennis/qbub.gif"
|
|
ALT="(?)" HEIGHT="28" WIDTH="50" BORDER="0"
|
|
>
|
|
<BR>>Hmm... That's odd, because I have Linux on a slave HD right here on this
|
|
<BR>>computer and it works fine. I'm certain it doesn't have trouble getting
|
|
<BR>>at drives on the secondary controller, either.
|
|
</EM></FONT></STRONG></P>
|
|
<P><STRONG><FONT COLOR="#000066"><EM>
|
|
Booting with LILO? Or Loadlin?
|
|
</EM></FONT></STRONG></P>
|
|
<P><STRONG><FONT COLOR="#000066"><EM>
|
|
[prior partition dicussion snipped]
|
|
Don't forget, Linux needs a swap partition.
|
|
</EM></FONT></STRONG></P>
|
|
<P><STRONG>
|
|
This is not entirely true, if you have enough RAM (like, >64MB will be
|
|
enough for most people) you don't need one. It's only that RedHat requires
|
|
you to have one (which I find pretty annoying sometimes because you can
|
|
have only 4 partitions on a drive, especially on large drives).
|
|
</STRONG></P>
|
|
<BLOCKQUOTE><IMG SRC="../../gx/dennis/bbub.gif" alt="(!)"
|
|
HEIGHT="28" WIDTH="50" BORDER="0"
|
|
>
|
|
While technically you are correct, you don't <EM>need</EM> a swap
|
|
partition, this is bad advice.
|
|
</BLOCKQUOTE>
|
|
<BLOCKQUOTE>
|
|
You'll find that you performance suffers dramatically
|
|
without one. Although I make a couple of 64M swap
|
|
partitions available on my system (allowing Linux to load
|
|
balance across a couple of spindles if it should ever need
|
|
to), it typically used about 30K of swap even when I have
|
|
plenty of RAM free (most of it is used in file/cache
|
|
buffering).
|
|
</BLOCKQUOTE>
|
|
<BLOCKQUOTE>
|
|
Read the kernel list archives and search for the term "swap"
|
|
and you'll find that the consensus among the kernel
|
|
developers is that you <EM>need</EM> swap to get decent performance
|
|
out of the current kernels. Some have even reported that
|
|
using 100 or 200K RAM disk with a swap <EM>file</EM> on it will
|
|
dramatically improve the performance over using all of your
|
|
memory as straight RAM.
|
|
</BLOCKQUOTE>
|
|
<BLOCKQUOTE>
|
|
So, Red Hat's insistence may be irritating --- but it is
|
|
not wholly without cause.
|
|
</BLOCKQUOTE>
|
|
<BLOCKQUOTE>
|
|
You are wrong about the number of permitted partitions
|
|
per drive. You can have four <EM>primary</EM> partition entries.
|
|
One of those can be an "extended" partition. That extended
|
|
partition can have "lots" of partitions. Let's look at
|
|
an example from 'antares', my decade old 386DX33 with
|
|
32Mb of RAM and a full SCSI chain:
|
|
</BLOCKQUOTE>
|
|
<blockquote><pre>Disk /dev/hda: 16 heads, 38 sectors, 683 cylinders
|
|
Units = cylinders of 608 * 512 bytes
|
|
|
|
Device Boot Begin Start End Blocks Id System
|
|
/dev/hda1 * 1 1 107 32509 4 DOS 16-bit <32M
|
|
/dev/hda2 108 108 684 175408 a5 BSD/386
|
|
</pre></blockquote><BLOCKQUOTE>
|
|
.... and old <A HREF="http://www.freebsd.org/">FreeBSD</A> partition that I haven't used
|
|
in a couple of years. This is the boot drive. I use
|
|
LOADLIN to get into Linux.
|
|
</BLOCKQUOTE>
|
|
<blockquote><pre>Disk /dev/sda: 64 heads, 32 sectors, 1908 cylinders
|
|
Units = cylinders of 2048 * 512 bytes
|
|
|
|
Device Boot Begin Start End Blocks Id System
|
|
/dev/sda1 * 1 1 32 32098+ 83 Linux native
|
|
/dev/sda2 5 32 102 72292+ 82 Linux swap
|
|
/dev/sda3 14 102 1907 1847475 5 Extended
|
|
/dev/sda5 14 103 236 136521 83 Linux native
|
|
/dev/sda6 31 236 495 265041 83 Linux native
|
|
/dev/sda7 64 495 1248 771088+ 83 Linux native
|
|
/dev/sda8 1184 1248 1907 674698+ 83 Linux native
|
|
</pre></blockquote><BLOCKQUOTE>
|
|
Whoa nelly! I have 3 <EM>primary</EM> partitions: 1 2 3 ---
|
|
the third defined the entended partition. Therein
|
|
I have 5, 6, 7, and 8 --- another four partition on
|
|
that same drive. I think I've gone upto 10 at least
|
|
once --- though I don't know of a limit to these extensions.
|
|
</BLOCKQUOTE>
|
|
<blockquote><pre>Disk /dev/sdb: 64 heads, 32 sectors, 532 cylinders
|
|
Units = cylinders of 2048 * 512 bytes
|
|
|
|
Device Boot Begin Start End Blocks Id System
|
|
/dev/sdb1 1 1 17 17392 83 Linux native
|
|
/dev/sdb2 18 18 532 527360 5 Extended
|
|
/dev/sdb5 18 18 532 527344 83 Linux native
|
|
</pre></blockquote><BLOCKQUOTE>
|
|
Lookie! A disk with two primaries, one defining an
|
|
extended partition that contains a single Linux fs.
|
|
</BLOCKQUOTE>
|
|
<blockquote><pre>Disk /dev/sdc: 64 heads, 32 sectors, 2063 cylinders
|
|
Units = cylinders of 2048 * 512 bytes
|
|
|
|
Device Boot Begin Start End Blocks Id System
|
|
/dev/sdc1 1 1 2063 2112496 83 Linux native
|
|
</pre></blockquote><BLOCKQUOTE>
|
|
... Oh. One that just has one partition on it.
|
|
</BLOCKQUOTE>
|
|
<BLOCKQUOTE>
|
|
(The rest of this SCSI chain consists of a CD, a CDR,
|
|
a 4mm DAT autochanger tape drive, and an old magneto
|
|
optical drive).
|
|
</BLOCKQUOTE>
|
|
<P><STRONG><IMG SRC="../../gx/dennis/qbub.gif" ALT="(?)"
|
|
HEIGHT="28" WIDTH="50" BORDER="0"
|
|
>
|
|
So if you intend to run RedHat (which is probably the easiest to install)
|
|
you need 2 partitions for Linux indeed.
|
|
</STRONG></P>
|
|
<BLOCKQUOTE><IMG SRC="../../gx/dennis/bbub.gif" alt="(!)"
|
|
HEIGHT="28" WIDTH="50" BORDER="0"
|
|
>
|
|
Yes. However, you can just put these in extended
|
|
partitions (one primary partition is labeled as "the
|
|
'extended' partition" --- then all partitions defined
|
|
within that are called "extended partitions" --- an
|
|
irritating bit of terminology that serves to confuse).
|
|
</BLOCKQUOTE>
|
|
<P><STRONG><IMG SRC="../../gx/dennis/qbub.gif" ALT="(?)"
|
|
HEIGHT="28" WIDTH="50" BORDER="0"
|
|
>
|
|
Wilke Havinga
|
|
</STRONG></P>
|
|
<BLOCKQUOTE><IMG SRC="../../gx/dennis/bbub.gif" alt="(!)"
|
|
HEIGHT="28" WIDTH="50" BORDER="0"
|
|
>
|
|
I hope that helps.
|
|
</BLOCKQUOTE>
|
|
|
|
<!-- end 17 -->
|
|
<!--startcut ======================================================= -->
|
|
<P> <hr> <P>
|
|
<H5 align="center"><a href="http://www.linuxgazette.com/copying.html"
|
|
>Copyright ©</a> 1998, James T. Dennis
|
|
<BR>Published in <I>The Linux Gazette</I> Issue 35 December 1998</H5>
|
|
<P> <hr> <P>
|
|
<!--::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::-->
|
|
<TABLE WIDTH="96%"><TR VALIGN="center" ALIGN="center">
|
|
<TD ROWSPAN="3" COLSPAN="3" WIDTH="26%"><A HREF="../lg_answer35.html"
|
|
><IMG SRC="../../gx/dennis/answernew.gif"
|
|
ALT="[ Answer Guy Index ]"></A></td>
|
|
<TD WIDTH="14%"><A HREF="office.html">office</A></TD>
|
|
<TD WIDTH="14%"><A HREF="largedisk.html">largedisk</A></TD>
|
|
<TD WIDTH="14%"><A HREF="links.html">links</A></TD>
|
|
<TD WIDTH="14%"><A HREF="yamaha.html">yamaha</A></TD>
|
|
<TD WIDTH="14%"><A HREF="magickeys.html">magickeys</A></TD>
|
|
</TR><TR VALIGN="center" ALIGN="center">
|
|
<TD><A HREF="passwd.html">passwd</A></TD>
|
|
<TD><A HREF="ftproot.html">ftproot</A></TD>
|
|
<TD><A HREF="pvtmail.html">pvtmail</A></TD>
|
|
<TD><A HREF="netware.html">netware</A></TD>
|
|
<TD><A HREF="crypto.html">crypto</A></TD>
|
|
</TR><TR VALIGN="center" ALIGN="center">
|
|
<TD><A HREF="relay.html">relay</A></TD>
|
|
<TD><A HREF="project.html">project</A></TD>
|
|
<TD><A HREF="bootmethod.html">bootmethod</A></TD>
|
|
<TD><A HREF="sysadmin.html">sysadmin</A></TD>
|
|
<TD><A HREF="ipscript.html">ipscript</A></TD>
|
|
</TR><TR VALIGN="center" ALIGN="center">
|
|
<TD><A HREF="loopfs.html">loopfs</A></TD>
|
|
<TD><A HREF="mrtg.html">mrtg</A></TD>
|
|
<TD><A HREF="slimscan.html">slimscan</A></TD>
|
|
<TD><A HREF="rpm.html">rpm</A></TD>
|
|
<TD><A HREF="egg.html">modutil</A></TD>
|
|
<TD><A HREF="libc.html">libc</A></TD>
|
|
<TD><A HREF="dell.html">dell</A></TD>
|
|
<TD><A HREF="remoteroot.html">remoteroot</A></TD>
|
|
</TR></TABLE>
|
|
<P> <hr> <P>
|
|
<!-- ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: -->
|
|
<A HREF="../index.html"
|
|
><IMG SRC="../../gx/indexnew.gif" ALT="[ Table Of Contents ]"></A>
|
|
<A HREF="../../index.html"
|
|
><IMG SRC="../../gx/homenew.gif" ALT="[ Front Page ]"></A>
|
|
<A HREF="../lg_bytes35.html"
|
|
><IMG SRC="../../gx/back2.gif" ALT="[ Previous Section ]"></A>
|
|
<A HREF="../anderson.html"
|
|
><IMG SRC="../../gx/fwd.gif" ALT="[ Next Section ]"></A>
|
|
<!-- ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: -->
|
|
</BODY></HTML>
|
|
<!--endcut ========================================================= -->
|