home *** CD-ROM | disk | FTP | other *** search
/ Il CD di internet / CD.iso / HOWTO / BOOTDISK next >
Encoding:
Text File  |  1995-04-20  |  61.1 KB  |  1,909 lines

  1.   The Linux Bootdisk HOWTO
  2.   Graham Chapman, grahamc@zeta.org.au
  3.   v1.01, 6 February 1995
  4.  
  5.   This document    describes how to create    Linux boot, boot/root and util-
  6.   ity maintenance disks. These disks could be used as rescue disks or to
  7.   test new kernels.
  8.  
  9.   1.  Introduction
  10.  
  11.  
  12.   1.1.    Why Build Boot Disks?
  13.  
  14.   Linux    boot disks are useful in a number of situations, such as:
  15.  
  16.   o  Testing a new kernel.
  17.  
  18.   o  Recovering    from disk or system failure. Such a failure could be
  19.      anything from a lost boot sector to a disk    head crash.
  20.  
  21.   There    are several ways of producing boot disks:
  22.  
  23.   o  Use one from a distribution such as Slackware. This will at least
  24.      allow you to boot.
  25.  
  26.   o  Use a rescue package to set up disks designed to be used as rescue
  27.      disks.
  28.  
  29.   o  Learn what    is required for    each of    the various types of disk to
  30.      operate, then build your own.
  31.  
  32.   I choose the last option - learn how it works    so that    you can    do it
  33.   yourself. That way, if something breaks, you can work    out what to do
  34.   to fix it. Plus you learn a lot about    how Linux works    along the way.
  35.  
  36.   Experienced Linux users may find little of use in this document.
  37.   However users    new to Linux system administration who wish to protect
  38.   against root disk loss and other mishaps may find it useful.
  39.  
  40.   A note on versions - this document has been updated to support the
  41.   following packages and versions:
  42.  
  43.   o  Linux 1.1.73
  44.  
  45.   o  LILO 0.15
  46.  
  47.   Copyright (c)    Graham Chapman 1995.
  48.  
  49.   Permission is    granted    for this material to be    freely used and
  50.   distributed, provided    the source is acknowledged.  No    warranty of any
  51.   kind is provided. You    use this material at your own risk.
  52.  
  53.  
  54.   1.2.    Feedback and Credits
  55.  
  56.   I welcome any    feedback, good or bad, on the content of this document.
  57.   Please let me    know if    you find any errors or omissions.
  58.  
  59.   I thank the following    people for correcting errors and providing
  60.   useful suggestions for improvement:
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.       Randolph Bentson
  68.       Bjxrn-Helge Mevik
  69.       Johannes Stille
  70.  
  71.  
  72.  
  73.  
  74.  
  75.   1.3.    Change History
  76.  
  77.   v1.01, 6 February 1995
  78.  
  79.   o  Fix: DO NOT cp <kernel file> /dev/fd0 - this will overwrite any
  80.      file system on the    diskette.
  81.  
  82.   o  Fix: Put LILO boot.b and map files    on target disk.
  83.  
  84.   o  Add: -dp flags to cp commands to avoid problems.
  85.  
  86.   o  Chg: restructure to try to    improve    readability.
  87.  
  88.   o  Add: can now use ext2 filesystem on root diskettes.
  89.  
  90.   o  Chg: can now separate boot    and root diskettes.
  91.  
  92.   o  Add: credits section in Introduction.
  93.  
  94.   o  Add: FAQ.
  95.  
  96.   v1.0,    2 January 1995
  97.  
  98.   o  Converted to conform to HOWTO documentation standards.
  99.  
  100.   o  Added new section - Change    History.
  101.  
  102.   o  Various minor corrections.
  103.  
  104.   v0.10, 1 November 1994 Original version, labelled "draft".
  105.  
  106.  
  107.   2.  Disks
  108.  
  109.  
  110.   2.1.    Summary    of Disk    Types
  111.  
  112.   I classify boot-related disks    into 4 types. The discussion here and
  113.   throughout this document uses    the term "disk"    to refer to diskettes
  114.   unless otherwise specified. Most of the discussion could be equally
  115.   well applied to hard disks.
  116.  
  117.   A summary of disk types and uses is:
  118.  
  119.      boot
  120.     A disk containing a kernel which can be    booted.    The disk can
  121.     contain    a filesystem and use a boot loader to boot, or it can
  122.     simply contain the kernel only at the start of the disk.  The
  123.     disk can be used to boot the kernel using a root file system on
  124.     another    disk. This could be useful if you lost your boot loader
  125.     due to,    for example, an    incorrect installation attempt.
  126.  
  127.  
  128.      root
  129.     A disk with a file system containing everything    required to run
  130.     a Linux    system.    It does    not necessarily    contain    either a kernel
  131.     or a boot loader.
  132.  
  133.     This disk can be used to run the system    independently of any
  134.     other disks, once the kernel has been booted. A    special    kernel
  135.     feature    allows a separate root disk to be mounted after    booting,
  136.     with the root disk being automatically copied to a ramdisk.
  137.  
  138.     You could use this type    of disk    to check another disk for
  139.     corruption without mounting it,    or to restore another disk
  140.     following disk failure or loss of files.
  141.  
  142.  
  143.      boot/root
  144.     A disk which is    the same as a root disk, but contains a    kernel
  145.     and a boot loader. It can be used to boot from,    and to run the
  146.     system.    The advantage of this type of disk is that is it compact
  147.     - everything required is on a single disk.  However the
  148.     gradually increasing size of everything    means that it won't
  149.     necessarily always be possbile to fit everything on a single
  150.     diskette.
  151.  
  152.  
  153.      utility
  154.     A disk which contains a    file system, but is not    intended to be
  155.     mounted    as a root file system. It is an    additional data    disk.
  156.     You would use this type    of disk    to carry additional utilities
  157.     where you have too much    to fit on your root disk.
  158.  
  159.     The term "utility" only    really applies to diskettes, where you
  160.     would use a utility disk to store additional recovery utility
  161.     software.
  162.  
  163.  
  164.   2.2.    Boot
  165.  
  166.  
  167.   2.2.1.  Overview
  168.  
  169.   All PC systems start the boot    process    by executing code in ROM to load
  170.   the sector from sector 0, cylinder 0 of the boot drive and try and
  171.   execute it. On most bootable disks, sector 0,    cylinder 0 contains
  172.   either:
  173.  
  174.   o  code from a boot loader such as LILO, which locates the kernel,
  175.      loads it and executes it to start the boot    proper.
  176.  
  177.   o  the start of an operating system kernel, such as Linux.
  178.  
  179.   If a Linux kernel has    been written to    a diskette as a    raw device, then
  180.   the first sector will    be the first sector of the Linux kernel    itself,
  181.   and this sector will continue    the boot process by loading the    rest of
  182.   the kernel and running Linux.    For a more detailed description    of the
  183.   boot sector contents,    see the    documentation in lilo-01.5 or higher.
  184.  
  185.   An alternative method    of storing a kernel on a boot disk is to create
  186.   a filesystem,    not as a root filesystem, but simply as    a means    of
  187.   installing LILO and thus allowing boot-time command line options to be
  188.   specified. For example, the same kernel could    then be    used to    boot
  189.   using    a hard disk root filesystem, or    a diskette root    filesystem. This
  190.   could    be useful if you were trying to    rebuild    the hard disk
  191.   filesystem, and wanted to repeatedly test results.
  192.  
  193.  
  194.   2.2.2.  Setting Pointer to Root
  195.  
  196.   The kernel must somehow obtain a pointer to the drive    and partititon
  197.   to be    mounted    as the root drive. This    can be provided    in several ways:
  198.  
  199.   o  By    setting    ROOT_DEV = <device> in the Linux kernel    makefile and
  200.      rebuilding    the kernel (for    advice on how to rebuild the kernel,
  201.      read the Linux FAQ    and look in /usr/src/linux). Comments in the
  202.      Linux makefile describe the valid values for <device>.
  203.  
  204.   o  By    running    the rdev utility:
  205.  
  206.  
  207.            rdev <filename> <device>
  208.  
  209.  
  210.  
  211.  
  212.  
  213.   This will set    the root device    of the kernel contained    in <filename> to
  214.   be <device>. For example:
  215.  
  216.  
  217.            rdev Image /dev/sda1
  218.  
  219.  
  220.  
  221.  
  222.  
  223.   This sets the    root device in the kernel in Image to the first    parti-
  224.   tion on the first SCSI drive.
  225.  
  226.   There    are some alternative ways of issuing the rdev command. Try:
  227.  
  228.  
  229.            rdev -?
  230.  
  231.  
  232.  
  233.  
  234.   and it will display command usage.
  235.  
  236.   There    is usually no need to configure    the root device    for boot
  237.   diskette use,    because    the kernel currently used to boot from probably
  238.   already points to the    root drive device. The need can    arise, howoever,
  239.   if you obtain    a kernel from another machine, for example, from a
  240.   distribution,    or if you want to use the kernel to boot a root
  241.   diskette. It never hurts to check, though. To    use rdev to check the
  242.   current root device in a kernel file,    enter the command:
  243.  
  244.  
  245.            rdev -r <filename>
  246.  
  247.  
  248.  
  249.  
  250.   It is    possible to change the root device set in a kernel by means
  251.   other    than using rdev. For details, see the FAQ at the end of    this
  252.   document.
  253.  
  254.  
  255.   2.2.3.  Copying Kernel to Boot Diskette
  256.  
  257.   Once the kernel has been configured then it must be copied to    the boot
  258.   diskette.
  259.  
  260.   If the disk is not intended to contain a file    system,    then the kernel
  261.   must be copied using the dd command, as follows:
  262.  
  263.  
  264.  
  265.       dd if=<filename> of=<device>
  266.  
  267.       where      <filename> is    the name of the    kernel
  268.       and      <device> is the diskette raw device,
  269.           usually /dev/fd0
  270.  
  271.  
  272.  
  273.  
  274.   The seek parameter to    the dd command should NOT be used. The file must
  275.   be copied to start at    the boot sector    (sector    0, cylinder 0),    and
  276.   omitting the seek parameter will do this.
  277.  
  278.   The output device name varies. Many systems have /dev/fd0 as an alias
  279.   of one sort or another for the "real"    device name for    the default
  280.   diskette drive. For example, where the default drive (i.e. "drive A:"
  281.   in DOS) is a high density 3 1/2 inch diskette    drive, the device name
  282.   will be /dev/fd0H1440, but usually /dev/fd0 points to    the same device.
  283.  
  284.   Where    the kernel is to be copied to a    boot disk containing a
  285.   filesystem, then the disk is mounted at a suitable point in a
  286.   currently-mounted filesystem,    then the cp command is used. For
  287.   example:
  288.  
  289.  
  290.            mount -t    ext2 /dev/fd0 /mnt
  291.            cp Image    /mnt
  292.            umount /mnt
  293.  
  294.  
  295.  
  296.  
  297.  
  298.   2.3.    Root
  299.  
  300.  
  301.   2.3.1.  Overview
  302.  
  303.   A root disk contains a complete working Linux    system,    but without
  304.   necessarily including    a kernel. In other words, the disk may not be
  305.   bootable, but    once the kernel    is running, the    root disk contains
  306.   everything needed to support a full Linux system. To be able to do
  307.   this,    the disk must include the minimum requirements for a Linux
  308.   system:
  309.  
  310.   o  File system.
  311.  
  312.   o  Minimum set of directories    - dev, proc, bin, etc, lib, usr, tmp.
  313.  
  314.   o  Basic set of utilities - bash (to run a shell), ls, cp etc.
  315.  
  316.   o  Minimum set of config files - rc, inittab,    fstab etc.
  317.  
  318.   o  Runtime library to    provide    basic functions    used by    utilities.
  319.  
  320.   Of course, any system    only becomes useful when you can run something
  321.   on it, and a root diskette usually only becomes useful when you can do
  322.   something like:
  323.  
  324.   o  Check a file system on another drive, for example to check    your
  325.      root file system on your hard drive, you need to be able to boot
  326.      Linux from    another    drive, as you can with a root diskette system.
  327.      Then you can run fsck on your original root drive while it    is not
  328.      mounted.
  329.  
  330.  
  331.   o  Restore all or part of your original root drive from backup using
  332.      archive/compression utilities including cpio, tar,    gzip and ftape.
  333.  
  334.  
  335.   2.4.    Boot/Root
  336.  
  337.   This is essentially the same as the root disk, with the addition of a
  338.   kernel and a boot loader such    as LILO.
  339.  
  340.   With this configuration, a kernel file is copied to the root file
  341.   system, and LILO is then run to install a configuration which    points
  342.   to the kernel    file on    the target disk. At boot time, LILO will boot
  343.   the kernel from the target disk.
  344.  
  345.   Several files    must be    copied to the diskette for this    method to work.
  346.   Details of these files and the required LILO configuration, including
  347.   a working sample, are    given below in the section titled "LILO".
  348.  
  349.  
  350.   2.4.1.  RAM Drives and Root Filesystems on Diskette
  351.  
  352.   For a    diskette root filesystem to be efficient, you need to be able to
  353.   run it from a    ramdrive, i.e. an emulated disk    drive in main memory.
  354.   This avoids having the system    run at a snail's pace, which a diskette
  355.   would    impose.
  356.  
  357.   There    is an added benefit from using a ramdrive - the    Linux kernel
  358.   includes an automatic    ramdisk    root feature, whereby it will, under
  359.   certain circumstances, automatically copy the    contents of a root
  360.   diskette to a    RAM disk, and then switch the root drive to be the RAM
  361.   disk instead of the diskette.    This has two major benefits:
  362.  
  363.   o  The system    runs a lot faster.
  364.  
  365.   o  The diskette drive    is freed up to allow other diskettes to    be used
  366.      on    a single-diskette drive    system.
  367.  
  368.   The requirements for this feature to be invoked are:
  369.  
  370.   o  The file system on    the diskette drive must    be either a minix or an
  371.      ext2 file system. The ext2    file system is generally the preferred
  372.      file system to use. Note that if you have a Linux kernel earlier
  373.      than 1.1.73, then you should see the comments in the section below
  374.      titled "File Systems" to see whether your kernel will support ext2.
  375.      If    your kernel is old then    you may    have to    use minix. This    will not
  376.      cause any significant problems.
  377.  
  378.   o  A RAM disk    must be    configured into    the kernel, and    it must    be at
  379.      least as big as the diskette drive.
  380.  
  381.   A RAM    disk can be configured into the    kernel in several ways:
  382.  
  383.   o  By    uncommenting the RAMDISK macro in the Linux kernel makefile, so
  384.      that it reads:
  385.  
  386.  
  387.            RAMDISK = -DRAMDISK=1440
  388.  
  389.  
  390.  
  391.  
  392.   to define a ramdisk of 1440 1K blocks, the size of a high-density
  393.   diskette.
  394.  
  395.   o  By    running    the rdev utility, available on most Linux systems. This
  396.      utility displays or sets values for several things    in the kernel,
  397.      including the desired size    for a ramdisk. To configure a ramdisk of
  398.      1440 blocks into a    kernel in a file named Image, enter:
  399.  
  400.  
  401.            rdev -r Image 1440
  402.  
  403.  
  404.  
  405.  
  406.   this might change in the future, of course. To see what your version
  407.   of rdev does,    enter the command:
  408.  
  409.  
  410.            rdev -?
  411.  
  412.  
  413.  
  414.  
  415.   and it should    display    its options.
  416.  
  417.   o  By    using the boot loader package LILO to configure    it into    your
  418.      kernel at boot time. This can be done using the LILO configuration
  419.      parameter:
  420.  
  421.  
  422.            ramdisk = 1440
  423.  
  424.  
  425.  
  426.  
  427.   to request a RAM drive of 1440 1K blocks at boot time.
  428.  
  429.   o  By    interrupting a LILO automatic boot and adding ramdisk=1440 to
  430.      the command line. For example, such a command line    might be:
  431.  
  432.  
  433.            vmlinux ramdisk=1440
  434.  
  435.  
  436.  
  437.  
  438.   See the section on LILO for more details.
  439.  
  440.   o  By    editing    the kernel file    and altering the values    near the start
  441.      of    the file which record the ramdisk size.    This is    definitely a
  442.      last resort, but can be done. See the FAQ near the    end of this
  443.      document for more details.
  444.  
  445.   The easiest of these methods is LILO configuration, because you need
  446.   to set up a LILO configuration file anyway, so why not add the ramdisk
  447.   size here?
  448.  
  449.   LILO configuration is    briefly    described in a section titled "LILO"
  450.   below, but it    is advisable to    obtain the latest stable version of LILO
  451.   from your nearest Linux mirror site, and read    the documentation that
  452.   comes    with it.
  453.  
  454.  
  455.   2.5.    Utility
  456.  
  457.   Often    one disk is not    sufficient to hold all the software you    need to
  458.   be able to perform rescue functions of analysing, repairing and
  459.   restoring corrupted disk drives. By the time you include tar,    gzip
  460.   e2fsck, fdisk, Ftape and so on, there    is enough for a    whole new
  461.   diskette, maybe even more if you want    lots of    tools.
  462.  
  463.   This means that a rescue set often requires a    utility    diskette, with a
  464.   file system containing any extra files required. This    file system can
  465.   then be mounted at a convenient point, such as /usr, on the boot/root
  466.   system.
  467.  
  468.   Creating a file system is fairly easy, and is    described above    in the
  469.   section titled "File Systems"    above.
  470.  
  471.  
  472.   3.  Components
  473.  
  474.  
  475.   3.1.    File Systems
  476.  
  477.   The Linux kernel now supports    two file system    types for root disks to
  478.   be automatically copied to ramdisk. These are    minix and ext2,    of which
  479.   ext2 is the preferred    file system.  The ext2 support was added
  480.   sometime between 1.1.17 and 1.1.57, I'm not sure exactly which. If you
  481.   have a kernel    within this range then edit
  482.   /usr/src/linux/drivers/block/ramdisk.c and look for the word "ext2".
  483.   If it    is not found, then you will have to use    a minix    file system, and
  484.   therefore the    "mkfs" command to create it.
  485.  
  486.   To create an ext2 file system    on a diskette on my system, I issue the
  487.   following command:
  488.  
  489.  
  490.            mke2fs /dev/fd0
  491.  
  492.  
  493.  
  494.  
  495.   The mke2fs command will automatically    detect the space available and
  496.   configure itself accordingly.    It does    not therefore require any
  497.   parameters.
  498.  
  499.   An easy way to test the result is to create a    system using the above
  500.   command or similar, and then attempt to mount    the diskette. If it is
  501.   an ext2 system, then the command:
  502.  
  503.  
  504.            mount -t    ext2 /dev/fd0 /<mount point>
  505.  
  506.  
  507.  
  508.  
  509.   should work.
  510.  
  511.  
  512.   3.2.    Kernel
  513.  
  514.  
  515.   3.2.1.  Building a Custom Kernel
  516.  
  517.   In most cases    it would be possible to    copy your current kernel and
  518.   boot the diskette from that. However there may be cases where    you wish
  519.   to build a separate one.
  520.  
  521.   One reason is    size.  The kernel is one of the    largest    files in a
  522.   minimum system, so if    you want to build a boot/root diskette,    then you
  523.   will have to reduce the size of the kernel as    much as    possible.  The
  524.   kernel now supports changing the diskette after booting and before
  525.   mounting root, so it is not necessary    any more to squeeze the    kernel
  526.   into the same    disk as    everything else, therefore these comments apply
  527.   only if you choose to    build a    boot/root diskette.
  528.  
  529.   There    are two    ways of    reducing kernel    size:
  530.  
  531.   o  Building it with the minumum set of facilities necessary to support
  532.      the desired system. This means leaving out    everything you don't
  533.      need. Networking is a good    thing to leave out, as well as support
  534.      for any disk drives and other devices which you don't need    when
  535.      running your boot/root system.
  536.  
  537.   o  Compressing it, using the standard    compressed-kernel option
  538.      included in the makefile:
  539.  
  540.  
  541.            make zImage
  542.  
  543.  
  544.  
  545.  
  546.   Refer    to the documentation included with the kernel source for up-to-
  547.   date information on building compressed kernels.  Note that the kernel
  548.   source is usually in /usr/src/linux.
  549.  
  550.   Having worked    out a minimum set of facilities    to include in a    kernel,
  551.   you then need    to work    out what to add    back in. Probably the most
  552.   common uses for a boot/root diskette system would be to examine and
  553.   restore a corrupted root file    system,    and to do this you may need
  554.   kernel support.
  555.  
  556.   For example, if your backups are all held on tape using Ftape    to
  557.   access your tape drive, then,    if you lose your current root drive and
  558.   drives containing Ftape, then    you will not be    able to    restore    from
  559.   your backup tapes. You will have to reinstall    Linux, download    and
  560.   reinstall Ftape, and then try    and read your backups.
  561.  
  562.   It is    probably desirable to maintain a copy of the same version of
  563.   backup utilities used    to write the backups, so that you don't    waste
  564.   time trying to install versions that cannot read your    backup tapes.
  565.  
  566.   The point here is that, whatever I/O support you have    added to your
  567.   kernel to support backups should also    be added into your boot/root
  568.   kernel. Note,    though,    that the Ftape module (or at least the one I
  569.   have)    is quite large and will    not fit    on your    boot/root diskette. You
  570.   will need to put it on a utility diskette - this is described    below in
  571.   the section titled "ADDING UTILITY DISKETTES".
  572.  
  573.   The procedure    for actually building the kernel is described in the
  574.   documentation    that comes with    the kernel. It is quite    easy to    follow,
  575.   so start by looking in /usr/src/linux. Note that if you have trouble
  576.   building a kernel, then you should probably not attempt to build
  577.   boot/root systems anyway.
  578.  
  579.  
  580.   3.3.    Devices
  581.  
  582.   A /dev directory containing a    special    file for all devices to    be used
  583.   by the system    is mandatory for any Linux system. The directory itself
  584.   is a normal directory, and can be created with the mkdir command in
  585.   the normal way. The device special files, however, must be created in
  586.   a special way, using the mknod command.
  587.  
  588.   There    is a shortcut, though -    copy your existing /dev    directory
  589.   contents, and    delete the ones    you don't want.    The only requirement is
  590.   that you copy    the device special files using the -R option. This will
  591.   copy the directory without attempting    to copy    the contents of    the
  592.   files. Note that if you use lower caser, as in "-r", there will be a
  593.   vast difference, because you will probably end up copying the    entire
  594.   contents of all of your hard disks - or at least as much of them as
  595.   will fit on a    diskette! Therefore, take care,    and use    the command:
  596.  
  597.  
  598.            cp -dpR /dev /mnt
  599.  
  600.  
  601.  
  602.  
  603.   assuming that    the diskette is    mounted    at /mnt. The dp    switches ensure
  604.   that symbolic    links are copied as links (rather than the target file
  605.   being    copied)    and that the original file attributes are preserved,
  606.   thus preserving ownership information.
  607.  
  608.   If you want to do it the hard    way, use ls -l to display the major and
  609.   minor    device numbers for the devices you want, and create them on the
  610.   diskette using mknod.
  611.  
  612.   Many distributions include a shell script called MAKEDEV in the /dev
  613.   directory. This shell    script could be    used to    create the devices, but
  614.   it is    probably easier    to just    copy your existing ones, especially for
  615.   rescue disk purposes.
  616.  
  617.  
  618.   3.4.    Directories
  619.  
  620.   It might be possible to get away with    just /dev, /proc and /etc to run
  621.   a Linux system. I don't know - I've never tested it. However a
  622.   reasonable minimum set of directories    consists of the    following:
  623.  
  624.      /dev
  625.     Required to perform I/O    with devices
  626.  
  627.      /proc
  628.     Required by the    ps command
  629.  
  630.      /etc
  631.     System configuration files
  632.  
  633.      /bin
  634.     Utility    executables considered part of the system
  635.  
  636.      /lib
  637.     Shared libraries to provide run-time support
  638.  
  639.      /mnt
  640.     A mount    point for maintenance on other disks
  641.  
  642.      /usr
  643.     Additional utilities and applications
  644.  
  645.   Note that the    directory tree presented here is for root diskette use
  646.   only.     Refer to the Linux File System    Standard for much better
  647.   information on how file systems should be structured in "standard"
  648.   Linux    systems.
  649.  
  650.   Four of these    directories can    be created very    easily:
  651.  
  652.   o  /dev is described above in    the section titled DEVICES.
  653.  
  654.   o  /proc only    needs to exist.    Once the directory is created using
  655.      mkdir, nothing more is required.
  656.  
  657.   o  Of    the others, /mnt and /usr are included in this list only as
  658.      mount points for use after    the boot/root system is    running.  Hence
  659.      again, these directories only need    to be created.
  660.  
  661.   The remaining    3 directories are described in the following sections.
  662.  
  663.  
  664.   3.4.1.  /etc
  665.  
  666.   This directory must contain a    number of configuration    files. On most
  667.   systems, these can be    divided    into 3 groups:
  668.  
  669.   o  Required at all times, e.g. rc, fstab, passwd.
  670.  
  671.   o  May be required, but no-one is too    sure.
  672.  
  673.   o  Junk that crept in.
  674.  
  675.   Files    which are not essential    can be identified with the command:
  676.  
  677.  
  678.            ls -ltru
  679.  
  680.  
  681.  
  682.  
  683.   This lists files in reverse order of date last accessed, so if any
  684.   files    are not    being accessed,    then they can be omitted from a    root
  685.   diskette.
  686.  
  687.   On my    root diskettes,    I have the number of config files down to 15.
  688.   This reduces my work to dealing with three sets of files:
  689.  
  690.   o  The ones I    must configure for a boot/root system:
  691.  
  692.  
  693.            rc      system startup script
  694.            fstab   list of file systems to be mounted
  695.            inittab parameters for the init process - the
  696.                first process started at    boot time.
  697.  
  698.  
  699.  
  700.  
  701.  
  702.   o  the ones I    should tidy up for a boot/root system:
  703.  
  704.  
  705.            passwd  list of logins
  706.            shadow  contains    passwords
  707.  
  708.  
  709.  
  710.  
  711.   These    should be pruned on secure systems to avoid copying user's pass-
  712.   words    off the    system,    and so that when you boot from diskette,
  713.   unwanted logins are rejected.
  714.  
  715.   o  The rest. They work at the    moment,    so I leave them    alone.
  716.  
  717.   Out of this, I only really have to configure two files, and what they
  718.   should contain is suprisingly    small.
  719.  
  720.   o  rc    should contain:
  721.  
  722.  
  723.            #!/bin/sh
  724.            /etc/mount -av
  725.            /bin/hostname boot_root
  726.  
  727.   and I    don't really need to run hostname - it just looks nicer    if I do.
  728.   Even mount is    actually only needed to    mount /proc to support the ps
  729.   command - Linux will run without it.
  730.  
  731.   o  fstab should contain:
  732.  
  733.  
  734.            /dev/fd0           /           ext2    defaults
  735.            /proc           /proc           proc    defaults
  736.  
  737.  
  738.  
  739.  
  740.   I don't think    that the first entry is    really needed, but I find that
  741.   if I leave it    out, mount won't mount /proc.
  742.  
  743.   Inittab should be ok as is, unless you want to ensure    that users on
  744.   serial ports cannot login. To    prevent    this, comment out all the
  745.   entries for /etc/getty which include a ttys or ttyS device at    the end
  746.   of the line.    Leave in the tty ports so that you can login at    the
  747.   console.
  748.  
  749.   For the rest,    just copy all the text files in    your /etc directory,
  750.   plus all the executables in your /etc    directory that you cannot be
  751.   sure you do not need.    As a guide, consult the    sample ls listing in
  752.   "Sample Boot/Root ls-lR Directory Listing" - this is what I have, so
  753.   probably it will be sufficient for you if you    copy only those    files.
  754.  
  755.  
  756.   3.4.2.  /bin
  757.  
  758.   Here is a convenient point to    place the extra    utilities you need to
  759.   perform basic    operations, utilities such as ls, mv, cat, dd etc.
  760.  
  761.   See the section titled "Sample Boot/Root ls-lR Directory Listing" for
  762.   the list of files that I place in my boot/root /bin directory. You may
  763.   notice that it does not include any of the utilities required    to
  764.   restore from backup, such as cpio, tar, gzip etc. That is because I
  765.   place    these on a separate utility diskette, to save space on the
  766.   boot/root diskette. Once I have booted my boot/root diskette,    it then
  767.   copies itself    to the ramdisk leaving the diskette drive free to mount
  768.   another diskette, the    utility    diskette. I usually mount this as /usr.
  769.  
  770.   Creation of a    utility    diskette is described below in the section
  771.   titled "Adding Utility Diskettes".
  772.  
  773.  
  774.   3.4.3.  /lib
  775.  
  776.   Two libraries    are required to    run many facilities under Linux:
  777.  
  778.   o  ld.so
  779.  
  780.   o  libc.so.4
  781.  
  782.   If they are not found    in your    /lib directory then the    system will be
  783.   unable to boot. If you're lucky you may see an error message telling
  784.   you why.
  785.  
  786.   These    should be present in you existing /lib directory. Note that
  787.   libc.so.4 may    be a symlink to    a libc library with version number in
  788.   the filename.    If you issue the command:
  789.  
  790.  
  791.            ls -l /lib
  792.  
  793.   you will see something like:
  794.  
  795.  
  796.            libc.so.4 -> libc.so.4.5.21
  797.  
  798.  
  799.  
  800.  
  801.   In this case,    the libc library you want is libc.so.4.5.21.
  802.  
  803.  
  804.   3.5.    LILO
  805.  
  806.  
  807.   3.5.1.  Overview
  808.  
  809.   For the boot/root to be any use, it must be bootable.    To achieve this,
  810.   the easiest way (possibly the    only way?) is to install a boot    loader,
  811.   which    is a piece of executable code stored at    sector 0, cylinder 0 of
  812.   the diskette.    See the    section    above titled "BOOT DISKETTE" for an
  813.   overview of the boot process.
  814.  
  815.   LILO is a tried and trusted boot loader available from any Linux
  816.   mirror site. It allows you to    configure the boot loader, including:
  817.  
  818.   o  Which device is to    be mounted as the root drive.
  819.  
  820.   o  Whether to    use a ramdisk.
  821.  
  822.  
  823.   3.5.2.  Sample LILO Configuration
  824.  
  825.   This provides    a very convenient place    to specify to the kernel how it
  826.   should boot. My root/boot LILO configuration file, used with LILO
  827.   0.15,    is:
  828.  
  829.  
  830.        ______________________________________________________________________
  831.        boot = /dev/fd0
  832.        install = ./mnt/boot.b
  833.        map = ./mnt/lilo.map
  834.        delay = 50
  835.        message = ./mnt/lilo.msg
  836.        timeout = 150
  837.        compact
  838.        image = ./mnt/vmlinux
  839.            ramdisk = 1440
  840.            root = /dev/fd0
  841.        ______________________________________________________________________
  842.  
  843.  
  844.  
  845.  
  846.   Note that boot.b, lilo.msg and the kernel must first have been copied
  847.   to the diskette using    a command similar to:
  848.  
  849.  
  850.        ______________________________________________________________________
  851.        cp /boot/boot.b ./mnt
  852.        ______________________________________________________________________
  853.  
  854.  
  855.  
  856.  
  857.   If this is not done, then LILO will not run correctly    at boot    time if
  858.   the hard disk    is not available, and there is little point setting up a
  859.   rescue disk which requires a hard disk in order to boot.
  860.  
  861.   I run    lilo using the command:
  862.  
  863.  
  864.            /sbin/lilo -C <configfile>
  865.  
  866.  
  867.  
  868.  
  869.   I run    it from    the directory containing the mnt directory where I have
  870.   mounted the diskette.    This means that    I am telling LILO to install a
  871.   boot loader on the boot device (/dev/fd0 in this case), to boot a
  872.   kernel in the    root directory of the diskette.
  873.  
  874.   I have also specified    that I want the    root device to be the diskette,
  875.   and I    want a RAM disk    created    of 1440    1K blocks, the same size as the
  876.   diskette. Since I have created an ext2 file system on    the diskette,
  877.   this completes all the conditions required for Linux to automatically
  878.   switch the root device to the    ramdisk, and copy the diskette contents
  879.   there    as well.
  880.  
  881.   The ramdisk features of Linux    are described further in the section
  882.   above    titled "RAM DRIVES AND BOOT/ROOT SYSTEMS".
  883.  
  884.   It is    also worth considering using the "single" parameter to cause
  885.   Linux    to boot    in single-user mode. This could    be useful to prevent
  886.   users    logging    in on serial ports.
  887.  
  888.   I also use the "DELAY" "MESSAGE" and "TIMEOUT" statements so that when
  889.   I boot the disk, LILO    will give me the opportunity to    enter command
  890.   line options if I wish. I don't need them at present,    but I never know
  891.   when I might want to set a different root device or mount a filesystem
  892.   read-only.
  893.  
  894.   The message file I use contains the message:
  895.  
  896.  
  897.  
  898.        Linux Boot/Root Diskette
  899.        ========================
  900.  
  901.        Enter a command line of the form:
  902.  
  903.          vmlinux [ command-line options]
  904.  
  905.        If nothing is entered, linux will be loaded with
  906.        defaults    after 15 seconds.
  907.  
  908.  
  909.  
  910.  
  911.   This is simply a reminder to myself what my choices are.
  912.  
  913.   Readers are urged to read the    LILO documentation carefully before
  914.   atttempting to install anything. It is relatively easy to destroy
  915.   partitions if    you use    the wrong "boot    = " parameter. If you are
  916.   inexperienced, do NOT    run LILO until you are sure you    understand it
  917.   and you have triple-checked your parameters.
  918.  
  919.  
  920.   3.5.3.  Removing LILO
  921.  
  922.   One other thing I might as well add here while I'm on    the LILO topic:
  923.   if you mess up lilo on a drive containing DOS, you can always    replace
  924.   the boot sector with the DOS boot loader by issuing the DOS command:
  925.            FDISK /MBR
  926.  
  927.  
  928.  
  929.  
  930.   where    MBR stands for "Master Boot Record". Note that some purists
  931.   disagree with    this, and they may have    grounds, but it    works.
  932.  
  933.  
  934.   3.5.4.  Useful LILO Options
  935.  
  936.  
  937.   LILO has several useful options which    are worth keeping in mind when
  938.   building boot    disks:
  939.  
  940.   o  Command line options - you    can enter command line options to set
  941.      the root device, ramdrive size, special device parameters,    or other
  942.      things. If    you include the    DELAY =    nn statement in    your LILO
  943.      configuration file, then LILO will    pause to allow you to select a
  944.      kernel image to boot, and to enter, on the    same line, any options.
  945.      For example:
  946.  
  947.  
  948.            vmlinux aha152x=0x340,11,3,1 ro
  949.  
  950.  
  951.  
  952.  
  953.   will pass the    aha152x    parameters through to the aha152x scsi disk
  954.   driver (provided that    driver has been    included when the kernel was
  955.   built) and will ask for the root filesystem to be mounted read-only.
  956.  
  957.   o  Command line "lock" option    - this option asks LILO    to store the
  958.      command line entered as the default command line to be used for all
  959.      future boots. This    is particularly    useful where you have a    device
  960.      which cannot be autoselected. By using "lock" you can avoid having
  961.      to    type in    the device parameter string every time you boot.  For
  962.      example:
  963.  
  964.  
  965.            vmlinux aha152x=0x340,11,3,1 root=/dev/sda8 ro lock
  966.  
  967.  
  968.  
  969.  
  970.   o  APPEND configuration statement - this allows device parameter
  971.      strings to    be stored in the configuration,    as an alternative to
  972.      using the "lock" command line option. Note    that any keywords of the
  973.      form word=value MUST be enclosed in quotes. For example:
  974.  
  975.  
  976.            APPEND =    "aha152x=0x340,11,3,1"
  977.  
  978.  
  979.  
  980.  
  981.   o  DELAY configuration statement - this pauses for DELAY tenths of
  982.      seconds and allows    the user to interrupt the automatic boot of the
  983.      default command line, so that the user can    enter an alternate
  984.      command line.
  985.  
  986.  
  987.   4.  Samples
  988.  
  989.  
  990.  
  991.   4.1.    Disk Directory Listings
  992.  
  993.   This lists the contents of files and directories that    I keep on my
  994.   hard disk to use when    building boot/root and utility diskettes.  It
  995.   shows    which files I put in the /etc and /bin directories on my
  996.   diskettes.
  997.  
  998.   The sample shell scripts in the next section use these directories and
  999.   files    as a model to build the    diskettes.
  1000.  
  1001.  
  1002.   4.1.1.  Boot/Root Disk ls-lR Directory Listing
  1003.  
  1004.   The boot/root    listing    is of directory    boot_disk:
  1005.  
  1006.  
  1007.  
  1008.  
  1009.  
  1010.  
  1011.  
  1012.  
  1013.  
  1014.  
  1015.  
  1016.  
  1017.  
  1018.  
  1019.  
  1020.  
  1021.  
  1022.  
  1023.  
  1024.  
  1025.  
  1026.  
  1027.  
  1028.  
  1029.  
  1030.  
  1031.  
  1032.  
  1033.  
  1034.  
  1035.  
  1036.  
  1037.  
  1038.  
  1039.  
  1040.  
  1041.  
  1042.  
  1043.  
  1044.  
  1045.  
  1046.  
  1047.  
  1048.  
  1049.  
  1050.  
  1051.  
  1052.  
  1053.  
  1054.  
  1055.  
  1056.  
  1057.   total    226
  1058.   drwxr-xr-x   2 root      root           1024 Oct     8 13:40 bin/
  1059.   drwxr-xr-x   2 root      root           3072 Sep     8 16:37 dev/
  1060.   drwxr-xr-x   2 root      root           1024 Oct     8 12:38 etc/
  1061.   drwxr-xr-x   2 root      root           1024 Sep    10 14:58 lib/
  1062.   -rw-r--r--   1 root      root         297956 Jan    25 21:55 vmlinux
  1063.  
  1064.   boot_disk/bin:
  1065.   total    366
  1066.   -rwxr-xr-x   1 root      root           4376 Sep     9 21:34 cat*
  1067.   -rwxr-xr-x   1 root      root           4112 Sep     9 21:34 chown*
  1068.   -rwxr-xr-x   1 root      root          12148 Sep     9 21:34 cp*
  1069.   -rwxr-xr-x   1 root      root           4376 Sep     9 21:34 cut*
  1070.   -rwxr-xr-x   1 root      root           7660 Sep     9 21:34 dd*
  1071.   -rwxr-xr-x   1 root      root           4696 Sep     9 21:34 df*
  1072.   -rwx--x--x   1 root      root           1392 Sep    10 14:13 hostname*
  1073.   -rwxr-xr-x   1 root      root           5252 Sep     9 21:34 ln*
  1074.   -rwsr-xr-x   1 root      root           6636 Sep     9 21:34 login*
  1075.   -rwxr-xr-x   1 root      root          13252 Sep     9 21:34 ls*
  1076.   -rwxr-xr-x   1 root      root           4104 Sep     9 21:34 mkdir*
  1077.   -rwxr-xr-x   1 root      root          21504 Sep    10 15:27 more*
  1078.   -rwxr-xr-x   1 root      root           6744 Sep     9 21:34 mv*
  1079.   -rwxr-xr-x   1 root      root           9780 Sep     9 21:34 ps*
  1080.   -rwxr-xr-x   1 root      root           5076 Sep     9 21:34 rm*
  1081.   -r-xr-xr-x   1 root      root          12604 Sep     9 21:34 sed*
  1082.   -rwxr-xr-x   1 root      root         222208 Sep     9 21:34 sh*
  1083.   -rws--x--x   1 root      root          16464 Sep     9 21:34 su*
  1084.   -rwxr-xr-x   1 root      root           1216 Sep     9 21:34 sync*
  1085.  
  1086.   boot_disk/dev:
  1087.   total    73
  1088.   -rwxr-xr-x   1 root      root           8331 Sep     8 16:31 MAKEDEV*
  1089.   crw-r--r--   1 root      root        10,      3 Sep     8 16:31 bmouseatixl
  1090.   crw-r--r--   1 root      root        10,      0 Sep     8 16:31 bmouselogitec
  1091.   crw-r--r--   1 root      root        10,      2 Sep     8 16:31 bmousems
  1092.   crw-r--r--   1 root      root        10,      1 Sep     8 16:31 bmouseps2
  1093.   crw-------   1 root      root         0,      0 Sep     8 16:31 boot0
  1094.   crw-r--r--   1 root      root         4,      0 Sep     8 16:31 console
  1095.   crw-r--r--   1 root      root         5,     64 Sep     8 16:31 cua0
  1096.   crw-r--r--   1 root      root         5,     65 Sep     8 16:31 cua1
  1097.   crw-r--r--   1 root      root         5,     66 Sep     8 16:31 cua2
  1098.   crw-r--r--   1 root      root         5,     67 Sep     8 16:31 cua3
  1099.   brw-r--r--   1 root      root         2,      0 Sep     8 16:31 fd0
  1100.   brw-r--r--   1 root      root         2,     12 Sep     8 16:31 fd0D360
  1101.   brw-r--r--   1 root      root         2,     16 Sep     8 16:31 fd0D720
  1102.   brw-r--r--   1 root      root         2,     28 Sep     8 16:31 fd0H1440
  1103.   brw-r--r--   1 root      root         2,     12 Sep     8 16:31 fd0H360
  1104.   brw-r--r--   1 root      root         2,     16 Sep     8 16:31 fd0H720
  1105.   brw-r--r--   1 root      root         2,     16 Sep     8 16:31 fd0Q720
  1106.   brw-r--r--   1 root      root         2,      4 Sep     8 16:31 fd0d360
  1107.   brw-r--r--   1 root      root         2,      8 Sep     8 16:31 fd0h1200
  1108.   brw-r--r--   1 root      root         2,     20 Sep     8 16:31 fd0h360
  1109.   brw-r--r--   1 root      root         2,     24 Sep     8 16:31 fd0h720
  1110.   brw-r--r--   1 root      root         2,     24 Sep     8 16:31 fd0q720
  1111.   brw-r--r--   1 root      root         2,      1 Sep     8 16:31 fd1
  1112.   brw-r--r--   1 root      root         2,     13 Sep     8 16:31 fd1D360
  1113.   brw-r--r--   1 root      root         2,     17 Sep     8 16:31 fd1D720
  1114.   brw-r--r--   1 root      root         2,     29 Sep     8 16:31 fd1H1440
  1115.   brw-------   1 root      root         2,     31 Sep     8 16:31 fd1H1722
  1116.   brw-r--r--   1 root      root         2,     13 Sep     8 16:31 fd1H360
  1117.   brw-r--r--   1 root      root         2,     17 Sep     8 16:31 fd1H720
  1118.   brw-r--r--   1 root      root         2,     17 Sep     8 16:31 fd1Q720
  1119.   brw-r--r--   1 root      root         2,      5 Sep     8 16:31 fd1d360
  1120.   brw-r--r--   1 root      root         2,      9 Sep     8 16:31 fd1h1200
  1121.   brw-r--r--   1 root      root         2,     21 Sep     8 16:31 fd1h360
  1122.   brw-r--r--   1 root      root         2,     25 Sep     8 16:31 fd1h720
  1123.   brw-r--r--   1 root      root         2,     25 Sep     8 16:31 fd1q720
  1124.   brw-r-----   1 root      root         3,      0 Sep     8 16:31 hda
  1125.   brw-r-----   1 root      root         3,      1 Sep     8 16:31 hda1
  1126.   brw-r-----   1 root      root         3,      2 Sep     8 16:31 hda2
  1127.   brw-r-----   1 root      root         3,      3 Sep     8 16:31 hda3
  1128.   brw-r-----   1 root      root         3,      4 Sep     8 16:31 hda4
  1129.   brw-r-----   1 root      root         3,      5 Sep     8 16:31 hda5
  1130.   brw-r-----   1 root      root         3,      6 Sep     8 16:31 hda6
  1131.   brw-r-----   1 root      root         3,      7 Sep     8 16:31 hda7
  1132.   brw-r-----   1 root      root         3,      8 Sep     8 16:31 hda8
  1133.   brw-r-----   1 root      root         3,     64 Sep     8 16:31 hdb
  1134.   brw-r-----   1 root      root         3,     65 Sep     8 16:31 hdb1
  1135.   brw-r-----   1 root      root         3,     66 Sep     8 16:31 hdb2
  1136.   brw-r-----   1 root      root         3,     67 Sep     8 16:31 hdb3
  1137.   brw-r-----   1 root      root         3,     68 Sep     8 16:31 hdb4
  1138.   brw-r-----   1 root      root         3,     69 Sep     8 16:31 hdb5
  1139.   brw-r-----   1 root      root         3,     70 Sep     8 16:31 hdb6
  1140.   brw-r-----   1 root      root         3,     71 Sep     8 16:31 hdb7
  1141.   brw-r-----   1 root      root         3,     72 Sep     8 16:31 hdb8
  1142.   crw-r-----   1 root      root         1,      2 Sep     8 16:31 kmem
  1143.   brw-------   1 root      root        12,      0 Sep     8 16:31 loop0
  1144.   brw-------   1 root      root        12,      1 Sep     8 16:31 loop1
  1145.   crw-r--r--   1 root      root         6,      0 Sep     8 16:31 lp0
  1146.   crw-r--r--   1 root      root         6,      1 Sep     8 16:31 lp1
  1147.   crw-r--r--   1 root      root         6,      2 Sep     8 16:31 lp2
  1148.   brw-r--r--   1 root      root        12,      0 Sep     8 16:31 mcd0
  1149.   crw-r-----   1 root      root         1,      1 Sep     8 16:31 mem
  1150.   crw-r--r--   1 root      root         5,     65 Sep     8 16:31 modem
  1151.   crw-r--r--   1 root      root         5,     64 Sep     8 16:31 mouse
  1152.   crw-r--r--   1 root      root        27,      4 Sep     8 16:31 nrft0
  1153.   crw-r--r--   1 root      root        27,      5 Sep     8 16:31 nrft1
  1154.   crw-r--r--   1 root      root        27,      6 Sep     8 16:31 nrft2
  1155.   crw-r--r--   1 root      root        27,      7 Sep     8 16:31 nrft3
  1156.   crw-------   1 root      root         9,    128 Sep     8 16:31 nrmt0
  1157.   crw-r--r--   1 root      root         1,      3 Sep     8 16:31 null
  1158.   crw-r-----   1 root      root         6,      0 Sep     8 16:31 par0
  1159.   crw-r-----   1 root      root         6,      1 Sep     8 16:31 par1
  1160.   crw-r-----   1 root      root         6,      2 Sep     8 16:31 par2
  1161.   crw-r-----   1 root      root         1,      4 Sep     8 16:31 port
  1162.   crw-r--r--   1 root      root        10,      1 Sep     8 16:31 ps2aux
  1163.   crw-r--r--   1 root      root         4,    128 Sep     8 16:31 ptyp0
  1164.   crw-r--r--   1 root      root         4,    129 Sep     8 16:31 ptyp1
  1165.   crw-r--r--   1 root      root         4,    130 Sep     8 16:31 ptyp2
  1166.   crw-r--r--   1 root      root         4,    131 Sep     8 16:31 ptyp3
  1167.   crw-r--r--   1 root      root         4,    132 Sep     8 16:31 ptyp4
  1168.   crw-r--r--   1 root      root         4,    133 Sep     8 16:31 ptyp5
  1169.   crw-r--r--   1 root      root         4,    134 Sep     8 16:31 ptyp6
  1170.   crw-r--r--   1 root      root         4,    135 Sep     8 16:31 ptyp7
  1171.   crw-r--r--   1 root      root         4,    136 Sep     8 16:31 ptyp8
  1172.   crw-r--r--   1 root      root         4,    137 Sep     8 16:31 ptyp9
  1173.   crw-r--r--   1 root      root         4,    138 Sep     8 16:31 ptypa
  1174.   crw-r--r--   1 root      root         4,    139 Sep     8 16:31 ptypb
  1175.   crw-r--r--   1 root      root         4,    140 Sep     8 16:31 ptypc
  1176.   crw-r--r--   1 root      root         4,    141 Sep     8 16:31 ptypd
  1177.   crw-r--r--   1 root      root         4,    142 Sep     8 16:31 ptype
  1178.   crw-r--r--   1 root      root         4,    143 Sep     8 16:31 ptypf
  1179.   brw-r-----   1 root      root         1,      0 Sep     8 16:31 ram
  1180.   crw-r--r--   1 root      root        27,      0 Sep     8 16:31 rft0
  1181.   crw-r--r--   1 root      root        27,      1 Sep     8 16:31 rft1
  1182.   crw-r--r--   1 root      root        27,      2 Sep     8 16:31 rft2
  1183.   crw-r--r--   1 root      root        27,      3 Sep     8 16:31 rft3
  1184.   crw-------   1 root      root         9,      0 Sep     8 16:31 rmt0
  1185.   brw-r-----   1 root      root         8,      0 Sep     8 16:31 sda
  1186.   brw-r-----   1 root      root         8,      1 Sep     8 16:31 sda1
  1187.   brw-r-----   1 root      root         8,      2 Sep     8 16:31 sda2
  1188.   brw-r-----   1 root      root         8,      3 Sep     8 16:31 sda3
  1189.   brw-r-----   1 root      root         8,      4 Sep     8 16:31 sda4
  1190.   brw-r-----   1 root      root         8,      5 Sep     8 16:31 sda5
  1191.   brw-r-----   1 root      root         8,      6 Sep     8 16:31 sda6
  1192.   brw-r-----   1 root      root         8,      7 Sep     8 16:31 sda7
  1193.   brw-r-----   1 root      root         8,      8 Sep     8 16:31 sda8
  1194.   brw-r-----   1 root      root         8,     16 Sep     8 16:31 sdb
  1195.   brw-r-----   1 root      root         8,     17 Sep     8 16:31 sdb1
  1196.   brw-r-----   1 root      root         8,     18 Sep     8 16:31 sdb2
  1197.   brw-r-----   1 root      root         8,     19 Sep     8 16:31 sdb3
  1198.   brw-r-----   1 root      root         8,     20 Sep     8 16:31 sdb4
  1199.   brw-r-----   1 root      root         8,     21 Sep     8 16:31 sdb5
  1200.   brw-r-----   1 root      root         8,     22 Sep     8 16:31 sdb6
  1201.   brw-r-----   1 root      root         8,     23 Sep     8 16:31 sdb7
  1202.   brw-r-----   1 root      root         8,     24 Sep     8 16:31 sdb8
  1203.   brw-------   1 root      root         8,     32 Sep     8 16:31 sdc
  1204.   brw-------   1 root      root         8,     33 Sep     8 16:31 sdc1
  1205.   brw-------   1 root      root         8,     34 Sep     8 16:31 sdc2
  1206.   brw-------   1 root      root         8,     35 Sep     8 16:31 sdc3
  1207.   brw-------   1 root      root         8,     36 Sep     8 16:31 sdc4
  1208.   brw-------   1 root      root         8,     37 Sep     8 16:31 sdc5
  1209.   brw-------   1 root      root         8,     38 Sep     8 16:31 sdc6
  1210.   brw-------   1 root      root         8,     39 Sep     8 16:31 sdc7
  1211.   brw-------   1 root      root         8,     40 Sep     8 16:31 sdc8
  1212.   brw-------   1 root      root         8,     48 Sep     8 16:31 sdd
  1213.   brw-------   1 root      root         8,     49 Sep     8 16:31 sdd1
  1214.   brw-------   1 root      root         8,     50 Sep     8 16:31 sdd2
  1215.   brw-------   1 root      root         8,     51 Sep     8 16:31 sdd3
  1216.   brw-------   1 root      root         8,     52 Sep     8 16:31 sdd4
  1217.   brw-------   1 root      root         8,     53 Sep     8 16:31 sdd5
  1218.   brw-------   1 root      root         8,     54 Sep     8 16:31 sdd6
  1219.   brw-------   1 root      root         8,     55 Sep     8 16:31 sdd7
  1220.   brw-------   1 root      root         8,     56 Sep     8 16:31 sdd8
  1221.   brw-------   1 root      root         8,     64 Sep     8 16:31 sde
  1222.   brw-------   1 root      root         8,     65 Sep     8 16:31 sde1
  1223.   brw-------   1 root      root         8,     66 Sep     8 16:31 sde2
  1224.   brw-------   1 root      root         8,     67 Sep     8 16:31 sde3
  1225.   brw-------   1 root      root         8,     68 Sep     8 16:31 sde4
  1226.   brw-------   1 root      root         8,     69 Sep     8 16:31 sde5
  1227.   brw-------   1 root      root         8,     70 Sep     8 16:31 sde6
  1228.   brw-------   1 root      root         8,     71 Sep     8 16:31 sde7
  1229.   brw-------   1 root      root         8,     72 Sep     8 16:31 sde8
  1230.   brw-r--r--   1 root      root        11,      0 Sep     8 16:31 sr0
  1231.   brw-r-----   1 root      root        11,      1 Sep     8 16:31 sr1
  1232.   brw-r-----   1 root      root        11,      2 Sep     8 16:31 sr2
  1233.   brw-r-----   1 root      root         3,      1 Sep     8 16:31 swap
  1234.   crw-r--r--   1 root      root         5,      0 Sep     8 16:31 tty
  1235.   crw-r--r--   1 root      root         4,      0 Sep     8 16:31 tty0
  1236.   crw-------   1 root      root         4,      1 Sep     8 16:31 tty1
  1237.   crw-r--r--   1 root      root         4,      2 Sep     8 16:31 tty2
  1238.   -rw-r--r--   1 root      root         20 Sep     8 16:31 tty21
  1239.   crw-r--r--   1 root      root         4,      3 Sep     8 16:31 tty3
  1240.   crw-r--r--   1 root      root         4,      4 Sep     8 16:31 tty4
  1241.   crw-r--r--   1 root      root         4,      5 Sep     8 16:31 tty5
  1242.   crw-r--r--   1 root      root         4,      6 Sep     8 16:31 tty6
  1243.   crw-------   1 root      root         4,      7 Sep     8 16:31 tty7
  1244.   crw-------   1 root      root         4,      8 Sep     8 16:31 tty8
  1245.   crw-r--r--   1 root      root         4,     64 Sep     8 16:31 ttyS0
  1246.   crw-r--r--   1 root      root         4,     65 Sep     8 16:31 ttyS1
  1247.   crw-r--r--   1 root      root         4,     66 Sep     8 16:31 ttyS2
  1248.   crw-r--r--   1 root      root         4,    192 Sep     8 16:31 ttyp0
  1249.   crw-r--r--   1 root      root         4,    193 Sep     8 16:31 ttyp1
  1250.   crw-r--r--   1 root      root         4,    194 Sep     8 16:31 ttyp2
  1251.   crw-r--r--   1 root      root         4,    195 Sep     8 16:31 ttyp3
  1252.   crw-r--r--   1 root      root         4,    196 Sep     8 16:31 ttyp4
  1253.   crw-r--r--   1 root      root         4,    197 Sep     8 16:31 ttyp5
  1254.   crw-r--r--   1 root      root         4,    198 Sep     8 16:31 ttyp6
  1255.   crw-r--r--   1 root      root         4,    199 Sep     8 16:31 ttyp7
  1256.   crw-r--r--   1 root      root         4,    200 Sep     8 16:31 ttyp8
  1257.   crw-r--r--   1 root      root         4,    201 Sep     8 16:31 ttyp9
  1258.   crw-r--r--   1 root      root         4,    202 Sep     8 16:31 ttypa
  1259.   crw-r--r--   1 root      root         4,    203 Sep     8 16:31 ttypb
  1260.   crw-r--r--   1 root      root         4,    204 Sep     8 16:31 ttypc
  1261.   crw-r--r--   1 root      root         4,    205 Sep     8 16:31 ttypd
  1262.   crw-r--r--   1 root      root         4,    206 Sep     8 16:31 ttype
  1263.   crw-r--r--   1 root      root         4,    207 Sep     8 16:31 ttypf
  1264.   -rw-------   1 root      root          63488 Sep     8 16:31 ttys0
  1265.   crw-r--r--   1 root      root         4,     67 Sep     8 16:31 ttys3
  1266.   crw-r--r--   1 root      root         1,      5 Sep     8 16:31 zero
  1267.  
  1268.   boot_disk/etc:
  1269.   total    173
  1270.   -rw-r--r--   1 root      root         53 Sep     8 18:48 boot.env
  1271.   -rwxr-xr-x   1 root      root          27408 Sep     8 18:48 e2fsck*
  1272.   -rwxr-xr-x   1 root      root          18540 Sep     8 18:48 fdisk*
  1273.   -rw-r--r--   1 root      root         69 Oct     8 12:27 fstab
  1274.   -r-x------   1 root      root          13312 Sep     8 18:48 getty*
  1275.   -rw-r--r--   1 root      root        334 Sep     8 18:48 group
  1276.   -rw-r--r--   1 root      root         12 Sep     8 18:48 host.conf
  1277.   -rw-r--r--   1 root      root         62 Sep     8 18:48 hosts
  1278.   -r-x------   1 root      root           6684 Sep     8 18:48 ifconfig*
  1279.   -rwxr-xr-x   1 root      root          11492 Sep     8 18:48 init*
  1280.   -rw-r--r--   1 root      root           1017 Sep     9 22:12 inittab
  1281.   -rw-r--r--   1 root      root          0 Oct     8 12:19 issue
  1282.   -rw-r-----   1 root      root           5137 Sep     8 18:48 login.defs
  1283.   -rwxr-xr-x   1 root      root          14028 Sep     8 18:48 mke2fs*
  1284.   -rwxr-x---   1 root      root           2436 Sep     8 18:48 mkswap*
  1285.   -rwxr-xr-x   1 root      root          11288 Sep     8 18:48 mount*
  1286.   -rw-r--r--   1 root      root        327 Sep     8 18:48 passwd
  1287.   -rwxr-xr-x   1 root      root        383 Sep    10 16:02 profile*
  1288.   -rw-r--r--   1 root      root         94 Sep     8 18:48 protocols
  1289.   -rwxr-xr-x   1 root      root        334 Oct     8 12:27 rc*
  1290.   -rwxr-xr-x   1 root      root           9220 Sep     8 18:48 reboot*
  1291.   -r-x------   1 root      root           4092 Sep     8 18:48 route*
  1292.   -rw-r--r--   1 root      root         20 Sep     8 18:48 securetty
  1293.   -rw-r--r--   1 root      root           9749 Sep     8 18:48 services
  1294.   -rw-r--r--   1 root      root         36 Sep     8 18:48 shells
  1295.   -rwxr-xr-x   1 root      root          13316 Sep     8 18:48 shutdown*
  1296.   -rwxr-xr-x   1 root      root           2496 Sep     8 18:48 swapoff*
  1297.   -rwxr-xr-x   1 root      root           2496 Sep     8 18:48 swapon*
  1298.   -rw-r--r--   1 root      root           5314 Sep     8 18:48 termcap
  1299.   -rwxr-xr-x   1 root      root           5412 Sep     8 18:48 umount*
  1300.   -rw-r--r--   1 root      root        224 Sep     8 18:48 utmp
  1301.   -rw-r--r--   1 root      root        280 Sep     8 18:48 wtmp
  1302.  
  1303.   boot_disk/lib:
  1304.   total    629
  1305.   -rwxr-xr-x   1 root      root          17412 Sep    10 14:58 ld.so*
  1306.   -rwxr-xr-x   1 root      root         623620 Sep     8 18:33 libc.so.4*
  1307.  
  1308.   <sect2>Utility Disk ls-lR Directory Listing
  1309.   <p>
  1310.   The utility listing is of directory util_disk:
  1311.  
  1312.   total    1
  1313.   drwxr-xr-x   2 root      root           1024 Sep    10 16:05 bin/
  1314.  
  1315.   util_disk/bin:
  1316.   total    897
  1317.   -rwxr-xr-x   1 root      root          41984 Sep    10 14:11 cpio*
  1318.   -rwxr-xr-x   1 root      root         504451 Sep     9 21:39 ftape.o*
  1319.   -rwxr-xr-x   1 root      root          63874 Sep     9 21:40 gzip*
  1320.   -rwxr-xr-x   1 root      root          13316 Sep     9 21:34 insmod*
  1321.   -rwxr-xr-x   1 root      root         58 Sep     9 21:34 lsmod*
  1322.   -rwxr-xr-x   1 root      root           3288 Sep     9 21:34 mknod*
  1323.   -rwxr-xr-x   1 root      root           9220 Sep     9 21:34 rmmod*
  1324.   -rwxr-xr-x   1 root      root         226308 Sep     9 22:13 tar*
  1325.  
  1326.  
  1327.  
  1328.  
  1329.  
  1330.   4.2.    Shell Scripts to Build Diskettes
  1331.  
  1332.   There    are two    shell scripts:
  1333.  
  1334.   o  mkroot - builds a root or boot/root diskette.
  1335.  
  1336.   o  mkutil - builds a utility diskette.
  1337.  
  1338.   Both are currently configured    to run in the parent directory of
  1339.   boot_disk and    util_disk, each    of which contains everything to    be
  1340.   copied to it's diskette. Note    that these shell scripts will *NOT*
  1341.   automatically    set up and copy    all the    files for you -    you work out
  1342.   which    files are needed, set up the directories and copy the files to
  1343.   those    directories. The shell scripts are samples which will copy the
  1344.   contents of those directories. Note that they    are primitive shell
  1345.   scripts and are not meant for    the novice user.
  1346.  
  1347.   The scripts both contain configuration variables at the start    which
  1348.   allow    them to    be easily configured to    run anywhere.  First, set up the
  1349.   model    directories and    copy all the required files into them. Then
  1350.   check    the configuration variables in the shell scripts and change them
  1351.   as required before running the scripts.
  1352.  
  1353.  
  1354.   4.2.1.  mkroot - Make    Root or    Boot/Root Diskette
  1355.  
  1356.  
  1357.  
  1358.  
  1359.  
  1360.  
  1361.  
  1362.  
  1363.  
  1364.  
  1365.  
  1366.  
  1367.  
  1368.  
  1369.  
  1370.  
  1371.  
  1372.  
  1373.  
  1374.  
  1375.  
  1376.  
  1377.  
  1378.  
  1379.  
  1380.  
  1381.  
  1382.  
  1383.  
  1384.  
  1385.  
  1386.  
  1387.   ______________________________________________________________________
  1388.   # mkroot: make a boot/boot disk - creates a boot/root    diskette
  1389.   #      by building a    file system on it, then    mounting it and
  1390.   #      copying required files from a    model.
  1391.   #      Note:    the model to copy from from must dirst be set up,
  1392.   #      then change the configuration    variables below    to suit
  1393.   #      your system.
  1394.   #
  1395.   # usage: mkroot [nokernel]
  1396.   #      if the parameter is omitted, then the    kernel and LILO
  1397.   #      are copied.
  1398.  
  1399.   # Copyright (c) Graham Chapman 1994. All rights reserved.
  1400.   # Permission is granted for this material to be freely
  1401.   # used and distributed, provided the source is acknowledged.
  1402.   # No warranty    of any kind is provided. You use this material
  1403.   # at your own    risk.
  1404.  
  1405.   # Configuration variables...
  1406.   BOOTDISKDIR=./boot_disk    # name of boot disk directory
  1407.   MOUNTPOINT=./mnt        # temporary mount point    for diskette
  1408.   LILODIR=/sbin            # directory containing lilo
  1409.   LILOBOOT=/boot/boot.b        # lilo boot sector
  1410.   LILOMSG=./lilo.msg        # lilo message to display at boot time
  1411.   LILOCONFIG=./lilo.conf    # lilo parms for boot/root diskette
  1412.   DISKETTEDEV=/dev/fd0        # device name of diskette drive
  1413.  
  1414.   echo $0: create boot/root diskette
  1415.   echo Warning:    data on    diskette will be overwritten!
  1416.   echo Insert diskette in $DISKETTEDEV and and press any key...
  1417.   read anything
  1418.  
  1419.   mke2fs $DISKETTEDEV
  1420.   if [ $? -ne 0    ]
  1421.   then
  1422.       echo mke2fs failed
  1423.       exit
  1424.   fi
  1425.  
  1426.   mount    -t ext2    $DISKETTEDEV $MOUNTPOINT
  1427.   if [ $? -ne 0    ]
  1428.   then
  1429.       echo mount failed
  1430.       exit
  1431.   fi
  1432.  
  1433.   # copy the directories containing files
  1434.   for i    in bin etc lib
  1435.   do
  1436.       cp -dpr $BOOTDISKDIR/$i $MOUNTPOINT
  1437.   done
  1438.  
  1439.   # copy dev *without* trying to copy the files    in it
  1440.   cp -dpR $BOOTDISKDIR/dev $MOUNTPOINT
  1441.  
  1442.   # create empty directories required
  1443.   mkdir    $MOUNTPOINT/proc
  1444.   mkdir    $MOUNTPOINT/tmp
  1445.   mkdir    $MOUNTPOINT/mnt
  1446.   mkdir    $MOUNTPOINT/usr
  1447.  
  1448.   # copy the kernel
  1449.   if [ "$1" != "nokernel" ]
  1450.   then
  1451.       echo "Copying    kernel"
  1452.       cp $BOOTDISKDIR/vmlinux $MOUNTPOINT
  1453.       echo kernel copied
  1454.  
  1455.       # setup lilo
  1456.       cp $LILOBOOT $MOUNTPOINT
  1457.       cp $LILOMSG $MOUNTPOINT
  1458.       $LILODIR/lilo    -C $LILOCONFIG
  1459.       echo LILO installed
  1460.   fi
  1461.  
  1462.   umount $MOUNTPOINT
  1463.  
  1464.   echo Root diskette complete
  1465.   ______________________________________________________________________
  1466.  
  1467.  
  1468.  
  1469.  
  1470.  
  1471.   4.2.2.  mkutil - Make    Utility    Diskette
  1472.  
  1473.  
  1474.  
  1475.  
  1476.  
  1477.  
  1478.  
  1479.  
  1480.  
  1481.  
  1482.  
  1483.  
  1484.  
  1485.  
  1486.  
  1487.  
  1488.  
  1489.  
  1490.  
  1491.  
  1492.  
  1493.  
  1494.  
  1495.  
  1496.  
  1497.  
  1498.  
  1499.  
  1500.  
  1501.  
  1502.  
  1503.  
  1504.  
  1505.  
  1506.  
  1507.  
  1508.  
  1509.  
  1510.  
  1511.  
  1512.  
  1513.  
  1514.  
  1515.  
  1516.  
  1517.  
  1518.  
  1519.   ______________________________________________________________________
  1520.   # mkutil: make a utility diskette - creates a    utility    diskette
  1521.   #      by building a    file system on it, then    mounting it and
  1522.   #      copying required files from a    model.
  1523.   #      Note:    the model to copy from from must first be set up,
  1524.   #      then change the configuration    variables below    to suit
  1525.   #      your system.
  1526.  
  1527.   # Copyright (c) Graham Chapman 1994. All rights reserved.
  1528.   # Permission is granted for this material to be freely
  1529.   # used and distributed, provided the source is acknowledged.
  1530.   # No warranty    of any kind is provided. You use this material
  1531.   # at your own    risk.
  1532.  
  1533.   # Configuration variables...
  1534.   UTILDISKDIR=./util_disk    # name of directory containing model
  1535.   MOUNTPOINT=./mnt        # temporary mount point    for diskette
  1536.   DISKETTEDEV=/dev/fd0        # device name of diskette drive
  1537.  
  1538.   echo $0: create utility diskette
  1539.   echo Warning:    data on    diskette will be overwritten!
  1540.   echo Insert diskette in $DISKETTEDEV and and press any key...
  1541.   read anything
  1542.  
  1543.   mke2fs $DISKETTEDEV
  1544.   if [ $? -ne 0    ]
  1545.   then
  1546.       echo mke2fs failed
  1547.       exit
  1548.   fi
  1549.  
  1550.   # Any    file system type would do here
  1551.   mount    -t ext2    $DISKETTEDEV $MOUNTPOINT
  1552.   if [ $? -ne 0    ]
  1553.   then
  1554.       echo mount failed
  1555.       exit
  1556.   fi
  1557.  
  1558.   # copy the directories containing files
  1559.   cp -dpr $UTILDISKDIR/bin $MOUNTPOINT
  1560.  
  1561.   umount $MOUNTPOINT
  1562.  
  1563.   echo Utility diskette    complete
  1564.   ______________________________________________________________________
  1565.  
  1566.  
  1567.  
  1568.  
  1569.  
  1570.   5.  FAQ
  1571.  
  1572.  
  1573.   5.1.    Q. How can I make a boot disk with a XXX driver?
  1574.  
  1575.   The easiest way is to    obtain a Slackware kernel from your nearest
  1576.   Slackware mirror site. Slackware kernels are generic kernels which
  1577.   atttempt to include drivers for as many devices as possible, so if you
  1578.   have a SCSI or IDE controller, chances are that a driver for it is
  1579.   included in the Slackware kernel.
  1580.  
  1581.   Go to    the a1 directory and select either IDE or SCSI kernel depending
  1582.   on the type of controller you    have. Check the    xxxxkern.cfg file for
  1583.   the selected kernel to see the drivers which have been included in
  1584.   that kernel. If the device you want is in that list, then the
  1585.   corresponding    kernel should boot your    computer. Download the
  1586.   xxxxkern.tgz file and    copy it    to your    boot diskette as described above
  1587.   in the section on making boot    disks.
  1588.  
  1589.   You must then    check the root device in the kernel, using the rdev
  1590.   command:
  1591.  
  1592.  
  1593.            rdev vmlinuz
  1594.  
  1595.  
  1596.  
  1597.  
  1598.   Rdev will then display the current root device in the    kernel.    If this
  1599.   is not the same as the root device you want, then use    rdev to    change
  1600.   it.  For example, the    kernel I tried was set to /dev/sda2, but my root
  1601.   scsi partition is /dev/sda8. To use a    root diskette, you would have to
  1602.   use the command:
  1603.  
  1604.  
  1605.            rdev vmlinuz /dev/fd0
  1606.  
  1607.  
  1608.  
  1609.  
  1610.   If you want to know how to set up a Slackware    root disk as well,
  1611.   that's outside the scope of this HOWTO, so I suggest you check the
  1612.   Linux    Install    Guide or get the Slackware distribution. See the section
  1613.   in this HOWTO    titled "References".
  1614.  
  1615.  
  1616.   5.2.    Q. How do I update my boot floppy with a new kernel?
  1617.  
  1618.   Just copy the    kernel to your boot diskette using the dd command for a
  1619.   boot diskette    without    a filesystem, or the cp    command    for a boot/root
  1620.   disk.    Refer to the section in    this HOWTO titled "Boot" for details on
  1621.   creating a boot disk.    The description    applies    equally    to updating a
  1622.   kernel on a boot disk.
  1623.  
  1624.  
  1625.   5.3.    Q. How do I remove LILO    so that    I can use DOS to boot again?
  1626.  
  1627.   This is not really a Bootdisk    topic, but it is asked so often, so: the
  1628.   answer is, use the DOS command:
  1629.  
  1630.  
  1631.            FDISK /MBR
  1632.  
  1633.  
  1634.  
  1635.  
  1636.   MBR stands for Master    Boot Record, and it replaces the boot sector
  1637.   with a clean DOS one,    without    affecting the partition    table. Some
  1638.   purists disagree with    this, but even the author of LILO, Werner
  1639.   Almesberger, suggests    it. It is easy,    and it works.
  1640.  
  1641.   You can also use the dd command to copy the backup saved by LILO to
  1642.   the boot sector - refer to the LILO documentation if you wish    to do
  1643.   this.
  1644.  
  1645.  
  1646.   5.4.    Q. How can I boot if I've lost my kernel AND my    boot disk?
  1647.  
  1648.   If you don't have a boot disk    standing by, then probably the easiest
  1649.   method is to obtain a    Slackware kernel for your disk controller type
  1650.   (IDE or SCSI)    as described above for "How do I make a    boot disk with a
  1651.   XXX driver?".    You can    then boot your computer    using this kernel, then
  1652.   repair whatever damage there is.
  1653.  
  1654.   The kernel you get may not have the root device set to the disk type
  1655.   and partition    you want. For example, Slackware's generic scsi    kernel
  1656.   has the root device set to /dev/sda2,    whereas    my root    Linux partition
  1657.   happens to be    /dev/sda8. In this case    the root device    in the kernel
  1658.   will have to be changed.
  1659.  
  1660.   You can still    change the root    device and ramdisk settings in the
  1661.   kernel even if all you have is a kernel, and some other operating
  1662.   system, such as DOS.
  1663.  
  1664.   Rdev changes kernel settings by changing the values at fixed offsets
  1665.   in the kernel    file, so you can do the    same if    you have a hex editor
  1666.   available on whatever    systems    you do still have running - for    example,
  1667.   Norton Utilities Disk    Editor under DOS.  You then need to check and if
  1668.   necessary change the values in the kernel at the following offsets:
  1669.  
  1670.  
  1671.        0x01F8  Low byte    of RAMDISK size
  1672.        0x01F9  High byte of RAMDISK size
  1673.        0x01FC  Minor device number - see below
  1674.        0X01FD  Major device number - see below
  1675.  
  1676.  
  1677.  
  1678.  
  1679.   The ramdisk size is the number of blocks of ramdisk to create.  If you
  1680.   want to boot from a root diskette then set this to decimal 1440, which
  1681.   is 0x05A0, thus set offset 0x01F8 to 0xA0 and    offset 0x01F9 to 0x05.
  1682.   This will allocate enough space for a    1.4Mb diskette.
  1683.  
  1684.   The major and    minor device numbers must be set to the    device you want
  1685.   to mount your    root filesystem    on. Some useful    values to select from
  1686.   are:
  1687.  
  1688.  
  1689.        device           major minor
  1690.        /dev/fd0           2     0   1st floppy    drive
  1691.        /dev/hda1       3     1   partition 1 on 1st    IDE drive
  1692.        /dev/sda1       8     1   partition 1 on 1st    scsi drive
  1693.        /dev/sda8       8     8   partition 8 on 1st    scsi drive
  1694.  
  1695.  
  1696.  
  1697.  
  1698.   Once you have    set these values then you can write the    file to    a
  1699.   diskette using either    Norton Utilities Disk Editor, or a program
  1700.   called rawrite.exe. This program is included in several distributions,
  1701.   including the    SLS and    Slackware distributions.  It is    a DOS program
  1702.   which    writes a file to the "raw" disk, starting at the boot sector,
  1703.   instead of writing it    to the file system. If you use Norton Utilities,
  1704.   then you must    write the file to a physical disk starting at the
  1705.   beginning of the disk.
  1706.  
  1707.  
  1708.   5.5.    Q. How can I make extra    copies of boot/root diskettes?
  1709.  
  1710.   It is    never desirable    to have    just one set of    rescue disks - 2 or 3
  1711.   should be kept in case one is    unreadable.
  1712.  
  1713.   The easiest way of making copies of any diskettes, including bootable
  1714.   and utility diskettes, is to use the dd command to copy the contents
  1715.   of the original diskette to a    file on    your hard drive, and then use
  1716.   the same command to copy the file back to a new diskette.  Note that
  1717.   you do not need to, and should not, mount the    diskettes, because dd
  1718.   uses the raw device interface.
  1719.  
  1720.   To copy the original,    enter the command:
  1721.  
  1722.  
  1723.            dd if=<device> of=<filename>
  1724.            where   <device>    = the device name of the diskette
  1725.                drive
  1726.            and     <filename> = the    name of    the file where you
  1727.                want to copy to
  1728.  
  1729.  
  1730.  
  1731.  
  1732.   For example, to copy from /dev/fd0 to    a temporary file called
  1733.   /tmp/diskette.copy, I    would enter the    command:
  1734.  
  1735.  
  1736.            dd if=/dev/fd0 of=/tmp/diskette.copy
  1737.  
  1738.  
  1739.  
  1740.  
  1741.   Omitting the "count" parameter, as we    have done here,    means that the
  1742.   whole    diskette of 2880 (for a    high-density) blocks will be copied.
  1743.  
  1744.   To copy the resulting    file back to a new diskette, insert the    new
  1745.   diskette and enter the reverse command:
  1746.  
  1747.  
  1748.            dd if=<filename>    of=<device>
  1749.  
  1750.  
  1751.  
  1752.  
  1753.   Note that the    above discussion assumes that you have only one    diskette
  1754.   drive. If you    have two of the    same type, then    you can    copy diskettes
  1755.   using    a command like:
  1756.  
  1757.  
  1758.            dd if=/dev/fd0 of=/dev/fd1
  1759.  
  1760.  
  1761.  
  1762.  
  1763.  
  1764.   5.6.    Q. How can I boot without typing in "ahaxxxx=nn,nn,nn" every
  1765.   time?
  1766.  
  1767.   Where    a disk device cannot be    autodetected it    is necessary to    supply
  1768.   the kernel with a command device parameter string, such as:
  1769.  
  1770.  
  1771.            aha152x=0x340,11,3,1
  1772.  
  1773.  
  1774.  
  1775.  
  1776.   This parameter string    can be supplied    in several ways    using LILO:
  1777.  
  1778.   o  By    entering it on the command line    every time the system is booted
  1779.      via LILO. This is boring, though.
  1780.  
  1781.   o  By    using the LILO "lock" keyword to make it store the command line
  1782.      as    the default command line, so that LILO will use    the same options
  1783.      every time    it boots.
  1784.  
  1785.   o  By    using the APPEND statement in the lilo config file. Note that
  1786.      the parameter string must be enclosed in quotes.
  1787.  
  1788.   For example, a sample    command    line using the above parameter string
  1789.   would    be:
  1790.  
  1791.  
  1792.            vmlinux aha152x=0x340,11,3,1 root=/dev/sda1 lock
  1793.  
  1794.  
  1795.  
  1796.  
  1797.   This would pass the device parameter string through, and also    ask the
  1798.   kernel to set    the root device    to /dev/sda1 and save the whole    command
  1799.   line and reuse it for    all future boots.
  1800.  
  1801.   A sample APPEND statement is:
  1802.  
  1803.  
  1804.            APPEND =    "aha152x=0x340,11,3,1"
  1805.  
  1806.  
  1807.  
  1808.  
  1809.   Note that the    parameter string must NOT be enclosed in quotes    on the
  1810.   command line,    but it MUST be enclosed    in quotes in the APPEND
  1811.   statement.
  1812.  
  1813.   Note also that for the parameter string to be    acted on, the kernel
  1814.   must contain the driver for that disk    type. If it does not, then there
  1815.   is nothing listening for the parameter string, and you will have to
  1816.   rebuild the kernel to    include    the required driver. For details on
  1817.   rebuilding the kernel, cd to /usr/src/linux and read the README, and
  1818.   read the Linux FAQ and Installation HOWTO. Alternatively you could
  1819.   obtain a generic kernel for the disk type and    install    that.
  1820.  
  1821.   Readers are strongly urged to    read the LILO documentation before
  1822.   experimenting    with LILO installation.    Incautious use of the "BOOT"
  1823.   statement can    damage partitions.
  1824.  
  1825.  
  1826.   6.  References
  1827.  
  1828.   In this section, vvv is used in package names    in place of the    version,
  1829.   to avoid referring here to specific versions.    When retrieving    a
  1830.   package, always get the latest version unless    you have good reasons
  1831.   for not doing    so.
  1832.  
  1833.  
  1834.   6.1.    LILO - Linux Loader
  1835.  
  1836.   Written by Werner Almesberger. Excellent boot    loader,    and the
  1837.   documentation    includes information on    the boot sector    contents and the
  1838.   early    stages of the boot process.
  1839.  
  1840.   Ftp from: tsx-11.mit.edu:/pub/linux/packages/lilo/lilo.vvv.tar.gz also
  1841.   on sunsite and mirror    sites.
  1842.  
  1843.  
  1844.   6.2.    Linux FAQ and HOWTOs
  1845.  
  1846.   These    are available from many    sources. Look at the usenet newsgroups
  1847.   news.answers and comp.os.linux.announce.
  1848.  
  1849.   Ftp from: sunsite.unc.edu:/pub/Linux/docs
  1850.  
  1851.   o  FAQ is in /pub/linux/docs/faqs/linux-faq
  1852.  
  1853.   o  HOWTOs are    in /pub/Linux/docs/HOWTO
  1854.  
  1855.   For WWW, start at the    Linux documentation home page:
  1856.  
  1857.  
  1858.        http://sunsite.unc.edu/mdw/linux.html
  1859.  
  1860.  
  1861.  
  1862.  
  1863.   If desperate,    send mail to:
  1864.  
  1865.  
  1866.            mail-server@rtfm.mit.edu
  1867.  
  1868.  
  1869.  
  1870.  
  1871.   with the word    "help" in the message, then follow the mailed
  1872.   instructions.
  1873.  
  1874.   Note:    if you haven't read the    Linux FAQ and related documents    such as
  1875.   the Linux Installation HOWTO and the Linux Install Guide, then you
  1876.   should not be    trying to build    boot diskettes.
  1877.  
  1878.  
  1879.   6.3.    Rescue Shell Scripts
  1880.  
  1881.   Written by Thomas Heiling. This contains shell scripts to produce boot
  1882.   and boot/root    diskettes. It has some dependencies on specific    versions
  1883.   of other software such as LILO, and so might need some effort    to
  1884.   convert to your system, but it might be useful as a starting point if
  1885.   you wanted more comprehensive    shell scripts than are provided    in this
  1886.   document.
  1887.  
  1888.   Ftp from: sunsite.unc.edu:/pub/Linux/system/Recovery/rescue.tgz
  1889.  
  1890.  
  1891.   6.4.    SAR - Search and Rescue
  1892.  
  1893.   Written by Karel Kubat. SAR produces a rescue    diskette, using    several
  1894.   techniques to    minimize the space required on the diskette.  The manual
  1895.   includes a description of the    Linux boot/login process.
  1896.  
  1897.   Ftp from: ftp.icce.rug.nl:/pub/unix/SAR-vvv.tar.gz
  1898.  
  1899.   The manual is    available via WWW from:
  1900.  
  1901.   http://www.icce.rug.nl/karel/programs/SAR.html
  1902.  
  1903.  
  1904.   6.5.    Slackware Distribution
  1905.  
  1906.   Apart    from being one of the more popular Linux distributions around,
  1907.   it is    also a good place to get a generic kernel. It is available from
  1908.   almost everywhere, so    there is little    point in putting addresses here.
  1909.