home *** CD-ROM | disk | FTP | other *** search
/ Magazyn Enter 1999 June / enter_06_1999.iso / doc / HOWTO / Installation-HOWTO < prev    next >
Text File  |  1998-10-14  |  59KB  |  1,453 lines

  1.   The Linux Installation HOWTO
  2.   by Eric S. Raymond
  3.   v4.13, 30 August 1998
  4.  
  5.   This document describes how to obtain and install Linux software.  It
  6.   is the first document which a new Linux user should read to get
  7.   started.
  8.   ______________________________________________________________________
  9.  
  10.   Table of Contents
  11.  
  12.  
  13.   1. Introduction
  14.  
  15.      1.1 Purpose of this document
  16.      1.2 Other sources of information
  17.      1.3 New versions of this document
  18.      1.4 Feedback and Corrections
  19.  
  20.   2. Recent Changes
  21.  
  22.   3. The Easiest Option: Buy, Don't Build
  23.  
  24.   4. Before You Begin
  25.  
  26.      4.1 Hardware requirements
  27.      4.2 Space requirements and coexistence
  28.      4.3 Choosing a Linux distribution
  29.  
  30.   5. Installation Overview
  31.  
  32.      5.1 Basic Installation Steps
  33.      5.2 Basic Parts of an Installation Kit
  34.  
  35.   6. Installation In Detail
  36.  
  37.      6.1 Getting prepared for installation
  38.      6.2 Creating the boot and root floppies
  39.      6.3 Repartitioning your DOS/Windows drives
  40.      6.4 Creating partitions for Linux
  41.         6.4.1 Partition basics
  42.         6.4.2 Sizing partitions
  43.      6.5 Booting the installation disk
  44.      6.6 Using the rootdisk
  45.         6.6.1 Choosing EGA or X installation
  46.         6.6.2 Using
  47.         6.6.3 Post-partition steps
  48.      6.7 Installing software packages
  49.      6.8 After package installations
  50.         6.8.1 LILO, the LInux LOader
  51.         6.8.2 Making a production boot disk (optional)
  52.         6.8.3 Miscellaneous system configuration
  53.  
  54.   7. Booting Your New System
  55.  
  56.   8. After Your First Boot
  57.  
  58.      8.1 Beginning System Administratration
  59.      8.2 Custom LILO Configuration
  60.  
  61.   9. Administrivia
  62.  
  63.      9.1 Terms of Use
  64.      9.2 Acknowledgements
  65.  
  66.  
  67.   ______________________________________________________________________
  68.  
  69.   1.  Introduction
  70.  
  71.  
  72.  
  73.   1.1.  Purpose of this document
  74.  
  75.   Linux is a freely-distributable implementation of Unix for inexpensive
  76.   personal machines (it was developed on 386s, and now supports 486,
  77.   586, Pentium, PowerPC, Sun Sparc and DEC Alpha hardware). It supports
  78.   a wide range of software, including X Windows, Emacs, TCP/IP
  79.   networking (including SLIP), and many applications.
  80.  
  81.   This document assumes that you have heard of and know about Linux, and
  82.   now want to get it running.  It focuses on the Intel base version,
  83.   which is the most popular, but much of the advice applies on Power
  84.   PCs, Sparcs and Alphas as well.
  85.  
  86.  
  87.   1.2.  Other sources of information
  88.  
  89.   If you are new to Linux, there are several sources of basic
  90.   information about the system. The best place to find these is at the
  91.   Linux Documentation Project home page at
  92.   <http://sunsite.unc.edu/LDP/linux.html>.  You can find the latest, up-
  93.   to-date version of this document there, as
  94.   <http://sunsite.unc.edu/LDP/HOWTO/Installation-HOWTO.html>
  95.  
  96.   You should probably start by browsing the resources under General
  97.   Linux Information; the Linux INFO-SHEET
  98.   <http://sunsite.unc.edu/LDP/HOWTO/INFO-SHEET.html> and the Linux META-
  99.   FAQ <http://sunsite.unc.edu/LDP/HOWTO/META-FAQ.html>.  The `Linux
  100.   Frequently Asked Questions' document contains many common questions
  101.   (and answers!) about Linux---it is a ``must read'' for new users.
  102.  
  103.   You can find help for common problems on the USENET newsgroups
  104.   comp.os.linux.help and comp.os.linux.announce.
  105.  
  106.   The Linux Documentation Project is writing a set of manuals and books
  107.   about Linux, all of which are freely distributable on the net and
  108.   available from the LDP home page.
  109.  
  110.   The book ``Linux Installation and Getting Started'' is a complete
  111.   guide to getting and installing Linux, as well as how to use the
  112.   system once you've installed it. It contains a complete tutorial to
  113.   using and running the system, and much more information than is
  114.   contained here.  You can browse it, or download a copy, from the LDP
  115.   home page.
  116.  
  117.   Finally, there is a rather technical Guide to x86  Bootstrapping
  118.   <http://www.paranoia.com/~vax/boot.html>.  This document is NetBSD-
  119.   rather than Linux-oriented, but contains useful material on disk
  120.   configuration and boot managers for multi-OS setups.
  121.  
  122.  
  123.   1.3.  New versions of this document
  124.  
  125.   New versions of the Linux Installation HOWTO will be periodically
  126.   posted to comp.os.linux.help and  and news.answers <news:answers>.
  127.   They will also be uploaded to various Linux WWW and FTP sites,
  128.   including the LDP home page.
  129.  
  130.   You can also view the latest version of this on the World Wide Web via
  131.   the URL <http://sunsite.unc.edu/LDP/HOWTO/Installation-HOWTO.html>.
  132.  
  133.   1.4.  Feedback and Corrections
  134.  
  135.   If you have questions or comments about this document, please feel
  136.   free to mail Eric S. Raymond, at esr@thyrsus.com. I welcome any
  137.   suggestions or criticisms. If you find a mistake with this document,
  138.   please let me know so I can correct it in the next version. Thanks.
  139.  
  140.   Please do not mail me questions about how to solve hardware problems
  141.   encountered during installation.  Consult ``Linux Installation and
  142.   Getting Started'', bug your vendor, or consult the Linux newsgroup
  143.   comp.os.linux.setup.  This HOWTO is intended to be rapid, painless
  144.   guide to normal installation -- a separate HOWTO on hardware problems
  145.   and diagnosis is in preparation.
  146.  
  147.  
  148.   2.  Recent Changes
  149.  
  150.  
  151.   ╖  Added the `Buy, Don't Build'.
  152.  
  153.  
  154.   3.  The Easiest Option: Buy, Don't Build
  155.  
  156.   Linux has now matured enough that there are now system integrators who
  157.   will assemble a workstation for you, install and configure a Linux,
  158.   and do an intensive burn-in to test it before it's shipped to you.  If
  159.   you have more money than time, or you have stringent reliability or
  160.   performance requirements, these integrators provide a valuable service
  161.   by making sure you won't get hardware that's flaky or dies two days
  162.   out of the box.
  163.  
  164.   There are several firms of this kind (and I'll list them here as I
  165.   learn more about them).  The only such outfit I know about personally
  166.   is VA Research <http://www.varesearch.com>.  These good people build
  167.   high-end, high quality Linux workstations with a nifty Tux-the-penguin
  168.   logo on the front.  They have intimate ties to the Linux community
  169.   (the Debian project <http://www.debian.org> lives on a machine in
  170.   their back room, Linus owns one of their boxes, and they even throw
  171.   resources at your humble HOWTO maintainer occasionally).
  172.  
  173.   For those of us without a champagne budget, the rest of this HOWTO is
  174.   about how to install Linux yourself.
  175.  
  176.  
  177.   4.  Before You Begin
  178.  
  179.   Before you can install Linux, you'll need to be sure your machine is
  180.   Linux-capable, and choose a Linux to install.  The Linux Pre-
  181.   installation checklist <http://members.tripod.com/~algolog/lnxchk.htm>
  182.   may help you organize configuration data before you begin.
  183.  
  184.  
  185.   4.1.  Hardware requirements
  186.  
  187.   What kind of system is needed to run Linux? This is a good question;
  188.   the actual hardware requirements for the system change periodically.
  189.   The Linux Hardware-HOWTO,  <http://sunsite.unc.edu/LDP/HOWTO/Hardware-
  190.   HOWTO.html>, gives a (more or less) complete listing of hardware
  191.   supported by Linux. The Linux INFO-SHEET,
  192.   <http://sunsite.unc.edu/LDP/HOWTO/INFO-SHEET.html>, provides another
  193.   list.
  194.  
  195.   For the Intel versions, a hardware configuration that looks like the
  196.   following is required:
  197.  
  198.  
  199.   Any 80386, 80486, Pentium or Pentium II processor will do.  Non-Intel
  200.   clones of the 80386 and up will generally work. You do not need a math
  201.   coprocessor, although it is nice to have one.
  202.  
  203.   The ISA, EISA, VESA Local Bus and PCI bus architectures are supported.
  204.   The MCA bus architecture (found on IBM PS/2 machines) is supported in
  205.   the newest development (2.1.x) kernels, but may not be ready for prime
  206.   time yet.
  207.  
  208.   You need at least 4 megabytes of memory in your machine. Technically,
  209.   Linux will run with only 2 megs, but most installations and software
  210.   require 4. The more memory you have, the happier you'll be. I suggest
  211.   8 or 16 megabytes if you're planning to use X-Windows.
  212.  
  213.   Of course, you'll need a hard drive and an AT-standard drive
  214.   controller. All MFM, RLL, and IDE drives and controllers should work.
  215.   Many SCSI drives and adaptors are supported as well; the Linux SCSI-
  216.   HOWTO contains more information on SCSI.  If you are assembling a
  217.   system from scratch to run Linux, the small additional cost of SCSI is
  218.   well worth it for the extra performance and reliability it brings.
  219.  
  220.   You will need a 3.5" floppy drive.  While 5.25" floppies are supported
  221.   under Linux, they are little-enough used that you should not count on
  222.   disk images necessarily fitting on them.  (A stripped-down Linux can
  223.   actually run on a single floppy, but that's only useful for
  224.   installation and certain troubleshooting tasks.)
  225.  
  226.   You also need an MDA, Hercules, CGA, EGA, VGA, or Super VGA video card
  227.   and monitor.  In general, if your video card and monitor work under
  228.   MS-DOS then it should work under Linux. However, if you wish to run X
  229.   Windows, there are other restrictions on the supported video hardware.
  230.   The Linux XFree86-HOWTO,
  231.   <http://sunsite.unc.edu/LDP/HOWTO/XFree86-HOWTO.html>, contains more
  232.   information about running X and its requirements.
  233.  
  234.   You'll want a CD-ROM drive.  If it's ATAPI, SCSI, or true IDE you
  235.   should have no problem making it work (but watch for cheap drives
  236.   advertising "IDE" interfaces that aren't true IDE).  If your CD-ROM
  237.   uses a proprietary interface card, it's possible the installation
  238.   kernel you're going to boot from floppy won't be able to see it -- and
  239.   an inaccessible CD-ROM is a installation show-stopper.  Also, CD-ROMs
  240.   that attach to your parallel port won't work at all.  If you're in
  241.   doubt, consult the Linux CD-ROM HOWTO,
  242.   <http://sunsite.unc.edu/LDP/HOWTO/CDROM-HOWTO.html> for a list and
  243.   details of supported hardware.
  244.  
  245.   So-called "Plug'n'Play" jumperless cards can be a problem.  Support
  246.   for these is under active development, but not there yet in the 2.0.25
  247.   kernel.  Fortunately this is only likely to be a problem with sound or
  248.   Ethernet cards.
  249.  
  250.   If you're running on a box that uses one of the Motorola 68K
  251.   processors (including Amiga, Atari, or VMEbus machines), see the
  252.   Linux/m68k FAQ at
  253.   <http://www.clark.net/pub/lawrencc/linux/faq/faq.html> for information
  254.   on minimum requirements and the state of the port.  The FAQ now says
  255.   m68k Linux is as stable and usable as the Intel versions.
  256.  
  257.  
  258.   4.2.  Space requirements and coexistence
  259.  
  260.   You'll need free space for Linux on your hard drive. The amount of
  261.   space needed depends on how much software you plan to install. Most
  262.   installations require somewhere in the ballpark of 200 to 500 megs.
  263.   This includes space for the software, swap space (used as virtual RAM
  264.   on your machine), and free space for users, and so on.
  265.   It's conceivable that you could run a minimal Linux system in 80 megs
  266.   or less (this used to be common when Linux distributions were
  267.   smaller), and it's conceivable that you could use well over 500 megs
  268.   or more for all of your Linux software. The amount varies greatly
  269.   depending on the amount of software you install and how much space you
  270.   require. More about this later.
  271.  
  272.   Linux will co-exist with other operating systems, such as MS-DOS,
  273.   Microsoft Windows, or OS/2, on your hard drive. (In fact you can even
  274.   access MS-DOS files and run some MS-DOS programs from Linux.)  In
  275.   other words, when partitioning your drive for Linux, MS-DOS or OS/2
  276.   live on their own partitions, and Linux exists on its own. We'll go
  277.   into more detail about such ``dual-boot'' systems later.
  278.  
  279.   You do NOT need to be running MS-DOS, OS/2, or any other operating
  280.   system to use Linux. Linux is a completely different, stand-alone
  281.   operating system and does not rely on other OSs for installation and
  282.   use.
  283.  
  284.   In all, the minimal setup for Linux is not much more than is required
  285.   for most MS-DOS or Windows 3.1 systems sold today (and it's a good
  286.   deal less than the minimum for Windows 95!).  If you have a 386 or 486
  287.   with at least 4 megs of RAM, then you'll be happy running Linux. Linux
  288.   does not require huge amounts of diskspace, memory, or processor
  289.   speed.  Matt Welsh, the originator of this HOWTO, used to run Linux on
  290.   a 386/16 MHz (the slowest machine you can get) with 4 megs of RAM, and
  291.   was quite happy. The more you want to do, the more memory (and faster
  292.   processor) you'll need. In our experience a 486 with 16 megabytes of
  293.   RAM running Linux outdoes several models of expensive workstations.
  294.  
  295.  
  296.   4.3.  Choosing a Linux distribution
  297.  
  298.   Before you can install Linux, you need to decide on one of the
  299.   ``distributions'' of Linux which are available. There is no single,
  300.   standard release of the Linux software---there are many such releases.
  301.   Each release has its own documentation and installation instructions.
  302.  
  303.   Linux distributions are available both via anonymous FTP and via mail
  304.   order on diskette, tape, and CD-ROM. The Linux Distribution HOWTO,
  305.   <http://sunsite.unc.edu/LDP/HOWTO/Distribution-HOWTO.html>, includes
  306.   descriptions of many Linux distributions available via FTP and mail
  307.   order.
  308.  
  309.   In the dim and ancient past when this HOWTO was first written
  310.   (1992-93), most people got Linux by tortuous means involving long
  311.   downloads off the Internet or a BBS onto their DOS machines, followed
  312.   by an elaborate procedure which transferred the downloads onto
  313.   multiple floppy disks.  One of these disks would then be booted and
  314.   used to install the other dozen.  With luck (and no media failures)
  315.   you'd finish your installation many hours later with a working Linux.
  316.   Or maybe not.
  317.  
  318.   While this path is still possible (and you can download any one of
  319.   several distributions from
  320.   <http://sunsite.unc.edu/pub/Linux/distributions/>), there are now much
  321.   less strenuous ways. The easiest is to buy one of the high-quality
  322.   commercial Linux distributions distributed on CD-ROM, such as Red Hat,
  323.   Craftworks, Linux Pro, or WGS.  These are typically available for less
  324.   than $50 at your local bookstore or computer shop, and will save you
  325.   many hours of aggravation.
  326.  
  327.   You can also buy anthology CD-ROMs such as the InfoMagic Linux
  328.   Developer's Resource set. These typically include several Linux
  329.   distributions and a recent dump of major Linux archive sites, such as
  330.   sunsite or tsx-11.
  331.   In the remainder of this HOWTO we will focus on the steps needed to
  332.   install from an anthology CD-ROM, or one of the lower-end commercial
  333.   Linuxes that doesn't include a printed installation manual.  If your
  334.   Linux includes a paper manual some of this HOWTO may provide useful
  335.   background, but you should consult the manual for detailed
  336.   installation instructions.
  337.  
  338.  
  339.   5.  Installation Overview
  340.  
  341.  
  342.  
  343.   5.1.  Basic Installation Steps
  344.  
  345.   The basic outline of Linux installation is simple:
  346.  
  347.  
  348.   1. Collect configuration information on your hardware.
  349.  
  350.   2. Make installation floppies.
  351.  
  352.   3. If you want to run a "dual-boot" system (Linux and DOS or Windows
  353.      both), rearrange (repartition) your disk to make room for Linux.
  354.  
  355.   4. Boot an installation mini-Linux from the floppies in order to get
  356.      access to the CD-ROM.
  357.  
  358.   5. Prepare the Linux filesystems.  (If you didn't edit the disk
  359.      partition table earlier, you will at this stage.)
  360.  
  361.   6. Install a basic production Linux from the CD-ROM.
  362.  
  363.   7. Boot Linux from the hard drive.
  364.  
  365.   8. (Optional) Install more packages from CD-ROM.
  366.  
  367.  
  368.   5.2.  Basic Parts of an Installation Kit
  369.  
  370.   Here are the basic parts of an installable distribution:
  371.  
  372.  
  373.   1. The README and FAQ files.  These will usually be located in the
  374.      top-level directory of your CD-ROM and be readable once the hard
  375.      disk has been mounted under Linux.  (Depending on how the CD-ROM
  376.      was generated, they may even be visible under DOS/Windows.) It is a
  377.      good idea to read these files as soon as you have access to them,
  378.      to become aware of important updates or changes.
  379.  
  380.   2. A number of bootdisk images (often in a subdirectory).  One of
  381.      these is is the file that you will write to a floppy to create the
  382.      boot disk.  You'll select one of the above bootdisk images,
  383.      depending on the type hardware that you have in your system.
  384.  
  385.   The issue here is that some hardware drivers conflict with each other
  386.   in strange ways, and instead of attempting to debug hardware problems
  387.   on your system it's easier to use a boot floppy image with only the
  388.   drivers you need enabled.  (This will have the nice side effect of
  389.   making your kernel smaller.)
  390.  
  391.  
  392.   ╖  A rootdisk image (or perhaps two). This is a file that you will
  393.      write to a floppy to create the installation disk(s).  Nowadays the
  394.      root disk or disks is generally independent of your hardware type;
  395.      it will assume an EGA or better color screen.
  396.  
  397.   ╖  A rescue disk image.  This is a disk containing a basic kernel and
  398.      tools for disaster recovery in case something steps on the kernel
  399.      or boot block of your hard disk.
  400.  
  401.   ╖  RAWRITE.EXE. This is an MS-DOS program that will write the contents
  402.      of a file (such as a boot or rootdisk image) directly to a floppy,
  403.      without regard to format.
  404.  
  405.   You only need RAWRITE.EXE if you plan to create your boot and root
  406.   floppies from an MS-DOS system. If you have access to a UNIX
  407.   workstation with a floppy drive instead, you can create the floppies
  408.   from there, using the `dd' command.  or possibly a vendor-provided
  409.   build script.  See the man page for dd(1) and ask your local UNIX
  410.   gurus for assistance.
  411.  
  412.  
  413.   ╖  The CD-ROM itself.  The purpose of the boot disk is to get your
  414.      machine ready to load the root or installation disks, which in turn
  415.      are just devices for preparing your hard disk and copying portions
  416.      of the CD-ROM to it.
  417.  
  418.  
  419.   6.  Installation In Detail
  420.  
  421.   6.1.  Getting prepared for installation
  422.  
  423.   Linux makes more effective use of PC hardware than MS-DOS, Windows or
  424.   NT, and is accordingly less tolerant of misconfigured hardware.  There
  425.   are a few things you can do before you start that will lessen your
  426.   chances of being stopped by this kind of problem.
  427.  
  428.   First, collect any manuals you have on your hardware -- motherboard,
  429.   video card, monitor, modem, etc. -- and put them within easy reach.
  430.  
  431.   Second, gather detailed information on your hardware configuration.
  432.   One easy way to do this, if you're running MS-DOS 5.0, or up, is to
  433.   print a report from the Microsoft diagnostic utility msd.exe (you can
  434.   leave out the TSR, driver, memory-map, environment-strings and OS-
  435.   version parts).  Among other things, this will guarantee you full and
  436.   correct information on your video card and mouse type, which will be
  437.   helpful in configuring X later on.
  438.  
  439.   Third, check your machine for configuration problems with supported
  440.   hardware that could cause an un-recoverable lockup during Linux
  441.   installation.
  442.  
  443.  
  444.   ╖  It is possible for a DOS/Windows system using IDE hard drive(s) and
  445.      CD ROM to be functional even with the master/slave jumpers on the
  446.      drives incorrectly set.  Linux won't fly this way.  If in doubt,
  447.      check your master-slave jumpers!
  448.  
  449.   ╖  Is any of your peripheral hardware designed with neither
  450.      configuration jumpers nor non-volatile configuration memory?  If
  451.      so, it may require boot-time initialization via an MS-DOS utility
  452.      to start up, and may not be easily accessible from Linux.  CD-ROMs,
  453.      sound cards, Ethernet cards and low-end tape drives can have this
  454.      problem.  If so, you may be able to work around this with an
  455.      argument to the boot prompt; see the Linux Boot Prompt HOWTO,
  456.      <http://sunsite.unc.edu/LDP/HOWTO/BootPrompt-HOWTO.html> for
  457.      details).
  458.  
  459.   ╖  Some other operating systems will allow a bus mouse to share an IRQ
  460.      with other devices.  Linux doesn't support this; in fact, trying it
  461.      may lock up your machine.  If you are using a bus mouse, see the
  462.      Linux Bus Mouse HOWTO,  <http://sunsite.unc.edu/LDP/HOWTO/Busmouse-
  463.      HOWTO.html>, for details.
  464.  
  465.   If possible, get the telephone number of an experienced Linux user you
  466.   can call in case of emergency.  Nine times out of ten you won't need
  467.   it, but it's comforting to have.
  468.  
  469.   Budget time for installation.  That will be about one hour on a bare
  470.   system or one being converted to all-Linux operation.  Or up to three
  471.   hours for a dual-boot system (they have a much higher incidence of
  472.   false starts and hangups).
  473.  
  474.  
  475.   6.2.  Creating the boot and root floppies
  476.  
  477.   Your Linux CD-ROM may come with installation aids that will take you
  478.   through the process of building boot, root, and rescue disks with
  479.   interactive prompts.  These may be an MS-DOS installation program
  480.   (such as the Red Hat redhat.exe program) or a Unix script, or both.
  481.  
  482.   If you have such a program and can use it, you should read the rest of
  483.   this subsection for information only.  Run the program to do actual
  484.   installation -- its authors certainly knew more about the specific
  485.   distribution than I, and you'll avoid many error-prone hand-entry
  486.   steps.
  487.  
  488.   More detailed information on making boot and root disks, see the Linux
  489.   Bootdisk HOWTO at  <http://sunsite.unc.edu/LDP/HOWTO/Bootdisk-
  490.   HOWTO.html>.
  491.  
  492.   Your first step will be to select a boot-disk image to fit your
  493.   hardware.  If you must do this by hand, you'll generally find that
  494.   either (a) the bootdisk images on your CD-ROM are named in a way that
  495.   willl help you pick a correct one, or (b) there's an index file nearby
  496.   describing each image.
  497.  
  498.   Next, you must create floppies from the bootdisk image you selected,
  499.   and from the root and rescue disk images.  This is where the MS-DOS
  500.   program RAWRITE.EXE comes into play.
  501.  
  502.   Next, you must have two or three high-density MS-DOS formatted
  503.   floppies.  (They must be of the same type; that is, if your boot
  504.   floppy drive is a 3.5" drive, both floppies must be high-density 3.5"
  505.   disks.) You will use RAWRITE.EXE to write the boot and rootdisk images
  506.   to the floppies.
  507.  
  508.   Invoke it with no arguments, like this:
  509.  
  510.  
  511.        C:\> RAWRITE
  512.  
  513.  
  514.   Answer the prompts for the name of the file to write and the floppy to
  515.   write it to (such as A:). RAWRITE will copy the file, block-by-block,
  516.   directly to the floppy. Also use RAWRITE for the root disk image (such
  517.   as COLOR144). When you're done, you'll have two floppies: one
  518.   containing the boot disk, the other containing the root disk. Note
  519.   that these two floppies will no longer be readable by MS-DOS (they are
  520.   ``Linux format'' floppies, in some sense).
  521.  
  522.   You can use the dd(1) commands on a UNIX system to do the same job.
  523.   (For this, you will need a UNIX workstation with a floppy drive, of
  524.   course.)  For example, on a Sun workstation with the floppy drive on
  525.   device /dev/rfd0, you can use the command:
  526.  
  527.  
  528.  
  529.   $ dd if=bare of=/dev/rfd0 obs=18k
  530.  
  531.  
  532.  
  533.  
  534.   You must provide the appropriate output block size argument (the `obs'
  535.   argument) on some workstations (e.g., Suns) or this will fail. If you
  536.   have problems the man page for dd(1) may be be instructive.
  537.  
  538.   Be sure that you're using brand-new, error-free floppies. The floppies
  539.   must have no bad blocks on them.
  540.  
  541.   Note that you do not need to be running Linux or MS-DOS in order to
  542.   install Linux.  However, running Linux or MS-DOS makes it easier to
  543.   create the boot and root floppies from your CD-ROM. If you don't have
  544.   an operating system on your machine, you can use someone else's Linux
  545.   or MS-DOS just to create the floppies, and install from there.
  546.  
  547.  
  548.   6.3.  Repartitioning your DOS/Windows drives
  549.  
  550.   On most used systems, the hard drive is already dedicated to
  551.   partitions for MS-DOS, OS/2, and so on.  You'll need to resize these
  552.   partitions in order to make space for Linux.  If you're going to run a
  553.   dual-boot system, it's strongly recommended that you read one or more
  554.   of the following mini-HOWTOS, which describe different dual-boot
  555.   configurations.
  556.  
  557.  
  558.   ╖  The DOS-Win95-OS2-Linux mini-HOWTO,
  559.      <http://sunsite.unc.edu/LDP/HOWTO/mini/Linux+DOS+Win95+OS2.html>.
  560.  
  561.   ╖  The Linux+Win95 mini-HOWTO,
  562.      <http://sunsite.unc.edu/LDP/HOWTO/mini/Linux+Win95.html>
  563.  
  564.   ╖  The Linux+NT-Loader mini-HOWTO,
  565.      <http://sunsite.unc.edu/LDP/HOWTO/mini/Linux+NT-Loader.html>
  566.  
  567.   Even if they are not directly applicable to your system, they will
  568.   help you understand the issues involved.
  569.  
  570.   NOTE: Some Linuxes will install to a directory on your MS-DOS
  571.   partition. (This is different than installing FROM an MS-DOS
  572.   partition.) Instead, you use the ``UMSDOS filesystem'', which allows
  573.   you to treat a directory of your MS-DOS partition as a Linux
  574.   filesystem. In this way, you don't have to repartition your drive.
  575.  
  576.   I only suggest using this method if your drive already has four
  577.   partitions (the maximum supported by DOS) and repartitioning would be
  578.   more trouble than it's worth (it slows down your Linux due to filename
  579.   translation overhead).  Or, if you want to try out Linux before
  580.   repartitioning, this is a good way to do so. But in most cases you
  581.   should re-partition, as described here. If you do plan to use UMSDOS,
  582.   you are on your own---it is not documented in detail here. From now
  583.   on, we assume that you are NOT using UMSDOS, and that you will be
  584.   repartitioning.
  585.  
  586.   A partition is just a section of the hard drive set aside for a
  587.   particular operating system to use. If you only have MS-DOS installed,
  588.   your hard drive probably has just one partition, entirely for MS-DOS.
  589.   To use Linux, however, you'll need to repartition the drive, so that
  590.   you have one partition for MS-DOS, and one (or more) for Linux.
  591.  
  592.   Partitions come in three flavors: primary, extended, and logical.
  593.   Briefly, primary partitions are one of the four main partitions on
  594.   your drive. However, if you wish to have more than four partitions per
  595.   drive, you need to create an extended partition, which can contain
  596.   many logical partitions.  You don't store data directly on an extended
  597.   partition---it is used only as a container for logical partitions.
  598.   Data is stored only on either primary or logical partitions.
  599.  
  600.   To put this another way, most people use only primary partitions.
  601.   However, if you need more than four partitions on a drive, you create
  602.   an extended partition. Logical partitions are then created on top of
  603.   the extended partition, and there you have it---more than four
  604.   partitions per drive.
  605.  
  606.   Note that you can easily install Linux on the second drive on your
  607.   system (known as D: to MS-DOS). You simply specify the appropriate
  608.   device name when creating Linux partitions. This is described in
  609.   detail below.
  610.  
  611.   Back to repartitioning your drive: The problem with resizing
  612.   partitions is that there is no way to do it (easily) without deleting
  613.   the data on those partitions.  Therefore, you will need to make a full
  614.   backup of your system before repartitioning. In order to resize a
  615.   partition, we simply delete the partition(s), and re-create them with
  616.   smaller sizes.
  617.  
  618.   NOTE: There is a non-destructive disk repartitioner available for MS-
  619.   DOS, called FIPS. Look at
  620.   <http://sunsite.unc.edu/pub/Linux/system/install>. With FIPS, a disk
  621.   optimizer (such as Norton Speed Disk), and a little bit of luck, you
  622.   should be able to resize MS-DOS partitions without destroying the data
  623.   on them.  It's still suggested that you make a full backup before
  624.   attempting this.
  625.  
  626.   If you're not using FIPS, however, the classic way to modify
  627.   partitions is with the program FDISK. For example, let's say that you
  628.   have an 80 meg hard drive, dedicated to MS-DOS. You'd like to split it
  629.   in half---40 megs for MS-DOS and 40 megs for Linux. In order to do
  630.   this, you run FDISK under MS-DOS, delete the 80 meg MS-DOS partition,
  631.   and re-create a 40 meg MS-DOS partition in its place. You can then
  632.   format the new partition and reinstall your MS-DOS software from
  633.   backups. 40 megabytes of the drive is left empty. Later, you create
  634.   Linux partitions on the unused portion of the drive.
  635.  
  636.   In short, you should do the following to resize MS-DOS partitions with
  637.   FDISK:
  638.  
  639.   1. Make a full backup of your system.
  640.  
  641.   2. Create an MS-DOS bootable floppy, using a command such as
  642.  
  643.        FORMAT /S A:
  644.  
  645.  
  646.   3. Copy the files FDISK.EXE and FORMAT.COM to this floppy, as well as
  647.      any other utilities that you need. (For example, utilities to
  648.      recover your system from backup.)
  649.  
  650.   4. Boot the MS-DOS system floppy.
  651.  
  652.   5. Run FDISK, possibly specifying the drive to modify (such as C: or
  653.      D:).
  654.  
  655.   6. Use the FDISK menu options to delete the partitions which you wish
  656.      to resize. This will destroy all data on the affected partitions.
  657.  
  658.   7. Use the FDISK menu options to re-create those partitions, with
  659.      smaller sizes.
  660.  
  661.   8. Exit FDISK and re-format the new partitions with the FORMAT
  662.      command.
  663.  
  664.   9. Restore the original files from backup.
  665.  
  666.   Note that MS-DOS FDISK will give you an option to create a ``logical
  667.   DOS drive''. A logical DOS drive is just a logical partition on your
  668.   hard drive. You can install Linux on a logical partition, but you
  669.   don't want to create that logical partition with MS-DOS fdisk. So, if
  670.   you're currently using a logical DOS drive, and want to install Linux
  671.   in its place, you should delete the logical drive with MS-DOS FDISK,
  672.   and (later) create a logical partition for Linux in its place.
  673.  
  674.   The mechanism used to repartition for OS/2 and other operating systems
  675.   is similar. See the documentation for those operating systems for
  676.   details.
  677.  
  678.  
  679.   6.4.  Creating partitions for Linux
  680.  
  681.   After repartitioning your drive, you need to create partitions for
  682.   Linux. Before describing how to do that, we'll talk about partitions
  683.   and filesystems under Linux.
  684.  
  685.  
  686.   6.4.1.  Partition basics
  687.  
  688.   Linux requires at least one partition, for the root filesystem, which
  689.   will hold the Linux kernel itself.
  690.  
  691.   You can think of a filesystem as a partition formatted for Linux.
  692.   Filesystems are used to hold files. Every system must have a root
  693.   filesystem, at least. However, many users prefer to use multiple
  694.   filesystems---one for each major part of the directory tree. For
  695.   example, you may wish to create a separate filesystem to hold all
  696.   files under the /usr directory.  (Note that on UNIX systems, forward
  697.   slashes are used to delimit directories, not backslashes as with MS-
  698.   DOS.) In this case you have both a root filesystem, and a /usr
  699.   filesystem.
  700.  
  701.   Each filesystem requires its own partition. Therefore, if you're using
  702.   both root and /usr filesystems, you'll need to create two Linux
  703.   partitions.
  704.  
  705.   In addition, most users create a swap partition, which is used for
  706.   virtual RAM. If you have, say, 4 megabytes of memory on your machine,
  707.   and a 10-megabyte swap partition, as far as Linux is concerned you
  708.   have 14 megabytes of virtual memory.
  709.  
  710.   When using swap space, Linux moves unused pages of memory out to disk,
  711.   allowing you to run more applications at once on your system.
  712.   However, because swapping is often slow, it's no replacement for real
  713.   physical RAM. But applications that require a great deal of memory
  714.   (such as the X Window System) often rely on swap space if you don't
  715.   have enough physical RAM.
  716.  
  717.   Nearly all Linux users employ a swap partition.  If you have 4
  718.   megabytes of RAM or less, a swap partition is required to install the
  719.   software. It is strongly recommended that you have a swap partition
  720.   anyway, unless you have a great amount of physical RAM.
  721.  
  722.   The size of your swap partition depends on how much virtual memory you
  723.   need. It's often suggested that you have at least 16 megabytes of
  724.   virtual memory total. Therefore, if you have 8 megs of physical RAM,
  725.   you might want to create an 8-megabyte swap partition.  Note that swap
  726.   partitions can be no larger than 128 megabytes in size. Therefore, if
  727.   you need more than 128 megs of swap, you must create multiple swap
  728.   partitions. You may have up to 16 swap partitions in all.
  729.  
  730.   You can find more on the theory of swap space layout and disk
  731.   partitioning in the Linux Partition mini-HOWTO (
  732.   <http://sunsite.unc.edu/LDP/HOWTO/mini/Partition.html>).
  733.  
  734.   Note: it is possible, though a bit tricky, to share swap partitions
  735.   between Linux and Windows 95 in a dual-boot system.  For details, see
  736.   the Linux Swap Space Mini-HOWTO,
  737.   <http://sunsite.unc.edu/LDP/HOWTO/unmaintained/Swap-Space>.
  738.  
  739.   Gotcha #1: If you have an EIDE drive with a partition that goes above
  740.   504MB, your BIOS may not allow you to boot to a Linux installed there.
  741.   So keep your root partition below 504MB. This shouldn't be a problem
  742.   for SCSI drive controllers, which normally have their own drive BIOS
  743.   firmware.  For technical details, see the Large Disk Mini-HOWTO,
  744.   <http://sunsite.unc.edu/LDP/HOWTO/mini/Large-Disk.html>.
  745.  
  746.   Gotcha #2: Are you mixing IDE and SCSI drives?  Then watch out.  Your
  747.   BIOS may not allow you to boot directly to a SCSI drive.
  748.  
  749.  
  750.   6.4.2.  Sizing partitions
  751.  
  752.   Besides your root and swap partitions, you'll want to set up one or
  753.   more partitions to hold your software and home directories.
  754.  
  755.   While, in theory, you could run everything off a single huge root
  756.   partition, almost nobody does this.  Having multiple partitions has
  757.   several advantages:
  758.  
  759.  
  760.   ╖  It often cuts down the time required for boot-time file-system
  761.      checks.
  762.  
  763.   ╖  Files can't grow across partition boundaries.  Therefore you can
  764.      use partition boundaries as firebreaks against programs (like
  765.      Usenet news) that want to eat huge amounts of disk, to prevent them
  766.      from crowding out file space needed by your kernel and the rest of
  767.      your applications.
  768.  
  769.   ╖  If you ever develop a bad spot on your disk, formatting and
  770.      restoring a single partition is less painful than having to redo
  771.      everything from scratch.
  772.  
  773.   On today's large disks, a good basic setup is to have a small root
  774.   partition (less than 80 meg), a medium-sized /usr partition (up to 300
  775.   meg or so) to hold system software, and a /home partition occupying
  776.   the rest of your available space for home directories.
  777.  
  778.   You can get more elaborate.  If you know you're going to run Usenet
  779.   news, for example, you may want to give it a partition of its own to
  780.   control its maximum possible disk usage.  Or create a /var partition
  781.   for mail, news, and temporary files all together.  But in today's
  782.   regime of very cheap, very large hard disks these complications seem
  783.   less and less necessary for your first Linux installation.  For your
  784.   first time, especially, keep it simple.
  785.  
  786.  
  787.   6.5.  Booting the installation disk
  788.  
  789.   The first step is to boot the bootdisk you generated.  Normally you'll
  790.   be able to boot hands-off; the boot kernel prompt will fill itself in
  791.   after 10 seconds.  This is how you'll normally boot from an IDE disk.
  792.  
  793.   By giving arguments after the kernel name, you can specify various
  794.   hardware parameters, such as your SCSI controller IRQ and address, or
  795.   drive geometry, before booting the Linux kernel.  This may be
  796.   necessary if Linux does not detect your SCSI controller or hard drive
  797.   geometry, for example.
  798.  
  799.   In particular, many BIOS-less SCSI controllers require you to specify
  800.   the port address and IRQ at boot time. Likewise, IBM PS/1, ThinkPad,
  801.   and ValuePoint machines do not store drive geometry in the CMOS, and
  802.   you must specify it at boot time.  (Later on, you'll be able to
  803.   configure your production system to supply such parameters itself.)
  804.  
  805.   Watch the messages as the system boots. They will list and describe
  806.   the hardware your installation Linux detects.  In particular, f you
  807.   have a SCSI controller, you should see a listing of the SCSI hosts
  808.   detected.  If you see the message
  809.  
  810.  
  811.  
  812.        SCSI: 0 hosts
  813.  
  814.  
  815.  
  816.  
  817.   Then your SCSI controller was not detected, and you will have to
  818.   figure out how to tell the kernel where it is.
  819.  
  820.   Also, the system will display information on the drive partitions and
  821.   devices detected. If any of this information is incorrect or missing,
  822.   you will have to force hardware detection.
  823.  
  824.   On the other hand, if all goes well and you hardware seems to be
  825.   detected, you can skip to the following section, ``Loading the root
  826.   disk.''
  827.  
  828.   To force hardware detection, you must enter the appropriate parameters
  829.   at the boot prompt, using the following syntax:
  830.  
  831.  
  832.  
  833.        linux <parameters...>
  834.  
  835.  
  836.  
  837.  
  838.   There are a number of such parameters available; we list some of the
  839.   most common below.  Modern Linux boot disks will often give you the
  840.   option to look at help screen describing kernel parameters before you
  841.   boot.
  842.  
  843.  
  844.   ╖  hd=cylinders,heads,sectors Specify the drive geometry.  Required
  845.      for systems such as the IBM PS/1, ValuePoint, and ThinkPad.  For
  846.      example, if your drive has 683 cylinders, 16 heads, and 32 sectors
  847.      per track, enter
  848.  
  849.  
  850.  
  851.        linux hd=683,16,32
  852.  
  853.  
  854.  
  855.  
  856.  
  857.   ╖  tmc8xx=memaddr,irq Specify address and IRQ for BIOS-less Future
  858.      Domain TMC-8xx SCSI controller. For example,
  859.        linux tmc8xx=0xca000,5
  860.  
  861.  
  862.  
  863.  
  864.  
  865.   Note that the 0x prefix must be used for all values given in hex. This
  866.   is true for all of the following options.
  867.  
  868.   ╖  st0x=memaddr,irq Specify address and IRQ for BIOS-less Seagate ST02
  869.      controller.
  870.  
  871.   ╖  t128=memaddr,irq Specify address and IRQ for BIOS-less Trantor
  872.      T128B controller.
  873.  
  874.   ╖  ncr5380=port,irq,dma Specify port, IRQ, and DMA channel for generic
  875.      NCR5380 controller.
  876.  
  877.   ╖  aha152x=port,irq,scsi_id,1 Specify port, IRQ, and SCSI ID for BIOS-
  878.      less AIC-6260 controllers. This includes Adaptec 1510, 152x, and
  879.      Soundblaster-SCSI controllers.
  880.  
  881.   If you have questions about these boot-time options, please read the
  882.   Linux SCSI HOWTO, which should be available on any Linux FTP archive
  883.   site (or from wherever you obtained this document).  The SCSI HOWTO
  884.   explains Linux SCSI compatibility in much more detail.
  885.  
  886.  
  887.   6.6.  Using the rootdisk
  888.  
  889.   After booting the bootdisk, you will be prompted to enter the root
  890.   disk or disks.  At this point you should remove the bootdisk from the
  891.   drive and insert the rootdisk. Then press enter to go on.  You may
  892.   have to load a second root disk.
  893.  
  894.   What's actually happening here is this: the boot disk provides a
  895.   miniature operating system which (because the hard drive isn't
  896.   prepared) uses a portion of your RAM as a virtual disk (called,
  897.   logically enough, a `ramdisk').
  898.  
  899.   The root disks loads onto the ramdisk a small set of files and
  900.   installation tools which you'll use to prepare your hard drive and
  901.   install a production Linux on it from your CD-ROM.
  902.  
  903.  
  904.   6.6.1.  Choosing EGA or X installation
  905.  
  906.   Older Linuxes (including Slackware) gave you a shell at this point and
  907.   required you to enter installation commands by hand in a a prescribed
  908.   sequence.  This is still possible, but newer ones start by running a
  909.   screen-oriented installation program which tries to interactively walk
  910.   you through these steps, giving lots of help.
  911.  
  912.   You will probably get the option to try to configure X right away so
  913.   the installation program can go graphical.  If you choose this route,
  914.   the installation program will quiz you about your mouse and monitor
  915.   type before getting to the installation proper.  Once you get your
  916.   production Linux installed, these settings will be saved for you.  You
  917.   will be able to tune your monitor's performance later, so at this
  918.   stage it makes sense to settle for a basic 640x480 SVGA mode.
  919.  
  920.   X isn't necessary for installation, but (assuming you can get past the
  921.   mouse and monitor configuration) many people find the graphical
  922.   interface easier to use.  And you're going to want to bring up X
  923.   anyway, so trying it early makes some sense.
  924.  
  925.   Just follow the prompts in the program.  It will take you through the
  926.   steps necessary to prepare your disk, create initial user accounts,
  927.   and install software packages off the CD-ROM.
  928.  
  929.   In the following subsections we'll describe some of the tricky areas
  930.   in the installation sequence as if you were doing them by hand.  This
  931.   should help you understand what the installation program is doing, and
  932.   why.
  933.  
  934.  
  935.   6.6.2.  Using fdisk  and cfdisk
  936.  
  937.   Your first installation step once the root-disk Linux is booted will
  938.   be to create or edit the partition tables on your disks.  Even if you
  939.   used FDISK to set up partitions earlier, you'll need to go back to the
  940.   partition table now and insert some Linux-specific information now.
  941.  
  942.   To create or edit Linux partitions, we'll use the Linux version of the
  943.   fdisk program, or its screen-oriented sibling cfdisk.
  944.  
  945.   Generally the installation program will look for a preexisting
  946.   partition table and offer to run fdisk or cfdisk on it for you.  Of
  947.   the two, cfdisk is definitely easier to use, but current versions of
  948.   it are also less tolerant of a nonexistent or garbled partition table.
  949.  
  950.   Therefore you may find (especially if you're installing on virgin
  951.   hardware) that you need to start with fdisk to get to a state that
  952.   cfdisk can deal with.  Try running cfdisk; if it complains, run fdisk.
  953.   (A good way to proceed if you're building an all-Linux system and
  954.   cfdisk complains is to use fdisk to delete all the existing partions
  955.   and then fire up cfdisk to edit the empty table.)
  956.  
  957.   A few notes apply to both fdisk and cfdisk.  Both take an argument
  958.   which is the name of the drive that you wish to create Linux
  959.   partitions on. Hard drive device names are:
  960.  
  961.  
  962.   ╖  /dev/hda First IDE drive
  963.  
  964.   ╖  /dev/hdb Second IDE drive
  965.  
  966.   ╖  /dev/sda First SCSI drive
  967.  
  968.   ╖  /dev/sdb Second SCSI drive
  969.  
  970.   For example, to create Linux partitions on the first SCSI drive in
  971.   your system, you will use (or your installation program might generate
  972.   from a menu choice) the command:
  973.  
  974.  
  975.        cfdisk /dev/sda
  976.  
  977.  
  978.   If you use fdisk or cfdisk without an argument, it will assume
  979.   /dev/hda.
  980.  
  981.   To create Linux partitions on the second drive on your system, simply
  982.   specify either /dev/hdb (for IDE drives) or /dev/sdb (for SCSI drives)
  983.   when running fdisk.
  984.  
  985.   Your Linux partitions don't all have to be on the same drive.  You
  986.   might want to create your root filesystem partition on /dev/hda and
  987.   your swap partition on /dev/hdb, for example. In order to do so just
  988.   run fdisk or cfdisk once for each drive.
  989.  
  990.  
  991.   In Linux, partitions are given a name based on the drive which they
  992.   belong to. For example, the first partition on the drive /dev/hda is
  993.   /dev/hda1, the second is /dev/hda2, and so on. If you have any logical
  994.   partitions, they are numbered starting with /dev/hda5, /dev/hda6 and
  995.   so on up.
  996.  
  997.   NOTE: You should not create or delete partitions for operating systems
  998.   other than Linux with Linux fdisk or cfdisk. That is, don't create or
  999.   delete MS-DOS partitions with this version of fdisk; use MS-DOS's
  1000.   version of FDISK instead. If you try to create MS-DOS partitions with
  1001.   Linux fdisk, chances are MS-DOS will not recognize the partition and
  1002.   not boot correctly.
  1003.  
  1004.   Here's an example of using fdisk. Here, we have a single MS-DOS
  1005.   partition using 61693 blocks on the drive, and the rest of the drive
  1006.   is free for Linux. (Under Linux, one block is 1024 bytes. Therefore,
  1007.   61693 blocks is about 61 megabytes.)  We will create just two
  1008.   partitions in this tutorial example, swap and root.  You should
  1009.   probably extend this to four Linux partitions in line with the
  1010.   recommendations above: one for swap, one for the root filesystem, one
  1011.   for system software, and a home directory area.
  1012.  
  1013.   First, we use the ``p'' command to display the current partition
  1014.   table.  As you can see, /dev/hda1 (the first partition on /dev/hda) is
  1015.   a DOS partition of 61693 blocks.
  1016.  
  1017.  
  1018.        Command (m for help):   p
  1019.        Disk /dev/hda: 16 heads, 38 sectors, 683 cylinders
  1020.        Units = cylinders of 608 * 512 bytes
  1021.  
  1022.             Device Boot  Begin   Start     End  Blocks   Id  System
  1023.          /dev/hda1   *       1       1     203   61693    6  DOS 16-bit >=32M
  1024.  
  1025.        Command (m for help):
  1026.  
  1027.  
  1028.  
  1029.  
  1030.   Next, we use the ``n'' command to create a new partition. The Linux
  1031.   root partition will be 80 megs in size.
  1032.  
  1033.  
  1034.  
  1035.        Command (m for help):  n
  1036.        Command action
  1037.            e   extended
  1038.            p   primary partition (1-4)
  1039.        p
  1040.  
  1041.  
  1042.  
  1043.  
  1044.   Here we're being asked if we want to create an extended or primary
  1045.   partition. In most cases you want to use primary partitions, unless
  1046.   you need more than four partitions on a drive. See the section
  1047.   ``Repartitioning'', above, for more information.
  1048.  
  1049.  
  1050.  
  1051.        Partition number (1-4): 2
  1052.        First cylinder (204-683):  204
  1053.        Last cylinder or +size or +sizeM or +sizeK (204-683): +80M
  1054.  
  1055.  
  1056.  
  1057.   The first cylinder should be the cylinder AFTER where the last
  1058.   partition left off. In this case, /dev/hda1 ended on cylinder 203, so
  1059.   we start the new partition at cylinder 204.
  1060.  
  1061.   As you can see, if we use the notation ``+80M'', it specifies a
  1062.   partition of 80 megs in size. Likewise, the notation ``+80K'' would
  1063.   specify an 80 kilobyte partition, and ``+80'' would specify just an 80
  1064.   byte partition.
  1065.  
  1066.  
  1067.  
  1068.        Warning: Linux cannot currently use 33090 sectors of this partition
  1069.  
  1070.  
  1071.  
  1072.  
  1073.   If you see this warning, you can ignore it. It is left over from an
  1074.   old restriction that Linux filesystems could only be 64 megs in size.
  1075.   However, with newer filesystem types, that is no longer the case...
  1076.   partitions can now be up to 4 terabytes in size.
  1077.  
  1078.   Next, we create our 10 megabyte swap partition, /dev/hda3.
  1079.  
  1080.  
  1081.  
  1082.        Command (m for help): n
  1083.        Command action
  1084.            e   extended
  1085.            p   primary partition (1-4)
  1086.        p
  1087.  
  1088.        Partition number (1-4): 3
  1089.        First cylinder (474-683):  474
  1090.        Last cylinder or +size or +sizeM or +sizeK (474-683):  +10M
  1091.  
  1092.  
  1093.  
  1094.  
  1095.   Again, we display the contents of the partition table. Be sure to
  1096.   write down the information here, especially the size of each partition
  1097.   in blocks. You need this information later.
  1098.  
  1099.  
  1100.  
  1101.        Command (m for help): p
  1102.        Disk /dev/hda: 16 heads, 38 sectors, 683 cylinders
  1103.        Units = cylinders of 608 * 512 bytes
  1104.  
  1105.             Device Boot  Begin   Start     End  Blocks   Id  System
  1106.          /dev/hda1   *       1       1     203   61693    6  DOS 16-bit >=32M
  1107.          /dev/hda2         204     204     473   82080   83  Linux native
  1108.          /dev/hda3         474     474     507   10336   83  Linux native
  1109.  
  1110.  
  1111.  
  1112.  
  1113.   Note that the Linux swap partition (here, /dev/hda3) has type ``Linux
  1114.   native''. We need to change the type of the swap partition to ``Linux
  1115.   swap'' so that the installation program will recognize it as such. In
  1116.   order to do this, use the fdisk ``t'' command:
  1117.  
  1118.  
  1119.  
  1120.  
  1121.  
  1122.  
  1123.   Command (m for help): t
  1124.   Partition number (1-4): 3
  1125.   Hex code (type L to list codes): 82
  1126.  
  1127.  
  1128.  
  1129.  
  1130.   If you use ``L'' to list the type codes, you'll find that 82 is the
  1131.   type corresponding to Linux swap.
  1132.  
  1133.   To quit fdisk and save the changes to the partition table, use the
  1134.   ``w'' command. To quit fdisk WITHOUT saving changes, use the ``q''
  1135.   command.
  1136.  
  1137.   After quitting fdisk, the system may tell you to reboot to make sure
  1138.   that the changes took effect. In general there is no reason to reboot
  1139.   after using fdisk---modern versions of fdisk and cfdisk are smart
  1140.   enough to update the partitions without rebooting.
  1141.  
  1142.  
  1143.   6.6.3.  Post-partition steps
  1144.  
  1145.   After you've edited the partition tables, your installation program
  1146.   should look at them and offer to enable your swap partition for you.
  1147.   Tell it yes.
  1148.  
  1149.   (This is made a question, rather than done automatically, on the off
  1150.   chance that you're running a dual-boot system and one of your non-
  1151.   Linux partitions might happen to look like a swap volume.)
  1152.  
  1153.   Next the program will ask you to associate Linux filesystem names
  1154.   (such as /, /usr, /var, /tmp, /home, /home2, etc.) with each of the
  1155.   non-swap partitions you're going to use.
  1156.  
  1157.   There is only one hard and fast rule for this.  There must be a root
  1158.   filesystem, named /, and it must be bootable.  You can name your other
  1159.   Linux partitions anything you like.  But there are some conventions
  1160.   about how to name them which will probably simplify your life later
  1161.   on.
  1162.  
  1163.   Earlier on I recommended a basic three-partition setup including a
  1164.   small root, a medium-sized system-software partition, and a large
  1165.   home-directory partition.  Traditionally, these would be called /,
  1166.   /usr, and /home.  The counterintuitive `/usr' name is a historical
  1167.   carryover from the days when (much smaller) Unix systems carried
  1168.   system software and user home directories on a single non-root
  1169.   partition.  Some software depends on it.
  1170.  
  1171.   If you have more than one home-directory area, it's conventional to
  1172.   name them /home, /home2, /home3, etc.  This may come up if you have
  1173.   two physical disks.  On my personal system, for example, the layout
  1174.   currently looks like this:
  1175.  
  1176.  
  1177.  
  1178.        Filesystem         1024-blocks  Used Available Capacity Mounted on
  1179.        /dev/sda1              30719   22337     6796     77%   /
  1180.        /dev/sda3             595663  327608   237284     58%   /usr
  1181.        /dev/sda4            1371370    1174  1299336      0%   /home
  1182.        /dev/sdb1            1000949  643108   306130     68%   /home2
  1183.  
  1184.  
  1185.  
  1186.  
  1187.   The second disk (sdb1) isn't really all /home2; the swap partitions on
  1188.   sda and sdb aren't shown in this display.  But you can see that /home
  1189.   is the large free area on sda and /home2 is the user area of sdb.
  1190.  
  1191.   If you want to create an partition for scratch, spool, temporary,
  1192.   mail, and news files, call it /var.  Otherwise you'll probably want to
  1193.   create a /usr/var and create a symbolic link named /var that points
  1194.   back to it (the installation program may offer to do this for you).
  1195.  
  1196.  
  1197.   6.7.  Installing software packages
  1198.  
  1199.   Once you've gotten past preparing your partitions, the remainder of
  1200.   the installation should be almost automatic.  Your installation
  1201.   program (whether EGA or X-based) will guide you through a series of
  1202.   menus which allow you to specify the CD-ROM to install from, the
  1203.   partitions to use, and so forth.
  1204.  
  1205.   Here we're not going to document many of the specifics of this stage
  1206.   of installation.  It's one of the parts that varies most between Linux
  1207.   distributions (vendors traditionally compete to add value here), but
  1208.   also the simplest part.  And the installation programs are pretty much
  1209.   self-explanatory, with good on-screen help.
  1210.  
  1211.  
  1212.   6.8.  After package installations
  1213.  
  1214.   After installation is complete, and if all goes well, the installation
  1215.   program will walk you through a few options for configuring your
  1216.   system before its first boot from hard drive.
  1217.  
  1218.  
  1219.   6.8.1.  LILO, the LInux LOader
  1220.  
  1221.   LILO (which stands for LInux LOader) is a program that will allow you
  1222.   to boot Linux (as well as other operating systems, such as MS-DOS)
  1223.   from your hard drive.
  1224.  
  1225.   You may be given the option of installing LILO on your hard drive.
  1226.   Unless you're running OS/2, answer `yes'.  OS/2 has special
  1227.   requirements; see ``Custom LILO  Configuration'' below.
  1228.  
  1229.   Installing LILO as your primary loader makes a separate boot diskette
  1230.   unnecessary; instead, you can tell LILO at each boot time which OS to
  1231.   boot.
  1232.  
  1233.  
  1234.   6.8.2.  Making a production boot disk (optional)
  1235.  
  1236.   You may also be given the chance to create a ``standard boot disk'',
  1237.   which you can use to boot your newly-installed Linux system.  (This is
  1238.   an older and slightly less convenient method which assumes that you
  1239.   will normally boot DOS, but use the boot disk to start Linux.)
  1240.  
  1241.   For this you will need a blank, high-density MS-DOS formatted diskette
  1242.   of the type that you boot with on your system. Simply insert the disk
  1243.   when prompted and a boot diskette will be created.  (This is not the
  1244.   same as an installation bootdisk, and you can't substitute one for the
  1245.   other!)
  1246.  
  1247.  
  1248.   6.8.3.  Miscellaneous system configuration
  1249.  
  1250.   The post-installation procedure may also take you through several menu
  1251.   items allowing you to configure your system. This includes specifying
  1252.   your modem and mouse device, as well as your time zone.  Follow the
  1253.   menu options.
  1254.  
  1255.   It may also prompt you to create user accounts or put a password on
  1256.   the root (administration) account.  This is not complicated and you
  1257.   can usually just walk through the screen instructions.
  1258.  
  1259.  
  1260.   7.  Booting Your New System
  1261.  
  1262.   If everything went as planned, you should now be able to boot Linux
  1263.   from the hard drive using LILO.  Alternatively, you should be able to
  1264.   boot your Linux boot floppy (not the original bootdisk floppy, but the
  1265.   floppy created after installing the software).  After booting, login
  1266.   as root. Congratulations! You have your very own Linux system.
  1267.  
  1268.   If you are booting using LILO, try holding down shift or control
  1269.   during boot. This will present you with a boot prompt; press tab to
  1270.   see a list of options. In this way you can boot Linux, MS-DOS, or
  1271.   whatever directly from LILO.
  1272.  
  1273.  
  1274.   8.  After Your First Boot
  1275.  
  1276.   You should now be looking at the login prompt of a new Linux, just
  1277.   booted from your hard drive.  Congratulations!
  1278.  
  1279.  
  1280.   8.1.  Beginning System Administratration
  1281.  
  1282.   Depending on how the installation phase went, you may need to create
  1283.   accounts, change your hostname, or (re)configure X at this stage.
  1284.   There are many more things you could set up and configure, including
  1285.   backup devices, SLIP/PPP links to an Internet Service Provider, etc.
  1286.  
  1287.   A good book on UNIX systems administration should help. (I suggest
  1288.   Essential Systems Administration from O'Reilly and Associates.)  You
  1289.   will pick these things up as time goes by. You should read various
  1290.   other Linux HOWTOs, such as the NET-3-HOWTO and Printing-HOWTO, for
  1291.   information on other configuration tasks.
  1292.  
  1293.  
  1294.   8.2.  Custom LILO Configuration
  1295.  
  1296.   LILO is a boot loader, which can be used to select either Linux, MS-
  1297.   DOS, or some other operating system at boot time.  Chances are your
  1298.   distribution automatically configured LILO for you during the
  1299.   installation phase (unless you're using OS/2, this is what you should
  1300.   have done).  If so, you can skip the rest of this section.
  1301.  
  1302.   If you installed LILO as the primary boot loader, it will handle the
  1303.   first-stage booting process for all operating systems on your drive.
  1304.   This works well if MS-DOS is the only other operating system that you
  1305.   have installed. However, you might be running OS/2, which has its own
  1306.   Boot Manager. In this case, you want OS/2's Boot Manager to be the
  1307.   primary boot loader, and use LILO just to boot Linux (as the secondary
  1308.   boot loader).
  1309.  
  1310.   An important gotcha for people using EIDE systems: due to a BIOS
  1311.   limitation, your boot sectors for any OS have to live on one of the
  1312.   first two physical disks.  Otherwise LILO will hang after writing
  1313.   "LI", no matter where you run it from.
  1314.  
  1315.   If you have to configure LILO manually, this will involve editing the
  1316.   file /etc/lilo.conf. Below we present an example of a LILO
  1317.   configuration file, where the Linux root partition is on /dev/hda2,
  1318.   and MS-DOS is installed on /dev/hdb1 (on the second hard drive).
  1319.  
  1320.  
  1321.        # Tell LILO to install itself as the primary boot loader on /dev/hda.
  1322.        boot = /dev/hda
  1323.        # The boot image to install; you probably shouldn't change this
  1324.        install = /boot/boot.b
  1325.  
  1326.        # The stanza for booting Linux.
  1327.        image = /vmlinuz       # The kernel is in /vmlinuz
  1328.          label = linux        # Give it the name "linux"
  1329.          root = /dev/hda2     # Use /dev/hda2 as the root filesystem
  1330.          vga = ask            # Prompt for VGA mode
  1331.          append = "aha152x=0x340,11,7,1"  # Add this to the boot options,
  1332.                                           # for detecting the SCSI controller
  1333.  
  1334.        # The stanza for booting MS-DOS
  1335.        other = /dev/hdb1      # This is the MS-DOS partition
  1336.          label = msdos        # Give it the name "msdos"
  1337.          table = /dev/hdb     # The partition table for the second drive
  1338.  
  1339.  
  1340.  
  1341.  
  1342.   Once you have edited the /etc/lilo.conf file, run /sbin/lilo as root.
  1343.   This will install LILO on your drive. Note that you must rerun
  1344.   /sbin/lilo anytime that you recompile your kernel in order to point
  1345.   the boot loader at it properly (something that you don't need to worry
  1346.   about just now, but keep it in mind).
  1347.  
  1348.   Note how we use the append option in /etc/lilo.conf to specify boot
  1349.   parameters as we did when booting the bootdisk.
  1350.  
  1351.   You can now reboot your system from the hard drive. By default LILO
  1352.   will boot the operating system listed first in the configuration file,
  1353.   which in this case is Linux. In order to bring up a boot menu, in
  1354.   order to select another operating system, hold down shift or ctrl
  1355.   while the system boots; you should see a prompt such as
  1356.  
  1357.        Boot:
  1358.  
  1359.  
  1360.   Here, enter either the name of the operating system to boot (given by
  1361.   the label line in the configuration file; in this case, either linux
  1362.   or msdos), or press tab to get a list.
  1363.  
  1364.   Now let's say that you want to use LILO as the secondary boot loader;
  1365.   if you want to boot Linux from OS/2's Boot Manager, for example.  In
  1366.   order to boot a Linux partition from OS/2 Boot Manager, unfortunately,
  1367.   you must create the partition using OS/2's FDISK (not Linux's), and
  1368.   format the partition as FAT or HPFS, so that OS/2 knows about it.
  1369.   (That's IBM for you.)
  1370.  
  1371.   In order to have LILO boot Linux from OS/2 Boot Manager, you only want
  1372.   to install LILO on your Linux root filesystem (in the above example,
  1373.   /dev/hda2). In this case, your LILO config file should look something
  1374.   like:
  1375.  
  1376.  
  1377.  
  1378.        boot = /dev/hda2
  1379.        install = /boot/boot.b
  1380.        compact
  1381.  
  1382.        image = /vmlinuz
  1383.          label = linux
  1384.          root = /dev/hda2
  1385.          vga = ask
  1386.  
  1387.   Note the change in the boot line. After running /sbin/lilo you should
  1388.   be able to add the Linux partition to Boot Manager. This mechanism
  1389.   should work for boot loaders used by other operating systems as well.
  1390.  
  1391.  
  1392.   9.  Administrivia
  1393.  
  1394.  
  1395.   9.1.  Terms of Use
  1396.  
  1397.   This document is copyright 1998 by Eric S. Raymond. You may use,
  1398.   disseminate, and reproduce it freely, provided you:
  1399.  
  1400.  
  1401.   ╖  Do not omit or alter this copyright notice.
  1402.  
  1403.   ╖  Do not omit or alter or omit the version number and date.
  1404.  
  1405.   ╖  Do not omit or alter the document's pointer to the current WWW
  1406.      version.
  1407.  
  1408.   ╖  Clearly mark any condensed, altered or versions as such.
  1409.  
  1410.   These restrictions are intended to protect potential readers from
  1411.   stale or mangled versions.  If you think you have a good case for an
  1412.   exception, ask me.
  1413.  
  1414.  
  1415.   9.2.  Acknowledgements
  1416.  
  1417.   My grateful acknowledgement to Matt D. Welsh, who originated this
  1418.   HOWTO.  I removed much of the Slackware-specific content and refocused
  1419.   the remainder of the document on CD-ROM installation, but a
  1420.   substantial part of the content is still his.
  1421.  
  1422.   The 4.1 version was substantially improved by some suggestions from
  1423.   David Shao <dshao@best.com>.
  1424.  
  1425.  
  1426.  
  1427.  
  1428.  
  1429.  
  1430.  
  1431.  
  1432.  
  1433.  
  1434.  
  1435.  
  1436.  
  1437.  
  1438.  
  1439.  
  1440.  
  1441.  
  1442.  
  1443.  
  1444.  
  1445.  
  1446.  
  1447.  
  1448.  
  1449.  
  1450.  
  1451.  
  1452.  
  1453.