<!doctype linuxdoc system>

<!-- 
$Id: Bootdisk-HOWTO.sgml,v 1.5 1998/11/04 01:29:04 fawcett Exp fawcett $
-->

<article>

      <title>The Linux Bootdisk HOWTO</title>
      <author>
	Tom Fawcett (<tt>fawcett@croftj.net</tt>)
	<newline>
      </author>
      <date>3.4, May 1999</date>

      <abstract>

This document describes how to design and build your own boot/root diskettes
for Linux.  These disks could be used as rescue disks or to test new system
components.  If you haven't read the Linux FAQ and related documents, such as
the Linux Installation HOWTO and the Linux Install Guide, you should not be
trying to build boot diskettes.  If you just want a rescue disk to have for
emergencies, see Appendix <ref id="distbootdisks" name="Pre-made
bootdisks">.

</abstract>

    <toc>

    <sect>Preface.<p>

<bf>Note: This document may be outdated.</bf> If the date on the title page
is more than six months ago, please check the Linux Documentation Project
homepage <url url="http://metalab.unc.edu/LDP/HOWTO/Bootdisk-HOWTO.html">
to see if a more recent version exists.

Although this document should be legible in its text form, it looks
<em/much/ better in Postscript (<tt/.ps/) or HTML because of the
typographical notation used.  We encourage you to select one of these
forms.  The Info version, as of this writing, ends up so damaged as to
be unusable.

<sect1>Version notes.<p>
<nidx/kernel, versions/

Graham Chapman (<tt>grahamc@zeta.org.au</tt>) wrote the original
Bootdisk-HOWTO and he supported it through version 3.1.  Tom Fawcett
(<tt>fawcett@croftj.net</tt>) added a lot of material for kernel 2.0,
and he is the document's maintainer as of version 3.2.  Much of
Chapman's original content remains.

This document is intended for <bf/Linux kernel 2.0 and later/.  If you
have an older kernel (1.2.xx or before), please consult previous
versions of the Bootdisk-HOWTO archived on <url
url="http://www.zeta.org.au/~grahamc/linux.html" name="Graham
Chapman's homepage">.

This information is intended for Linux on the <bf/Intel/ platform.  Much of
this information may be applicable to Linux on other processors, but we have
no first-hand experience or information about this.  If anyone has experience
with bootdisks on other platforms, please contact us.


<sect1>Feedback and credits.<p>

We welcome any feedback, good or bad, on the content of this document.  We
have done our best to ensure that the instructions and information herein are
accurate and reliable.  Please let us know if you find errors or omissions.

We thank the many people who assisted with corrections and suggestions.  Their
contributions have made it far better than we could ever have done alone.

Send comments, corrections and questions to the author at the email
address above.  I don't mind trying to answer questions, but please
read section <ref id="troubleshooting" name="Troubleshooting"> first.

<!--  Change history

v3.4, April 1999.  Changes in this version:
- Checked and changed URLs.
- Moved NIDX expressions around.  Seems to be a bug in sgmltools that NIDX
  expressions kill anything left on the line, though this doesn't happen
  with IDXs or anything else.
- Added troubleshooting item about "Kernel panic: VFS: Unable to mount root
  fs" which has become a FAQ.
- Removed warning about pruning users from /etc/passwd.  I thought
  archivers stored user/group names; they store UIDs and GIDs.
- Pruned some of the discussions of libraries, added direct mention of need
  to strip libraries (a FAQ because new libcs are huge).
- Updated ldd and file examples in /lib section.

v3.3, November 1998.  Changes in this version:
- Added section on PAM and PAM configuration
- Added section on the /lib/libnss_* stuff
- Added mention of debugfs utility
- Re-checked all the URLs and updated some.  Removed some specific
  filenames so URL points to FTP directory.  
- Replaced Graham's root filesystem listing with a Yard listing, since some 
  of Graham's file choices were obsolete.
- Added paragraph on dead login prompts, mantioning PAM, NSS and shadow passwords.
- Cleaned up a few indexing problems.  sgml-tools still has a few bugs.

v3.2, June 1998.  Changes in this version:
- Removed Graham Chapman as a co-author, on his request.  Added paragraph to
  Version Notes crediting him with the original versions.
- Fixed up a few index commands that were producing spurious output.
- Updated mount filename and version at ftp.win.tue.nl
- In section "Reducing root filesystem size", added paragraph on reformatting
  diskete to higher density.
- Added paragraph and URLS for tomsrtbt rescue disk to the Pre-made Bootdisks
  section.
- Changed Makefile so that Info versions of this document are no longer
  produced or distributed, because they are completely broken.
- Changed lots of double quotes, fixed a few indexing commands.


v3.1, March 1998

v3.0, early 1998.  Substantial rewrite.

v2.3, 4 April 1997.  Changes in this version:
- Moved first FAQ question ("Why doesn't my disk boot?") 
  into its own section ("Troubleshooting") and added Yard
  troubleshooting information to it.
- Made a few changes suggested by D.Hill and J.R.Ganuza.
- Added ref and label tags in various places.
- Moved scripts and resources to appendices.
- Added URLs for distributions' bootdisks plus mirrors.

v2.2, 1 September 1996. Changes in this version:

- Fix: set ramdisk word via rdev on /dev/fd0 instead of zImage.


v2.1, 18 August 1996. Changes in this version:

Summary: this was a major cleanup to reflect changes between kernel
version 1.2 and 2.0. Specific changes are:

- Chg: replaced shell scripts and directory listings.
- Chg: removed most of the text of "oversize ramdisk" FAQ question.
- Fix: mkfs -i should have been mke2fs -i.
- Fix: missing parameter name in dd command to zero rootdisk device.
- Fix: remove accidental extra parameter from mke2fs command to create
    rootdisk filesystem.
- Chg: minor changes to reflect less reliance on the Bootkit utility.
- Chg: change section cross-references to refer to section title, not
    number (sometime I'll add hypertext links...)
- Add: use cpio as an alternate way of copying files.
- Add: tips for removing unnecessary device special files.
- Add: FAQ question - what to do if nothing happens at boot time.
- Add: various minor changes.


v2.0, 12 June 1996. Changes in this version:

- Add: additional author and maintainer, Tom Fawcett.
- Add: section 6.3, Ramdisk Usage.
- Add: section titled Advanced Bootdisk Creation, which describes how
    to take advantage of ramdisk changes in kernels 1.3.48+
- Chg: rewrite section on /lib directory.
- Chg: various minor tips on changed ramdisk usage.


======================= END OF CHANGE HISTORY  -->

<sect1>Distribution policy.<p>

Copyright &copy; 1995,1996,1997,1998,1999 by Tom Fawcett and Graham
Chapman.  This document may be distributed under the terms set forth in the
Linux Documentation Project License at <url
url="http://metalab.unc.edu/LDP/COPYRIGHT.html">.  Please contact the
authors if you are unable to get the license.
<p>
This is free documentation.  It is distributed in the hope that it will be
useful, but <bf>without any warranty</bf>; without even the implied warranty
of <bf>merchantability</bf> or <bf>fitness for a particular purpose</bf>.

<p>

<sect>Introduction.<p>

Linux boot disks are useful in a number of situations, such as:
<itemize>

<item>Testing a new kernel.

<item>Recovering from a disk failure -- anything from a lost boot sector to a
disk head crash.

<item>Fixing a disabled system.  A minor mistake as root can leave your system
unusable, and you may have to boot from diskette to fix it.

<item>Upgrading critical system files, such as <tt/libc.so/.

</itemize>

There are several ways of obtaining boot disks:

<itemize>

<item>Use one from a distribution such as Slackware.  This will at
      least allow you to boot.

<item>Use a rescue package to set up disks designed to be used
      as rescue disks.

<item>Learn what is required for each of the types of disk to operate,
      then build your own.

</itemize>

Some people choose the last option so they can do it themselves.  That
way, if something breaks, they can work out what to do to fix it.
Plus it's a great way to learn about how a Linux system works.

This document assumes some basic familiarity with Linux system administration
concepts.  For example, you should know about directories, filesystems and
floppy diskettes.  You should know how to use <tt/mount/ and <tt/df/.  You
should know what <file>/etc/passwd</file> and <file>fstab</file> files are for
and what they look like.  You should know that most of the commands in this
HOWTO should be run as root.

Constructing your own bootdisk from scratch can be complicated.  If you
haven't read the Linux FAQ and related documents, such as the Linux
Installation HOWTO and the Linux Installation Guide, you should not be
trying to build boot diskettes.  If you just need a working bootdisk for
emergencies, it is <em>much</em> easier to download a prefabricated one.
See Appendix <ref id="distbootdisks" name="Pre-made bootdisks">, below, for
where to find these.


<sect>Bootdisks and the boot process. <p>
<nidx/boot process/

A bootdisk is basically a miniature, self-contained Linux system on a floppy
diskette.  It must perform many of the same functions that a complete
full-size Linux system performs.  Before trying to build one you should
understand the basic Linux boot process.  We present the basics here, which
are sufficient for understanding the rest of this document.  Many details and
alternative options have been omitted.

<sect1>The boot process.<p>
<nidx/boot sector/

All PC systems start the boot process by executing code in ROM
(specifically, the <idx/BIOS/) to load the sector from sector 0,
cylinder 0 of the boot drive.  The <idx/boot drive/ is usually the
first floppy drive (designated <tt>A:</tt> in DOS and
<file>/dev/fd0</file> in Linux).  The BIOS then tries to execute this
sector.  On most bootable disks, sector 0, cylinder 0 contains either:
<itemize>

<item>code from a boot loader such as LILO, which locates the kernel,
      loads it and executes it to start the boot proper.

<item>the start of an operating system kernel, such as Linux.

</itemize>

If a Linux kernel has been raw-copied to a diskette, the first sector of the
disk will be the first sector of the Linux kernel itself.  This first sector
will continue the boot process by loading the rest of the kernel from the boot
device.

Once the kernel is completely loaded, it goes through some basic
device initialization.  It then tries to load and mount a
<bf><idx/root filesystem/</bf> from some device.  A root filesystem is
simply a filesystem that is mounted as ``/''.  The kernel has to be
told where to look for the root filesystem; if it cannot find a
loadable image there, it halts.

In some boot situations -- often when booting from a diskette -- the root
filesystem is loaded into a <bf><idx/ramdisk/</bf>, which is RAM accessed
by the system as if it were a disk.  There are two reasons why the system
loads to ramdisk.  First, RAM is several orders of magnitude faster than a
floppy disk, so system operation is fast; and second, the kernel can load a
<bf><idx/compressed filesystem/</bf> from the floppy and uncompress it onto
the ramdisk, allowing many more files to be squeezed onto the diskette.

Once the root filesystem is loaded and mounted, you see a message like:

<verb>
	VFS: Mounted root (ext2 filesystem) readonly.
</verb>

<ncdx>init</ncdx>
<ncdx>inittab</ncdx>
<ncdx>sysinit</ncdx>

At this point the system finds the <tt/init/ program on the root filesystem
(in <tt>/bin</tt> or <tt>/sbin</tt>) and executes it.  <tt/init/ reads its
configuration file <file>/etc/inittab</file>, looks for a line designated
<tt/sysinit/, and executes the named script .  The <tt/sysinit/ script is
usually something like <file>/etc/rc</file> or
<file>/etc/init.d/boot</file>.  This script is a set of shell commands that
set up basic system services, such as:

<itemize>

<item>Running <tt><cdx/fsck/</tt> on all the disks,
<item>Loading necessary kernel <idx/modules/,
<item>Starting swapping,
<item>Initializing the network,
<item>Mounting disks mentioned in <tt><cdx/fstab/</tt>.

</itemize>

This script often invokes various other scripts to do modular
initialization.  For example, in the common SysVinit structure, the
directory <file>/etc/rc.d/</file> contains a complex structure of
subdirectories whose files specify how to enable and shut down most system
services.  However, on a bootdisk the sysinit script is often very simple.

When the sysinit script finishes control returns to <tt/init/, which
then enters the <em/default runlevel/, specified in <tt/inittab/ with
the <tt/initdefault/ keyword.  The runlevel line usually specifies a
program like <tt><cdx/getty/</tt>, which is responsible for handling
commununications through the console and ttys.  It is the <tt/getty/
program which prints the familiar ``<tt/login:/'' prompt.  The
<tt/getty/ program in turn invokes the <tt><cdx/login/</tt> program to
handle login validation and to set up user sessions.

<sect1>Disk types.<p>

Having reviewed the basic boot process, we can now define various
kinds of disks involved.  We classify disks into four types.  The
discussion here and throughout this document uses the term ``disk'' to
refer to floppy diskettes unless otherwise specified, though most of
the discussion could apply equally well to hard disks.

<descrip>

<tag/boot/ A disk containing a kernel which can be booted.  The disk
   can be used to boot the kernel, which then may load a root file system on
   another disk.  The kernel on a bootdisk usually must be told where to find
   its root filesystem.

   Often a bootdisk loads a root filesystem from another diskette, but
   it is possible for a bootdisk to be set up to load a hard disk's
   root filesystem instead.  This is commonly done when testing a new
   kernel.  (in fact, ``<tt/make zdisk/'' will create such a bootdisk
   automatically from the kernel source code).

<tag>root</tag> A disk with a filesystem containing files
    required to run a Linux system.  Such a disk does not necessarily
    contain either a kernel or a boot loader.  <nidx/root disk/

    A root disk can be used to run the system independently of any other
    disks, once the kernel has been booted.  Usually the root disk is
    automatically copied to a ramdisk.  This makes root disk accesses much
    faster, and frees up the disk drive for a utility disk.

<tag>boot/root</tag> A disk which contains both the kernel 
    <nidx>boot/root disk</nidx>
    and a root filesystem.  In other words, it contains everything necessary
    to boot and run a Linux system without a hard disk.  The advantage of this
    type of disk is that is it compact -- everything required is on a single
    disk.  However, the gradually increasing size of everything means that it
    is increasingly difficult to fit everything on a single diskette, even
    with compression.

<tag>utility</tag> A disk which contains a filesystem, but is not
    intended to be mounted as a root file system.  It is an additional data
    disk.  You would use this type of disk to carry additional utilities where
    you have too much to fit on your root disk. <nidx/utility diskette/

</descrip>


In general, when we talk about ``building a bootdisk'' we mean
creating both the boot (kernel) and root (files) portions.  They may
be either together (a single boot/root disk) or separate (boot + root
disks).  The most flexible approach for rescue diskettes is probably
to use separate boot and root diskettes, and one or more utility
diskettes to handle the overflow.



<sect>Building a root filesystem.<p>
<label id="buildroot">

Creating the root filesystem involves selecting files necessary for the
system to run.  In this section we describe how to build a
<em><idx/compressed root filesystem/</em>.  A less common option is to
build an uncompressed filesystem on a diskette that is directly mounted as
root; this alternative is described in section <ref id="nonramdiskroot"
name="Non-ramdisk Root Filesystem">.

<sect1>Overview.<p>

A root filesystem must contain everything needed to support a full Linux
system.  To be able to do this, the disk must include the minimum requirements
for a Linux system:

<itemize>
<item>The basic file system structure,
<item>Minimum set of directories: <tt>/dev, /proc, /bin, /etc, /lib, /usr,
	/tmp</tt>,
<item>Basic set of utilities: <tt>sh, ls, cp, mv</tt>, etc.,
<item>Minimum set of config files: <tt>rc, inittab, fstab</tt>, etc.,
<item>Devices: <tt>/dev/hd*, /dev/tty*, /dev/fd0</tt>, etc.,
<item>Runtime library to provide basic functions used by utilities.
</itemize>

Of course, any system only becomes useful when you can run something
on it, and a root diskette usually only becomes useful when you
can do something like:

<itemize>

<item>Check a file system on another drive, for example to check your root
file system on your hard drive, you need to be able to boot Linux from
another drive, as you can with a root diskette system.  Then you can run
<tt><cdx/fsck/</tt> on your original root drive while it is not
mounted.

<item>Restore all or part of your original root drive from backup
using archive and compression utilities such as <tt/cpio, tar, gzip/
and <tt/ftape/.

</itemize>


We will describe how to build a <em/compressed/ filesystem, so called because
it is compressed on disk and, when booted, is uncompressed onto a ramdisk.
<nidx/compressed root filesystem/
With a compressed filesystem you can fit many files (approximately six
megabytes) onto a standard 1440K diskette.  Because the filesystem is much
larger than a diskette, it cannot be built on the diskette.  We have to build
it elsewhere, compress it, then copy it to the diskette.

<sect1>Creating the filesystem.<p>
<label id="creatingrootfs">

In order to build such a root filesystem, you need a spare device that
is large enough to hold all the files before compression.  You will
need a device capable of holding about four megabytes.  There are
several choices:

<itemize>

<item>Use a <bf><idx/ramdisk/</bf> (DEVICE = <file>/dev/ram0</file>).  In this case,
memory is used to simulate a disk drive.  The ramdisk must be large enough
to hold a filesystem of the appropriate size.  If you use LILO, check your
configuration file (<file>/etc/lilo.conf</file>) for a line like:

<verb>
	RAMDISK_SIZE = nnn
</verb>
<nidx/RAMDISK&lowbar;SIZE, LILO parameter/
which determines the maximum RAM that can be allocated to a ramdisk.  The
default is 4096K, which should be sufficient.  You should probably not try
to use such a ramdisk on a machine with less than 8MB of RAM.

Check to make sure you have a device like <file>/dev/ram0, /dev/ram</file>
or <file>/dev/ramdisk</file>.  If not, create <file>/dev/ram0</file> with
<tt/mknod/ (major number 1, minor 0).

<item>If you have an unused hard disk partition that is large enough (several
megabytes), this is a good solution.

<item>Use a <bf><idx/loopback device/</bf>, which allows a disk file to be
treated as a device.  Using a loopback device you can create a three
megabyte file on your hard disk and build the filesystem on it.

Type <tt/man losetup/ for instructions on using loopback devices.  If you
don't have <tt/losetup/, you can get it along with compatible versions of
<tt/mount/ and <tt/unmount/ from the <tt/util-linux/ package in the
directory <url url="ftp://ftp.win.tue.nl/pub/linux/utils/util-linux/">.

<p>
If you do not have a loop device (<file>/dev/loop0</file>,
<file>/dev/loop1</file>, etc.) on your system, you will have to create
one with ``<tt>mknod /dev/loop0 b 7 0</tt>''.  One you've installed these
special <tt/mount/ and <tt/umount/ binaries, create a temporary file
on a hard disk with enough capacity (eg, <file>/tmp/fsfile</file>).
You can use a command like

<verb>
        dd if=/dev/zero of=/tmp/fsfile bs=1k count=<it/nnn/
</verb>
to create an <em/nnn/-block file.

Use the file name in place of DEVICE below.  When you issue a mount
command you must include the option ``<tt>-o loop</tt>'' to tell mount
to use a loopback device.  <nidx/loopback device/
For example:
<verb>
	mount -o loop -t ext2 /tmp/fsfile /mnt
</verb>

will mount <file>/tmp/fsfile</file> (via a loopback device) at the mount
point <tt>/mnt</tt>.  A <tt/df/ will confirm this.

</itemize>


After you've chosen one of these options, prepare the DEVICE with:
<verb>
	dd if=/dev/zero of=DEVICE bs=1k count=3000
</verb>

This command zeroes out the device.  This step is important because the
filesystem on the device will be compressed later, so all unused
portions should be filled with zeroes to achieve maximum compression.

<nidx/inodes, allocation/
Next, create the filesystem.  The Linux kernel recognizes two file system
types for root disks to be automatically copied to ramdisk.  These are minix
and ext2, of which ext2 is the preferred file system.  If using ext2, you may
find it useful to use the <tt>-i</tt> option to specify more inodes than the
default; <tt/-i 2000/ is suggested so that you don't run out of inodes.
Alternatively, you can save on inodes by removing lots of unnecessary
<tt>/dev</tt> files.  <tt/mke2fs/ will by default create 360 inodes on a
1.44Mb diskette.  I find that 120 inodes is ample on my current rescue root
diskette, but if you include all the devices in the <tt>/dev</tt> directory
then you will easily exceed 360.  Using a compressed root filesystem allows a
larger filesystem, and hence more inodes by default, but you may still need to
either reduce the number of files or increase the number of inodes.

So the command you use will look like:
<verb>
	mke2fs -m 0 -i 2000 DEVICE
</verb>

(If you're using a loopback device, the disk file you're using should be
supplied in place of this DEVICE.  In this case, <tt/mke2fs/ will ask if
you really want to do this; say yes.)
<nidx/loopback device/ 

The <tt/mke2fs/ command will automatically detect the space available and
configure itself accordingly.  The <tt/-m&space;0/ parameter prevents it
from reserving space for root, and hence provides more usable space on
the disk.

Next, mount the device:

<verb>
	mount -t ext2 DEVICE /mnt
</verb>

(You must create a mount point <tt>/mnt</tt> if it does not already exist.)
In the remaining sections, all destination directory names are assumed
to be relative to <tt>/mnt</tt>.


<sect1>Populating the filesystem.<p>

Here is a reasonable minimum set of directories for your root filesystem:

<itemize>

<item> <tt>/dev</tt> -- Devices, required to perform I/O 
<item> <tt>/proc</tt> -- Directory stub required by the proc filesystem
<item> <tt>/etc</tt> -- System configuration files
<item> <tt>/sbin</tt> -- Critical system binaries 
<item> <tt>/bin</tt>  -- Basic binaries considered part of the system 
<item> <tt>/lib</tt> -- Shared libraries to provide run-time support
<item> <tt>/mnt</tt> -- A mount point for maintenance on other disks
<item> <tt>/usr</tt> -- Additional utilities and applications
</itemize>

(The directory structure presented here is for root diskette use only.
Real Linux systems have a more complex and disciplined set of policies,
called the Filesystem Hierarchy Standard, for determining where files
should go.)

<ncdx/proc/<ncdx/mnt/<ncdx/usr/

Three of these directories will be empty on the root filesystem, so they
only need to be created with <tt/mkdir/.  The <tt>/proc</tt> directory is
basically a stub under which the proc filesystem is placed.  The
directories <tt>/mnt</tt> and <tt>/usr</tt> are only mount points for use
after the boot/root system is running.  Hence again, these directories only
need to be created.

The remaining four directories are described in the following sections.

<!-- 
    Note:  I used to have <tt>/dev</tt> in here but sgml2txt screws up 
    the table of contents badly if you put such things in section headers.
-->



<sect2>/dev<p>

<nidx/device (dev) directory/

A <tt>/dev</tt> directory containing a special file for all devices to be
used by the system is mandatory for any Linux system.  The directory itself
is a normal directory, and can be created with <tt/mkdir/ in the normal
way.  The device special files, however, must be created in a special way,
using the <tt><cdx/mknod/</tt> command.

There is a shortcut, though -- copy your existing <tt>/dev</tt> directory
contents, and delete the ones you don't want.  The only requirement is that
you copy the device special files using <tt/-R/ option.  This will copy the
directory without attempting to copy the contents of the files.  <em>Be sure
to use an upper case R</em>.  If you use the lower case switch <tt/-r/, you
will probably end up copying the entire contents of all of your hard disks
-- or at least as much of them as will fit on a diskette!  Therefore,
take care, and use the command:

<verb>
	cp -dpR /dev /mnt
</verb>

assuming that the diskette is mounted at <tt>/mnt</tt>.  The <tt/dp/ switches
ensure that symbolic links are copied as links, rather than using the
target file, and that the original file attributes are preserved, thus
preserving ownership information.

If you want to do it the hard way, use <tt/ls -l/ to display the major
and minor device numbers for the devices you want, and create 
them on the diskette using <tt/mknod/.

However the devices are copied, it is worth checking that any special
devices you need have been placed on the rescue diskette.  For example,
<tt><cdx/ftape/</tt> uses tape devices, so you will need to copy all of
these if you intend to access your floppy tape drive from the bootdisk.

Note that one inode is required for each device special file, and
<idx/inodes/ can at times be a scarce resource, especially on diskette
filesystems.  It therefore makes sense to remove any device special files
that you don't need from the diskette <tt>/dev</tt> directory.  Many
devices are obviously unnecessary on specific systems.  For example, if you
do not have SCSI disks you can safely remove all the device files starting
with <tt/sd/.  Similarly, if you don't intend to use your serial port
then all device files starting with <tt/cua/ can go.

<em>Be sure to include the following files from this directory:</em>
<tt>console, kmem, mem, null, ram, tty1</tt>.

<sect2>/etc<p>
<nidx/etc directory/

This directory must contain a number of configuration files.  On most
systems, these can be divided into three groups:

<enum>
<item>Required at all times, <it/e.g./ <tt/rc, fstab, passwd/.
      <ncdx/rc/<ncdx/fstab/<ncdx/passwd/
<item>May be required, but no-one is too sure.
<item>Junk that crept in. 
</enum>

Files which are not essential can be identified with the command:

<tscreen><verb>
	ls -ltru
</verb></tscreen>

This lists files in reverse order of date last accessed, so if any
files are not being accessed, they can be omitted from a root diskette.

On my root diskettes, I have the number of config files down to
15.  This reduces my work to dealing with three sets of files:

<enum>
<item>The ones I must configure for a boot/root system:

<enum>
<item><tt>rc.d/*</tt> -- system startup and run level change scripts
<item><tt><cdx/fstab/</tt> -- list of file systems to be mounted 
<item><tt><cdx/inittab/</tt> -- parameters for the <tt/init/ process, the
		first process started at boot time. <ncdx/init/
</enum>

<item>The ones I should tidy up for a boot/root system:
<enum>
	<item><tt><cdx/passwd/</tt> -- list of users, home directories, etc.
	<item><tt/group/ -- user groups. <nidx/user groups/
	<item><tt/shadow/ -- passwords of users.  You may not have this.
               <nidx/shadow passwords/
        <item><tt/termcap/ -- the terminal capability database.
</enum>

If security is important, <tt/passwd/ and <tt/shadow/ should be pruned to
avoid copying user passwords off the system, and so that when you boot from
diskette, unwanted logins are rejected.  <nidx/restoring files/
 
Be sure that <tt><cdx/passwd/</tt> contains at least <tt/root/.  If you
intend other users to login, be sure their home directories and shells
exist.

<tt/termcap/, the terminal database, is typically several hundred
kilobytes.  The version on your boot/root diskette should be pruned down to
contain only the terminal(s) you use, which is usually just the
<tt/linux-console/ entry.


<item>The rest. They work at the moment, so I leave them alone.

</enum>

Out of this, I only really have to configure two files, and what they
should contain is surprisingly small.
<itemize>

<item><tt/rc/ should contain:
<verb>
	#!/bin/sh	
	/bin/mount -av
	/bin/hostname Kangaroo
</verb>

Be sure the directories are right.  You don't really need to run
<tt><cdx/hostname/</tt> -- it just looks nicer if you do. 

<item><tt><cdx/fstab/</tt> should contain at least:

<verb>
        /dev/ram0       /               ext2    defaults
	/dev/fd0	/		ext2	defaults
	/proc		/proc		proc	defaults
</verb>

You can copy entries from your existing <tt/fstab/, but you should not
automatically mount any of your hard disk partitions; use the <tt/noauto/
keyword with them.  Your hard disk may be damaged or dead when the bootdisk is
used.

</itemize>

Your <tt><cdx/inittab/</tt> should be changed so that its
<tt><cdx/sysinit/</tt> line runs <tt>rc</tt> or whatever basic boot script
will be used.  Also, if you want to ensure that users on serial ports
cannot login, comment out all the entries for <tt/getty/ which include a
<tt/ttys/ or <tt/ttyS/ device at the end of the line.  Leave in the
<tt/tty/ ports so that you can login at the console.

A minimal <tt><cdx/inittab/</tt> file looks like this:
<verb>
	id:2:initdefault:
	si::sysinit:/etc/rc
	1:2345:respawn:/sbin/getty 9600 tty1
	2:23:respawn:/sbin/getty 9600 tty2
</verb>

The <tt><cdx/inittab/</tt> file defines what the system will run in various
states including startup, move to multi-user mode, etc.  Be sure to check
carefully the filenames mentioned in <tt/inittab/; if <tt/init/ cannot find
the program mentioned the bootdisk will hang, and you may not even get an
error message.

<nidx/hardcoded locations/

Note that some programs cannot be moved elsewhere because other programs
have hardcoded their locations.  For example on my system,
<file>/etc/shutdown</file> has hardcoded in it <file>/etc/reboot</file>.
If I move <tt/reboot/ to <file>/bin/reboot</file>, and then issue a
<tt/shutdown/ command, it will fail because it cannot find the <tt/reboot/
file.

<nidx/etc directory/

For the rest, just copy all the text files in your <tt>/etc</tt> directory,
plus all the executables in your <tt>/etc</tt> directory that you cannot be
sure you do not need.  As a guide, consult the sample listing in Section <ref
id="listings" name="Sample rootdisk directory listings">.  Probably it will
suffice to copy only those files, but systems differ a great deal, so you
cannot be sure that the same set of files on your system is equivalent to the
files in the list.  The only sure method is to start with <tt/inittab/ and
work out what is required.

Most systems now use an <file>/etc/rc.d/</file> directory containing shell
scripts for different run levels.  The minimum is a single <tt/rc/ script,
but it may be simpler just to copy <tt><cdx/inittab/</tt> and the
<file>/etc/rc.d</file> directory from your existing system, and prune the shell
scripts in the <tt/rc.d/ directory to remove processing not relevent to a
diskette system environment.

<sect2>/bin and /sbin<p>
<nidx/bin directory/
<nidx/sbin directory/

The <tt>/bin</tt> directory is a convenient place for extra utilities you need
to perform basic operations, utilities such as <tt/ls/, <tt/mv/, <tt/cat/ and
<tt/dd/.  See Appendix <ref id="listings" name="Sample rootdisk directory
listings"> for an example list of files that go in a <tt>/bin</tt> and
<tt>/sbin</tt> directories.  It does not include any of the utilities required
to restore from backup, such as <tt/cpio/, <tt/tar/ and <tt/gzip/.  That is
because I place these on a separate utility diskette, to save space on the
boot/root diskette.  Once the boot/root diskette is booted, it is copied to
the ramdisk leaving the diskette drive free to mount another diskette, the
utility diskette.  I usually mount this as <tt>/usr</tt>.

Creation of a <idx/utility diskette/ is described below in the section
Section <ref id="utilitydisk" name="Building a utility disk">.  It is
probably desirable to maintain a copy of the same version of backup
utilities used to write the backups so you don't waste time trying to
install versions that cannot read your backup tapes.

<em>Make sure you include the following programs:</em> <tt/init/, <tt/getty/
or equivalent, <tt/login/, <tt/mount/, some shell capable of running your rc
scripts, a link from <tt/sh/ to the shell.

<ncdx/init/<ncdx/getty/<ncdx/login/<nidx/shells/


<sect2>/lib<p>
<nidx/library (lib) directory/
<nidx/libraries/

In <tt>/lib</tt> you place necessary shared libraries and loaders.  If the
necessary libraries are not found in your <tt>/lib</tt> directory then the
system will be unable to boot.  If you're lucky you may see an error
message telling you why.

<ncdx/libc.so/
Nearly every program requires at least the <tt/libc/ library,
<tt>libc.so.<it/N/</tt>, where <it/N/ is the current version number.  Check
your <tt>/lib</tt> directory.   <tt/libc.so.N/ is usually a symlink
to a filename with a complete version number:

<tscreen><verb>
% ls -l /lib/libc*
-rwxr-xr-x   1 root     root      4016683 Apr 16 18:48 libc-2.1.1.so*
lrwxrwxrwx   1 root     root           13 Apr 10 12:25 libc.so.6 -> libc-2.1.1.so*
</verb></tscreen>

In this case, you want <tt/libc-2.1.1.so/.  To find other libraries you
should go through all the binaries you plan to include and check their
dependencies with the <tt><cdx/ldd/</tt> command.  For example:

<verb>
	% ldd /sbin/mke2fs
        libext2fs.so.2 => /lib/libext2fs.so.2 (0x40014000)
        libcom_err.so.2 => /lib/libcom_err.so.2 (0x40026000)
        libuuid.so.1 => /lib/libuuid.so.1 (0x40028000)
        libc.so.6 => /lib/libc.so.6 (0x4002c000)
        /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x40000000)
</verb>

Each file on the right-hand side is required.  The file may be a symbolic
link.

Note that some libraries are <em>quite large</em> and will not fit easily
on your root filesystem.  For example, the <tt/libc.so/ listed above is
about 4 meg.  You will probably need to strip libraries when copying them
to your root filesystem.  See Section <ref id="slimfast" name="Reducing
root filesystem size"> for instructions.

<nidx/loaders/<nidx/ELF/<nidx/a.out/

In <tt>/lib</tt> you must also include a loader for the libraries.
The loader will be either <tt/ld.so/ (for a.out libraries)
or <tt/ld-linux.so/ (for ELF libraries).
Newer versions of <tt/ldd/ tell you exactly which loader is needed, as in the
example above, but older versions may not.  If you're unsure which you
need, run the <tt/file/ command on the library.  For example:

<verb>
	% file/lib/libc.so.4.7.2 /lib/libc.so.5.4.33 /lib/libc-2.1.1.so
	/lib/libc.so.4.7.2: Linux/i386 demand-paged executable (QMAGIC), stripped
	/lib/libc.so.5.4.33: ELF 32-bit LSB shared object, Intel 80386, version 1, stripped
	/lib/libc-2.1.1.so: ELF 32-bit LSB shared object, Intel 80386, version 1, not stripped
</verb>

The <tt/QMAGIC/ indicates that <tt/4.7.2/ is for a.out libraries, and
<tt/ELF/ indicates that <tt/5.4.33/ and <tt/2.1.1/ are for
ELF.<nidx/ELF/<nidx/a.out/

Copy the specific loader(s) you need to the root filesystem you're building.
Libraries and loaders should be checked <em/carefully/ against the included
binaries.  If the kernel cannot load a necessary library, the kernel will
usually hang with no error message.


<sect1>Providing for PAM and NSS.<p>
<label id="PAMNSS">

Your system may require dynamically loaded libraries that are not visible
to <file>ldd</file>.  

<sect2>PAM (Pluggable Authentication Modules).<p>

If your system uses PAM (Pluggable Authentication Modules), you must make
some provision for it on your bootdisk or you will not be able to login.
PAM, briefly, is a sophisticated modular method for authenticating users
and controlling their access to services.  An easy way to determine if your
system uses PAM is to check your hard disks's <file>/etc</file> directory
for a file <file>pam.conf</file> or a <file>pam.d</file> directory; if
either exists, you must provide some minimal PAM support.  (Alternatively,
run <file>ldd</file> on your <file>login</file> executable; if the output
includes <file>libpam.so</file>, you need PAM.)

Fortunately, security is usually of no concern with bootdisks since anyone
who has physical access to a machine can usually do anything they want
anyway.  Therefore, you can effectively disable PAM by creating a simple
<file>/etc/pam.conf</file> file in your root filesystem that looks like
this:

<code>
OTHER	auth       optional	/lib/security/pam_permit.so
OTHER	account    optional	/lib/security/pam_permit.so
OTHER	password   optional	/lib/security/pam_permit.so
OTHER	session    optional	/lib/security/pam_permit.so
</code>

Also copy the file <tt>/lib/security/pam&lowbar;permit.so</tt> to your root
filesystem.  This library is only about 8K so it imposes minimal overhead.

Note that this configuration allows anyone complete access to the files and
services on your machine.  If you care about security on your bootdisk for
some reason, you'll have to copy some or all of your hard disk's PAM setup
to your root filesystem.  Be sure to read the PAM documentation carefully,
and copy any libraries needed in <file>/lib/security</file> onto your root
filesystem.

You must also include <file>/lib/libpam.so</file> on your bootdisk.  But
you already know this since you ran ldd on <file>/bin/login</file>, which
showed this dependency.


<sect2>NSS (Name Service Switch).<p>

If you are using glibc (aka libc6), you will have to make provisions for
name services or you will not be able to log in.  The file
<file>/etc/nsswitch.conf</file> controls database lookups for various
servies.  If you don't plan to access services from the network (eg, DNS or
NIS lookups), you need only prepare a simple <file>nsswitch.conf</file>
file that looks like this:

<code>
     passwd:     files 
     shadow:     files 
     group:      files 
     hosts:      files
     services:   files
     networks:   files
     protocols:  files
     rpc:        files
     ethers:     files
     netmasks:   files     
     bootparams: files
     automount:  files 
     aliases:    files
     netgroup:   files
     publickey:  files
</code>

This specifies that every service be provided only by local files.  You
will also need to include <tt>/lib/libnss&lowbar;files.so.1</tt>, which will
be loaded dynamically to handle the file lookups.

If you plan to access the network from your bootdisk, you may want to
create a more elaborate <file>nsswitch.conf</file> file.  See the
<file>nsswitch</file> man page for details.  Keep in mind that you must
include a file <tt>/lib/libnss&lowbar;</tt><it>service</it><tt>.so.1</tt>
for each <it>service</it> you specify.


<sect1>Modules.<p> <nidx/modules/

If you have a modular kernel, you must consider which modules you may want to
load from your bootdisk after booting.  You might want to include <tt/ftape/
and <tt/zftape/ modules if your backup tapes are on floppy tape, modules for
SCSI devices if you have them, and possibly modules for PPP or SLIP support if
you want to access the net in an emergency.<ncdx/ftape/

These modules may be placed in <file>/lib/modules</file>.  You should also
include <tt/insmod/, <tt/rmmod/ and <tt/lsmod/.  Depending on whether you
want to load modules automatically, you might also include <tt/modprobe/,
<tt/depmod/ and <tt/swapout/.  If you use <tt/kerneld/, include it along
with <file>/etc/conf.modules</file>.

However, the main advantage to using modules is that you can move non-critical
modules to a utility disk and load them when needed, thus using less space on
your root disk.  If you may have to deal with many different devices, this
approach is preferable to building one huge kernel with many drivers built in.

<em/Note that in order to boot a compressed ext2 filesystem, you must have
ramdisk and ext2 support built-in/.  They cannot be supplied as modules.


<sect1>Some final details.<p>

Some system programs, such as <tt/login/, complain if the file
<file>/var/run/utmp</file> and the directory <file>/var/log</file> do not
exist.<ncdx/utmp/ So:

<verb>
	mkdir -p /mnt/var/{log,run}
	touch /mnt/var/run/utmp
</verb>

Finally, after you have set up all the libraries you need, run
<tt/ldconfig/ to remake <file>/etc/ld.so.cache</file> on the root
filesystem.  The cache tells the loader where to find the libraries.  To
remake <tt/ld.so.cache/, issue the following
commands:<ncdx/ldconfig/<ncdx/ld.so.cache/

<verb>
	chdir /mnt; chroot /mnt /sbin/ldconfig
</verb>

The <tt/chroot/ is necessary because <tt/ldconfig/ always remakes the
cache for the root filesystem.

<sect1>Wrapping it up.<p>
<label id="wrappingitup">

Once you have finished constructing the root filesystem, unmount it, copy it
to a file and compress it:

<verb>
	umount /mnt
	dd if=DEVICE bs=1k | gzip -v9 > rootfs.gz
</verb>

When this finishes you will have a file <tt/rootfs.gz/ that is your
compressed root filesystem.  You should check its size to make sure it will
fit on a diskette; if it doesn't you'll have to go back and remove some
files.  Section
<ref id="slimfast" name="Reducing root filesystem size">
has some hints for reducing the size of the root filesystem.


<sect>Choosing a kernel.<p>
<nidx/kernel, choosing/

At this point you have a complete compressed root filesystem.  The next step
is to build or select a kernel.  In most cases it would be possible to copy
your current kernel and boot the diskette from that.  However, there may be
cases where you wish to build a separate one.

One reason is size.  If you are building a single boot/root diskette, the
kernel will be one of the largest files on the diskette so you will have to
reduce the size of the kernel as much as possible.  To reduce kernel size,
build it with the minumum set of facilities necessary to support the
desired system.  This means leaving out everything you don't need.
Networking is a good thing to leave out, as well as support for any disk
drives and other devices which you don't need when running your boot/root
system.  As stated before, your kernel <em/must/ have ramdisk and ext2
support built into it.

Having worked out a minimum set of facilities to include in a kernel, you then
need to work out what to add back in.  Probably the most common uses for a
boot/root diskette system would be to examine and restore a corrupted root
file system, and to do this you may need kernel support.  For example, if your
backups are all held on tape using Ftape to access your tape drive, then, if
you lose your current root drive and drives containing Ftape, then you will
not be able to restore from your backup tapes.  You will have to reinstall
Linux, download and reinstall <cdx/ftape/, and then try to read your backups.

The point here is that, whatever I/O support you have added to your kernel to
support backups should also be added into your boot/root kernel.

<nidx/kernel, building from source/

The procedure for actually building the kernel is described in the
documentation that comes with the kernel.  It is quite easy to follow, so
start by looking in <file>/usr/src/linux</file>.  If you have trouble
building a kernel, you should probably not attempt to build boot/root
systems anyway.  Remember to compress the kernel with ``<tt/make zImage/''.


<sect>Putting them together: Making the diskette(s).<p>

At this point you have a kernel and a compressed root filesystem.  If you are
making a boot/root disk, check their sizes to make sure they will both fit on
one disk.  If you are making a two disk boot+root set, check the root
filesystem to make sure it will fit on a single diskette.

You should decide whether to use LILO to boot the bootdisk kernel.  The
alternative is to copy the kernel directly to the diskette and boot without
<cdx/LILO/.  The advantage of using LILO is that it enables you to supply some
parameters to the kernel which may be necessary to initialize your hardware
(Check the file <file>/etc/lilo.conf</file> on your system.  If it exists and
has a line like ``<tt/append=.../'', you probably need this feature).  The
disadvantage of using LILO is that building the bootdisk is more complicated
and takes slightly more space.  You will have to set up a small separate
filesystem, which we shall call the <bf/kernel filesystem/, where you transfer
the kernel and a few other files that LILO needs.

<ncdx/lilo.conf/<nidx/lilo filesystem/<nidx/kernel, parameters/

If you are going to use LILO, read on; if you are going to transfer the
kernel directly, skip ahead to section <ref id="withoutlilo" name="Without
using LILO">.

<sect1>Transferring the kernel with LILO <ncdx/LILO/.<p>
<label id="usinglilo">

The first thing you must do is create a small configuration file for LILO.
It should look like this:

<code>
	boot	  =/dev/fd0
	install   =/boot/boot.b
	map	  =/boot/map
	read-write
	backup    =/dev/null
	compact
	image	  = KERNEL
	label     = Bootdisk
	root	  =/dev/fd0
</code>

For an explanation of these parameters, see LILO's user documentation.  You
will probably also want to add an <tt/append=.../ line to this file from
your hard disk's <file>/etc/lilo.conf</file> file.<ncdx/lilo.conf/

Save this file as <tt/bdlilo.conf/.

You now have to create a small filesystem, which we shall call a
<bf><idx/kernel filesystem/</bf>, to distinguish it from the root
filesystem.

First, figure out how large the filesystem should be.  Take the size of your
kernel in blocks (the size shown by ``<tt>ls -l KERNEL</tt>'' divided by 1024
and rounded up) and add 50.  Fifty blocks is approximately the space needed
for inodes plus other files.  You can calculate this number exactly if you
want to, or just use 50.  If you're creating a two-disk set, you may as well
overestimate the space since the first disk is only used for the kernel
anyway.  Call this number <tt/KERNEL&lowbar;BLOCKS/.<ncdx/KERNEL&lowbar;BLOCKS/

Put a floppy diskette in the drive (for simplicity we'll assume
<file>/dev/fd0</file>) and create an ext2 kernel filesystem on it:

<verb>
	mke2fs -i 8192 -m 0 /dev/fd0 KERNEL_BLOCKS
</verb>

<nidx/inodes, allocation/

The ``<tt/-i 8192/'' specifies that we want one inode per 8192 bytes.
Next, mount the filesystem, remove the <tt/lost+found/ directory,
and create <tt/dev/ and <tt/boot/ directories for LILO:

<verb>
	mount /dev/fd0 /mnt
	rm -rf /mnt/lost+found
	mkdir /mnt/{boot,dev}
</verb>

Next, create devices <file>/dev/null</file> and <file>/dev/fd0</file>.
Instead of looking up the device numbers, you can just copy them from your
hard disk using <tt/-R/:

<verb>
	cp -R /dev/{null,fd0} /mnt/dev
</verb>

LILO needs a copy of its boot loader, <tt>boot.b</tt>, which you can take from
your hard disk.  It is usually kept in the <tt>/boot</tt> directory.

<verb>
	cp /boot/boot.b /mnt/boot
</verb>

Finally, copy in the LILO configuration file you created in the last section,
along with your kernel.  Both can be put in the root directory:

<verb>
	cp bdlilo.conf KERNEL /mnt
</verb>

Everything LILO needs is now on the kernel filesystem, so you are ready to run
it.  LILO's <tt/-r/ flag is used for installing the boot loader on some other
root: <ncdx/LILO/

<verb>
	lilo -v -C bdlilo.conf -r /mnt
</verb>

LILO should run without error, after which the kernel filesystem
should look something like this: 

<code>
total 361
  1 -rw-r--r--   1 root     root          176 Jan 10 07:22 bdlilo.conf
  1 drwxr-xr-x   2 root     root         1024 Jan 10 07:23 boot/
  1 drwxr-xr-x   2 root     root         1024 Jan 10 07:22 dev/
358 -rw-r--r--   1 root     root       362707 Jan 10 07:23 vmlinuz
boot:
total 8
  4 -rw-r--r--   1 root     root         3708 Jan 10 07:22 boot.b
  4 -rw-------   1 root     root         3584 Jan 10 07:23 map
dev:
total 0
  0 brw-r-----   1 root     root       2,   0 Jan 10 07:22 fd0
  0 crw-r--r--   1 root     root       1,   3 Jan 10 07:22 null           
</code>

<nidx/kernel filesystem/

Do not worry if the file sizes are slightly different from yours.

Now leave the disk in the drive and go to section <ref id="ramdiskword"
name="Setting the ramdisk word">.

<sect1>Transferring the kernel without LILO.<p>
<label id="withoutlilo">

If you are <em/not/ using LILO, transfer the kernel to the bootdisk with the
<tt/dd/ command:

<verb>
	% dd if=KERNEL of=/dev/fd0 bs=1k
	353+1 records in
	353+1 records out
</verb>

In this example, <tt/dd/ wrote 353 complete records + 1 partial record, so the
kernel occupies the first 354 blocks of the diskette.  Call this number
<tt/KERNEL&lowbar;BLOCKS/ and remember it for use in the next
section.<ncdx/KERNEL&lowbar;BLOCKS/

Finally, set the root device to be the diskette itself, then set the
root to be loaded read/write:

<verb>
	rdev /dev/fd0 /dev/fd0
	rdev -R /dev/fd0 0
</verb>

<ncdx/rdev/

Be careful to use a capital <tt/-R/ in the second <tt/rdev/ command.


<sect1>Setting the ramdisk word.<p>
<label id="ramdiskword">

Inside the kernel image is the <bf><idx/ramdisk word/</bf> that specifies
where the root filesystem is to be found, along with other options.  The
word can be accessed and set via the <tt/rdev/ command, and its contents
are interpreted as follows:

<verb>
	bits  0-10:	Offset to start of ramdisk, in 1024 byte blocks
	bits 11-13:	unused
	bit     14:	Flag indicating that ramdisk is to be loaded
	bit	15:	Flag indicating to prompt before loading rootfs
</verb>

If bit 15 is set, on boot-up you will be prompted to place a new floppy
diskette in the drive.  This is necessary for a two-disk boot set.

There are two cases, depending on whether you are building a single
boot/root diskette or a double ``boot+root'' diskette set.

<enum>

<item>If you are building a single disk, the compressed root filesystem will
be placed right after the kernel, so the offset will be the first free block
(which should be the same as <tt/KERNEL&lowbar;BLOCKS/).  Bit 14 will be set
to 1, and bit 15 will be zero.<ncdx/KERNEL&lowbar;BLOCKS/

<item>If you are building a two-disk set, the root filesystem will begin
at block zero of the second disk, so the offset will be zero.
Bit 14 will be set to 1, and bit 15 will be 1.  

</enum>

<ncdx/rdev/<nidx/ramdisk word/

After carefully calculating the value for the ramdisk word, set it with
<tt/rdev -r/.  Be sure to use the <em/decimal/ value.  If you used LILO,
the argument to <tt/rdev/ here should be the <em/mounted kernel path/,
e.g. <tt>/mnt/vmlinuz</tt>; if you copied the kernel with <tt/dd/, instead
use the floppy device name (<it/e.g.,/ <tt>/dev/fd0</tt>).

<verb>
	rdev -r KERNEL_OR_FLOPPY_DRIVE  VALUE
</verb>

If you used LILO, unmount the diskette now.


<sect1>Transferring the root filesystem.<p>

The last step is to transfer the root filesystem.

<itemize>

<item>If the root filesystem will be placed on the <em/same/ disk as the
kernel, transfer it using <tt/dd/ with the <tt/seek/ option, which specifies
how many blocks to skip:

<verb>
	dd if=rootfs.gz of=/dev/fd0 bs=1k seek=KERNEL_BLOCKS
</verb>

<item>If the root filesystem will be placed on a <em/second/ disk, remove the
first diskette, put the second diskette in the drive, then transfer the root
filesystem to it:

<verb>
	dd if=rootfs.gz of=/dev/fd0 bs=1k
</verb>

</itemize>

Congratulations, you are done!  <em>You should always test a bootdisk
before putting it aside for an emergency!</em> If it fails to boot, read
on.


<sect>Troubleshooting, or The Agony of Defeat.<p>
<label id="troubleshooting">
<nidx/troubleshooting/

When building bootdisks, the first few tries often will not boot.  The general
approach to building a root disk is to assemble components from your existing
system, and try and get the diskette-based system to the point where it
displays messages on the console.  Once it starts talking to you, the battle
is half over because you can see what it is complaining about, and you can fix
individual problems until the system works smoothly.  If the system just hangs
with no explanation, finding the cause can be difficult.  To get a system to
boot to the stage where it will talk to you requires several components to be
present and correctly configured.  The recommended procedure for investigating
the problem where the system will not talk to you is as follows:

<itemize>

<item>You may see a message like this:

<verb>Kernel panic: VFS: Unable to mount root fs on XX:YY
</verb>

This is a common problem and it has only a few causes.  First, check the
device <it/XX:YY/ against the list of device codes; is it the correct root
device?  If not, you probably didn't do an <tt/rdev -R/, or you did it on
the wrong image.  If the device code is correct, then check carefully the
device drivers compiled into your kernel.  Make sure it has floppy disk,
ramdisk and ext2 filesystem support built-in.

<item>Check that the root disk actually contains the directories you think
it does.  It is easy to copy at the wrong level so that you end up with
something like <file>/rootdisk/bin</file> instead of <tt>/bin</tt> on your
root diskette.

<item>Check that there is a <file>/lib/libc.so</file> with the same link that
appears in your <tt>/lib</tt> directory on your hard disk.<ncdx/libc.so/

<item>Check that any symbolic links in your <tt>/dev</tt> directory in your
existing system also exist on your root diskette filesystem, where those links
are to devices which you have included in your root diskette. In particular,
<tt>/dev/console</tt> links are essential in many cases.
<nidx/device (dev) directory/

<item>Check that you have included <tt>/dev/tty1, /dev/null, /dev/zero,
/dev/mem, /dev/ram</tt> and <tt>/dev/kmem</tt> files.

<item>Check your kernel configuration -- support for all resources
required up to login point must be built in, not modules.  
So <em>ramdisk and ext2 support must be built-in</em>.

<item>Check that your kernel root device and ramdisk settings are
correct. 

</itemize>

Once these general aspects have been covered, here are some more
specific files to check:  

<enum>

<item> Make sure <tt/init/ is included as <file>/sbin/init</file> or
<file>/bin/init</file>.  Make sure it is executable.<ncdx/init/

<item>Run <tt>ldd init</tt> to check init's libraries.  Usually this is just
<tt/libc.so/, but check anyway.  Make sure you included the necessary
libraries and loaders.

<item>Make sure you have the right loader for your libraries --
<tt/ld.so/ for a.out or <tt/ld-linux.so/ for ELF.<nidx/loaders/

<item>Check the <file>/etc/inittab</file> on your bootdisk filesystem for
the calls to <tt/getty/ (or some <tt/getty/-like program, such as
<tt/agetty/, <tt/mgetty/ or
<tt/getty&lowbar;ps/).<ncdx/inittab/<ncdx/getty/ Double-check these against
your hard disk <tt/inittab/.  Check the man pages of the program you use to
make sure these make sense.  <tt/inittab/ is possibly the trickiest part
because its syntax and content depend on the init program used and the
nature of the system.  The only way to tackle it is to read the man pages
for <tt/init/ and <tt/inittab/ and work out exactly what your existing
system is doing when it boots.  Check to make sure
<file>/etc/inittab</file> has a system initialisation entry.  This should
contain a command to execute the system initialization script, which must
exist.

<item>As with <tt/init/, run <tt/ldd/ on your <tt><cdx/getty/</tt> to see
what it needs, and make sure the necessary library files and loaders were
included in your root filesystem.

<item>Be sure you have included a shell program (e.g., <tt/bash/ or <tt/ash/)
capable of running all of your rc scripts.<nidx/shells/

<item>If you have a <file>/etc/ld.so.cache</file> file on your rescue disk,
remake it. <ncdx/ld.so.cache/

</enum>

<p>

If <tt/init/ starts, but you get a message like:  
<verb>
	Id xxx respawning too fast: disabled for 5 minutes  
</verb>

<ncdx/respawning too fast/

it is coming from <tt/init/, usually indicating that <tt/getty/ or
<tt/login/ is dying as soon as it starts up.
<ncdx/init/<ncdx/getty/<ncdx/login/ Check the <tt/getty/ and <tt/login/
executables and the libraries they depend upon.  Make sure the invocations
in <file>/etc/inittab</file> are correct.  If you get strange messages from
<tt/getty/, it may mean the calling form in <file>/etc/inittab</file> is
wrong.  The options of the <it/getty/ programs are variable; even different
versions of <tt/agetty/ are reported to have different incompatible calling
forms.<ncdx/inittab/

If you get a login prompt, and you enter a valid login name but the system
prompts you for another login name immediately, the problem may be with PAM
or NSS.  See Section <ref id="PAMNSS" name="PAM and NSS">.  The problem may
also be that you use shadow passwords and didn't copy
<file>/etc/shadow</file> to your bootdisk.

If you try to run some executable, such as <tt/df/, which is on your rescue
disk but you yields a message like: <tt/df: not found/, check two things: (1)
Make sure the directory containing the binary is in your PATH, and (2) make
sure you have libraries (and loaders) the program needs.


<sect>Miscellaneous topics.<p>

<sect1>Reducing root filesystem size.<p>
<label id="slimfast">

Sometimes a root filesystem is too large to fit on a diskette even after
compression.  Here are some ways to reduce the filesystem size, listed 
in decreasing order of effectiveness:

<descrip>

<tag/Increase the disk density/ By default, floppy diskettes are
formatted at 1440K, but higher density formats are available.
<file>fdformat</file> will format disks for the following sizes: 1600, 1680,
1722, 1743, 1760, 1840, and 1920.  Most 1440K drives will support
1722K, and this is what I always use for bootdisks.  See the
<file>fdformat</file> man page and
<file>/usr/src/linux/Documentation/devices.txt</file>.

<tag/Replace your shell/ Some of the popular shells for Linux, such as
<tt/bash/ and <tt/tcsh/, are large and require many libraries.
Light-weight alternatives exist, such as <tt/ash/, <tt/lsh/, <tt/kiss/ and
<tt/smash/, which are much smaller and require few (or no) libraries.  Most of
these replacement shells are available from <url
url="http://metalab.unc.edu/pub/Linux/system/shells/">.  Make sure any shell
you use is capable of running commands in all the <tt/rc/ files you include on
your bootdisk.
<nidx/shells/

<tag/Strip libraries and binaries/<nidx/libraries/

Many libraries and binaries are typically unstripped (include debugging
symbols).  Running '<tt>file</tt>' on these files will tell you '<tt>not
stripped</tt>' if so.  When copying binaries to your root filesystem, it is
good practice to use:

<verb>
	objcopy --strip-all FROM TO
</verb>

<ncdx/strip/<ncdx/objcopy/<nidx/libraries, stripping/
When copying libraries, use:

<verb>
	objcopy --strip-debug FROM TO
</verb>


<tag/Move non-critical files to a utility disk/ If some of your binaries are
not needed immediately to boot or login, you can move them to a utility disk.
See section <ref id="utilitydisk" name="Building a utility disk"> for details.
You may also consider moving modules to a utility disk as well.
<nidx/utility diskette/

</descrip>

<sect1>Non-ramdisk root filesystems.<p>
<label id="nonramdiskroot">
<nidx/ramdisk/

Section <ref id="buildroot" name="Building a root filesystem"> gave
instructions for building a compressed root filesystem which is loaded to
ramdisk when the system boots.  This method has many advantages so it is
commonly used.  However, some systems with little memory cannot afford the
RAM needed for this, and they must use root filesystems mounted directly
from the diskette.

Such filesystems are actually easier to build than compressed root filesystems
because they can be built on a diskette rather than on some other device, and
they do not have to be compressed.  We will outline the procedure as it
differs from the instructions above.  If you choose to do this, keep in mind
that you will have <em/much less space/ available.

<enum>

<item>Calculate how much space you will have available for root files.

If you are building a single boot/root disk, you must fit all blocks for the
kernel plus all blocks for the root filesystem on the one disk.

<item>Using <tt/mke2fs/, create a root filesystem on a diskette of the
appropriate size.

<item>Populate the filesystem as described above.  

<item>When done, unmount the filesystem and transfer it to a disk file 
but <em/do not compress it/.

<item>Transfer the kernel to a floppy diskette, as described above.  When
calculating the ramdisk word, <bf/set bit 14 to zero/, to indicate that the
root filesystem is not to be loaded to ramdisk.  Run the <tt/rdev/'s as
described.<ncdx/rdev/<nidx/ramdisk word/

<item>Transfer the root filesystem as before.

</enum>

There are several shortcuts you can take.  If you are building a two-disk set,
you can build the complete root filesystem directly on the second disk and you
need not transfer it to a hard disk file and then back.  Also, if you are
building a single boot/root disk and using LILO, you can build a 
<em/single/ filesystem on the entire disk, containing the kernel, LILO files
and root files, and simply run LILO as the last step.


<sect1>Building a utility disk.<p>
<label id="utilitydisk">
<nidx/utility diskette/

Building a utility disk is relatively easy -- simply create a filesystem
on a formatted disk and copy files to it.  To use it with a bootdisk,
mount it manually after the system is booted.

In the instructions above, we mentioned that the utility disk could be
mounted as <tt>/usr</tt>.  In this case, binaries could be placed into a
<tt>/bin</tt> directory on your utility disk, so that placing
<file>/usr/bin</file> in your path will access them.  Additional libraries
needed by the binaries are placed in <tt>/lib</tt> on the utility disk.

There are several important points to keep in mind when designing a utility
disk:

<enum>

<item>Do not place critical system binaries or libraries onto the utility
disk, since it will not be mountable until after the system has booted.

<item>You cannot access a floppy diskette and a floppy tape drive
simultaneously.  This means that if you have a floppy tape drive, you will not
be able to access it while your utility disk is mounted.

<item>Access to files on the utility disk will be slow.

</enum>

Appendix <ref id="utilitylist" name="Sample utility disk directory listing">
shows a sample of files on a utility disk.  Here are some ideas for files you
may find useful: programs for examining and manipulating disks (<tt/format,
fdisk/) and filesystems (<tt/mke2fs, fsck, debugfs, isofs.o/), a lightweight text
editor (<tt/elvis, jove/), compression and archive utilities (<tt/gzip, tar,
cpio, afio/), tape utilities (<tt/mt, tob, taper/), communications utilities
(<tt/ppp.o, slip.o, minicom/) and utilities for devices (<tt/setserial,
mknod/).

<sect>How the pros do it.<p>
<label id="pros">

You may notice that the bootdisks used by major distributions such as
Slackware, RedHat or Debian seem more sophisticated than what is described
in this document.  Professional distribution bootdisks are based on the
same principles outlined here, but employ various tricks because their
bootdisks have additional requirements.  First, they must be able to work
with a wide variety of hardware, so they must be able to interact with the
user and load various device drivers.  Second, they must be prepared to
work with many different installation options, with varying degrees of
automation.  Finally, distribution bootdisks usually combine installation
and rescue capabilities.

<nidx/initial ramdisk (initrd)/

Some bootdisks use a feature called <bf/initrd/ (<bf/initial ramdisk/).
This feature was introduced around 2.0.x and allows a kernel to boot in two
phases.  When the kernel first boots, it loads an initial ramdisk image
from the boot disk.  This initial ramdisk is a root filesystem containing a
program that runs before the real root fs is loaded.  This program usually
inspects the environment and/or asks the user to select various boot
options, such as the device from which to load the real rootdisk.  It
typically loads additional modules not built in to the kernel.  When this
initial program exits, the kernel loads the real root image and booting
continues normally.  For further information on <tt/initrd/, see
<file>/usr/src/linux/Documentation/initrd.txt</file> and
<url url="ftp://elserv.ffm.fgan.de/pub/linux/loadlin-1.6/initrd-example.tgz">

The following are summaries of how each distribution's installation
disks seem to work, based on inspecting their filesystems and/or
source code.  We do not guarantee that this information is completely
accurate, or that they have not changed since the versions noted.

Slackware (v.3.1) uses a straightforward LILO boot similar to what is
described in section <ref id="usinglilo" name="Transferring the kernel with
LILO">.  The Slackware bootdisk prints a bootup message (``<tt/Welcome to the
Slackware Linux bootkernel disk!/'') using LILO's <tt/message/ parameter.
This instructs the user to enter a boot parameter line if necessary.  After
booting, a root filesystem is loaded from a second disk.  The user invokes a
<tt/setup/ script which starts the installation.  Instead of using a modular
kernel, Slackware provides many different kernels and depends upon the user to
select the one matching his or her hardware requirements.

RedHat (v.4.0) also uses a LILO boot.  It loads a compressed ramdisk on the
first disk, which runs a custom <tt/init/ program.  This program queries for
drivers then loads additional files from a supplemental disk if necessary.

Debian (v.1.3) is probably the most sophisticated of the installation disk
sets.  It uses the SYSLINUX loader to arrange various load options, then
uses an <tt><cdx/initrd/</tt> image to guide the user through installation.
It appears to use both a customized <tt/init/ and a customized shell.


<sect>Frequently asked question (FAQ) list.<p>

<bf>
Q. I boot from my boot/root disks and nothing happens. What do I do?
</bf><p>

See section <ref id="troubleshooting" name="Troubleshooting">, above.

<bf>Q. How does the Slackware/Debian/RedHat bootdisk work?
</bf><p>

See section <ref id="pros" name="What the pros do">, above.


<bf>Q. How can I make a boot disk with a XYZ driver?
</bf><p>

The easiest way is to obtain a Slackware kernel from your nearest 
Slackware mirror site. Slackware kernels are generic kernels which atttempt
to include drivers for as many devices as possible, so if you have a 
SCSI or IDE controller, chances are that a driver for it is included 
in the Slackware kernel.

Go to the <tt/a1/ directory and select either IDE or SCSI kernel depending on
the type of controller you have. Check the xxxxkern.cfg file for the selected
kernel to see the drivers which have been included in that kernel. If the
device you want is in that list, then the corresponding kernel should boot
your computer. Download the xxxxkern.tgz file and copy it to your boot
diskette as described above in the section on making boot disks.
<nidx/device drivers/

You must then check the root device in the kernel, using the rdev
command:
<verb>
	rdev zImage 
</verb>

<tt/rdev/ will then display the current root device in the kernel.  If this
is not the same as the root device you want, then use <tt/rdev/ to change
it.  For example, the kernel I tried was set to <file>/dev/sda2</file>, but
my root SCSI partition is <file>/dev/sda8</file>.  To use a root diskette,
you would have to use the command:

<verb>
	rdev zImage /dev/fd0
</verb>

If you want to know how to set up a Slackware root disk as well, that's
outside the scope of this HOWTO, so I suggest you check the Linux Install
Guide or get the Slackware distribution.  See the section in this HOWTO titled
``References''.

<bf>Q. How do I update my boot diskette with a new kernel?
</bf><p>
<nidx/kernel, updating/

Just copy the kernel to your boot diskette using the dd command for
a boot diskette without a filesystem, or the cp command for a
boot/root disk. Refer to the section in this HOWTO titled ``Boot''
for details on creating a boot disk. The description applies equally
to updating a kernel on a boot disk.

<bf>Q. How do I update my root diskette with new files?
</bf><p>
<nidx/root filesystems, updating/

The easiest way is to copy the filesystem from the rootdisk back to the DEVICE
you used (from section <ref id="creatingrootfs" name="Creating the
filesystem">, above).  Then mount the filesystem and make the changes.  You
have to remember where your root filesystem started and how many blocks it
occupied:

<verb>
	dd if=/dev/fd0 bs=1k skip=ROOTBEGIN count=BLOCKS | gunzip > DEVICE
	mount -t ext2 DEVICE /mnt
</verb>

After making the changes, proceed as before (in Section <ref id="wrappingitup"
name="Wrapping it up">) and transfer the root filesystem back to the disk.
You should not have to re-transfer the kernel or re-compute the ramdisk word
if you do not change the starting position of the new root filesystem.


<bf>Q. How do I remove LILO so that I can use DOS to boot again?
</bf><p>
<ncdx/LILO/
<nidx/Master Boot Record (MBR)/

This is not really a Bootdisk topic, but it is asked often.  Within Linux, you 
can run:

<tscreen><verb>
	/sbin/lilo -u
</verb></tscreen>

You can also use the <tt/dd/ command to copy the backup saved by LILO to the
boot sector.  Refer to the LILO documentation if you wish to do this.

Within DOS and Windows you can use the DOS command:
<tscreen><verb>
	FDISK /MBR
</verb></tscreen>

MBR stands for Master Boot Record, and it replaces the boot sector with a
clean DOS one, without affecting the partition table.  Some purists disagree
with this, but even the author of LILO, Werner Almesberger, suggests it.  It
is easy, and it works.



<bf>Q. How can I boot if I've lost my kernel <em/and/ my boot disk?
</bf><p>

If you don't have a boot disk standing by, probably the easiest method is to
obtain a Slackware kernel for your disk controller type (IDE or SCSI) as
described above for ``How do I make a boot disk with a XXX driver?''.  You can
then boot your computer using this kernel, then repair whatever damage there
is.

The kernel you get may not have the root device set to the disk type and
partition you want. For example, Slackware's generic SCSI kernel has the
root device set to <file>/dev/sda2</file>, whereas my root Linux partition
happens to be <file>/dev/sda8</file>.  In this case the root device in the
kernel will have to be changed.

You can still change the root device and ramdisk settings in the kernel
even if all you have is a kernel, and some other operating system,
such as DOS.

<tt/rdev/ changes kernel settings by changing the values at fixed offsets in
the kernel file, so you can do the same if you have a hex editor available on
whatever systems you do still have running -- for example, Norton
Utilities Disk Editor under DOS.  You then need to check and if necessary
change the values in the kernel at the following offsets:
<nidx/ramdisk word/<ncdx/rdev/

<tscreen><verb>
HEX     DEC  DESCRIPTION
0x01F8  504  Low byte of RAMDISK word
0x01F9	505  High byte of RAMDISK word
0x01FC  508  Root minor device number - see below
0X01FD  509  Root major device number - see below
</verb></tscreen>

The interpretation of the ramdisk word was described in Section <ref
id="ramdiskword" name="Setting the ramdisk word">, above.

The major and minor device numbers must be set to the device you want to mount
your root filesystem on. Some useful values to select from are:

<tscreen><verb>
DEVICE		MAJOR MINOR
/dev/fd0	    2     0   1st floppy drive
/dev/hda1	    3	  1   partition 1 on 1st IDE drive
/dev/sda1	    8     1   partition 1 on 1st SCSI drive
/dev/sda8	    8     8   partition 8 on 1st SCSI drive
</verb></tscreen>

Once you have set these values then you can write the file to a diskette using
either Norton Utilities Disk Editor, or a program called <tt/rawrite.exe/.
This program is included in all distributions.  It is a DOS program which
writes a file to the ``raw'' disk, starting at the boot sector, instead of
writing it to the file system.  If you use Norton Utilities you must write the
file to a physical disk starting at the beginning of the disk.

<bf>Q. How can I make extra copies of boot/root diskettes?
</bf><p>

Because magnetic media may deteriorate over time, you should keep several
copies of your rescue disk, in case the original is unreadable.

The easiest way of making copies of any diskettes, including bootable and
utility diskettes, is to use the <tt/dd/ command to copy the contents of the
original diskette to a file on your hard drive, and then use the same command
to copy the file back to a new diskette.  Note that you do not need to, and
should not, mount the diskettes, because <tt/dd/ uses the raw device
interface.

To copy the original, enter the command:
<tscreen><verb>
	dd if=DEVICENAME of=FILENAME
	where	DEVICENAME is the device name of the diskette drive
	and	FILENAME is the name of the (hard-disk) output file 
</verb></tscreen>

Omitting the <tt/count/ parameter causes dd to copy the whole diskette (2880
blocks if high-density).

To copy the resulting file back to a new diskette, insert the new
diskette and enter the reverse command:
<tscreen><verb>
	dd if=FILENAME of=DEVICENAME
</verb></tscreen>

Note that the above discussion assumes that you have only one diskette
drive. If you have two of the same type, you can copy diskettes using a
command like:

<tscreen><verb>
	dd if=/dev/fd0 of=/dev/fd1
</verb></tscreen>

<bf>Q. How can I boot without typing in "ahaxxxx=nn,nn,nn" every time?
</bf><p>
<nidx/kernel, parameters/

Where a disk device cannot be autodetected it is necessary to supply
the kernel with a command device parameter string, such as:
<tscreen><verb>
	aha152x=0x340,11,3,1
</verb></tscreen>
This parameter string can be supplied in several ways using LILO:

<itemize>

<item>By entering it on the command line every time the system is booted via
LILO.  This is boring, though.

<item>By using the LILO ``<tt/lock/'' keyword to make it store the 
command line as the default command line, so that LILO will use
the same options every time it boots.

<item>By using the <tt/append=/ statement in the LILO config file.  Note that
the parameter string must be enclosed in quotes.

</itemize>

For example, a sample command line using the above parameter string
would be:
<tscreen><verb>
	zImage	aha152x=0x340,11,3,1 root=/dev/sda1 lock
</verb></tscreen>

This would pass the device parameter string through, and also ask the
kernel to set the root device to <file>/dev/sda1</file> and save the whole
command line and reuse it for all future boots.

A sample APPEND statement is:
<tscreen><verb>
	APPEND = "aha152x=0x340,11,3,1"
</verb></tscreen>

Note that the parameter string must NOT be enclosed in quotes on the 
command line, but it MUST be enclosed in quotes in the APPEND statement.

Note also that for the parameter string to be acted on, the kernel must
contain the driver for that disk type.  If it does not, then there is nothing
listening for the parameter string, and you will have to rebuild the kernel to
include the required driver.  For details on rebuilding the kernel, cd to
<file>/usr/src/linux</file> and read the README, and read the Linux FAQ and
Installation HOWTO.  Alternatively you could obtain a generic kernel for the
disk type and install that.

Readers are strongly urged to read the LILO documentation before experimenting
with LILO installation.  Incautious use of the <tt/BOOT/ statement can damage
partitions.

<bf>Q. At boot time, I get error "<tt>A: cannot execute B</tt>". Why?
</bf><p>
<nidx/hardcoded locations/

There are several cases of program names being hardcoded in various utilities.
These cases do not occur everywhere, but they may explain why an executable
apparently cannot be found on your system even though you can see that it is
there.  You can find out if a given program has the name of another hardcoded
by using the <tt/strings/ command and piping the output through <tt/grep/.

Known examples of hardcoding are:
<itemize>

<item>Shutdown in some versions has <file>/etc/reboot</file> hardcoded, so
<tt>reboot</tt> must be placed in the <tt>/etc</tt> directory.

<item><tt/init/ has caused problems for at least one person, with the
kernel being unable to find <tt/init/.

</itemize>

To fix these problems, either move the programs to the correct directory,
or change configuration files (e.g. <tt/inittab/) to point to the correct
directory.  If in doubt, put programs in the same directories as they are
on your hard disk, and use the same <tt/inittab/ and <file>/etc/rc.d</file>
files as they appear on your hard disk.

<bf>Q. My kernel has ramdisk support, but initializes ramdisks of 0K
</bf><p>

Where this occurs, a kernel message like this will appear as the kernel is
booting: <nidx/ramdisk/

<verb>
	Ramdisk driver initialized : 16 ramdisks of 0K size
</verb>

This is probably because the size has been set to 0 by kernel parameters at
boot time.  This could possibly be because of an overlooked LILO configuration
file parameter:

<tscreen><verb>
ramdisk= 0
</verb></tscreen>

This was included in sample LILO configuration files in some older
distributions, and was put there to override any previous kernel setting.  If
you have such a line, remove it.

Note that if you attempt to use a ramdisk which has been set to 0K the
behaviour can be unpredictable, and can result in kernel panics.


<APPENDIX>

<sect>Resources and pointers<label id="references">.<p>

When retrieving a package, always get the latest version unless you have
good reasons for not doing so.

<sect1>Pre-made bootdisks.<p>
<label id="distbootdisks">

These are sources for distribution bootdisks.  <em>Please use one of
the mirror sites to reduce the load on these machines.</em>

<itemize>

<item> <url
url="http://metalab.unc.edu/pub/Linux/distributions/slackware/current/bootdsks.144/"
name="Slackware bootdisks">,
<url
url="http://metalab.unc.edu/pub/Linux/distributions/slackware/current/rootdsks/"
name="rootdisks"> 

and <url url="http://www.slackware.com/getslack/" name="Slackware mirror
sites">

<item> <url
url="http://metalab.unc.edu/pub/Linux/distributions/redhat/current/i386/images/"
name="RedHat bootdisks"> and <url
url="http://www.redhat.com/mirrors.html" name="Red Hat mirror sites">

<item> <url url="ftp://ftp.debian.org/pub/debian/dists/stable/main/disks-i386/current/"
name="Debian bootdisks"> and <url
url="ftp://ftp.debian.org/pub/debian/README.mirrors.html" name="Debian mirror
sites">

</itemize>

In addition to the distribution bootdisks, the following rescue disk
images are available.  Unless otherwise specified, these are available
in the directory 
<url url="http://metalab.unc.edu/pub/Linux/system/recovery/!INDEX.html">


<itemize>

<item><tt/tomsrtbt/, by Tom Oehser, is a single-disk boot/root disk based
on kernel 2.0, with a large set of features and support programs.  It
supports IDE, SCSI, tape, network adaptors, PCMCIA and more.  About 100
utility programs and tools are included for fixing and restoring disks.
The package also includes scripts for disassembling and reconstructing the
images so that new material can be added if necessary.<p>

<item><tt/rescue02/, by John Comyns, is a rescue disk based on kernel
1.3.84, with support for IDE and Adaptec 1542 and NCR53C7,8xx.  It uses ELF
binaries but it has enough commands so that it can be used on any system.
There are modules that can be loaded after booting for all other SCSI
cards.  It probably won't work on systems with 4 mb of ram since it uses a
3 mb ram disk.<p> 

<item><tt/resque&lowbar;disk-2.0.22/, by Sergei Viznyuk, is a
full-featured boot/root disk based on kernel 2.0.22 with built-in
support for IDE, many difference SCSI controllers, and ELF/AOUT.  Also
includes many modules and useful utilities for repairing and restoring
a hard disk.<p>

<item><tt/cramdisk/ images, based on the 2.0.23 kernel, available for
4 meg and 8 meg machines.  They include math emulation and networking
(PPP and dialin script, NE2000, 3C509), or support for the parallel
port ZIP drive.  These diskette images will boot on a 386 with 4MB RAM.
MSDOS support is included so you can download from the net to a DOS
partition.<p>
<url url="http://metalab.unc.edu/pub/Linux/system/recovery/images">


</itemize>

<sect1>Rescue packages.
<p>

Several packages for creating rescue disks are available on
metalab.unc.edu.  With these packages you specify a set of files for
inclusion and the software automates (to varying degrees) the creation of a
bootdisk.  See <url
url="http://metalab.unc.edu/pub/Linux/system/recovery/!INDEX.html"> for
more information.  <bf/Check the file dates carefully/ -- some of these
packages have not been updated in several years and will not support the
creation of a compressed root filesystem loaded into ramdisk.  To the best
of our knowledge, Yard is the only package that will.


<sect1>Graham Chapman's shell scripts<p>

Graham Chapman has written a set of scripts that may be useful as examples of
how to create bootdisks.  In previous versions of this HOWTO the scripts
appeared in an appendix, but they have been deleted from the documented and
placed on a web page:

<url url="http://www.zeta.org.au/&tilde;grahamc/linux.html">

You may find it convenient to use these scripts, but if so, read the
instructions carefully -- for example, if you specify the wrong swap device,
you will find your root filesystem has been throroughly and permanently
erased.  Be sure you have it correctly configured before you use it!


<sect1>LILO -- the Linux loader.<p>
<ncdx/LILO/

Written by Werner Almesberger.  Excellent boot loader, and the documentation
includes information on the boot sector contents and the early stages of the
boot process.

Ftp from <url url="ftp://tsx-11.mit.edu/pub/linux/packages/lilo/">.  It is
also available on Metalab and mirrors.

<sect1>Linux FAQ and HOWTOs.<p>

These are available from many sources.  Look at the usenet newsgroups
<tt/news.answers/ and <tt/comp.os.linux.announce/.

The FAQ is available from <url
url="http://metalab.unc.edu/pub/Linux/docs/faqs/linux-faq"> and the HOWTOs
from <url url="http://metalab.unc.edu/pub/Linux/docs/HOWTO">.

Most documentation for Linux may be found at <url name="The Linux
Documentation Project homepage" url="http://metalab.unc.edu/LDP/">.

If desperate, send mail to <tt/mail-server@rtfm.mit.edu/ with the word
``<tt/help/'' in the message, then follow the mailed instructions.


<sect1>Ramdisk usage.<p>
<nidx/ramdisk/

An excellent description of the how the new ramdisk code works may be found
with the documentation supplied with the Linux kernel.  See
<file>/usr/src/linux/Documentation/ramdisk.txt</file>.  It is written by Paul
Gortmaker and includes a section on creating a compressed ramdisk.


<sect1>The Linux boot process.<p>
<nidx/boot process/

For more detail on the Linux boot process, here are some pointers:

<itemize>

<item>The Linux System Administrators' Guide has a section on booting, See
<url url="http://metalab.unc.edu/LDP/LDP/sag/c1582.html">

<item>The LILO ``Technical overview'' <url
url="http://metalab.unc.edu/pub/Linux/system/boot/lilo/lilo-t-21.ps.gz">
has the definitive technical, low-level description of the boot
process, up to where the kernel is started.

<item>The source code is the ultimate guide.  Below are some kernel files
related to the boot process.  If you have the Linux kernel source code, you
can find these under <file>/usr/src/linux</file> on your machine;
alternatively, Shigio Yamaguchi (shigio@wafu.netgate.net) has a very nice
hypertext kernel browser at <url url="http://wafu.netgate.net/linux/">.
Here are some relevant files:
                                                                   
<descrip>

<tag>arch/i386/boot/bootsect.S,setup.S</tag> 
   Contain assembly code for the bootsector.

<tag>arch/i386/boot/compressed/misc.c</tag> 
   Contains code for uncompressing the kernel.

<tag>arch/i386/kernel/</tag>
   Directory containing kernel initialization code.  <tt/setup.c/ contains the
   ramdisk word.

<tag>drivers/block/rd.c</tag>
   Contains the ramdisk driver. The procedures <tt/rd&lowbar;load/ and
   <tt/rd&lowbar;load&lowbar;image/ load blocks from a device into a ramdisk.
   The procedure <tt/identify&lowbar;ramdisk&lowbar;image/ determines what
   kind of filesystem is found and whether it is compressed.

</descrip>

</itemize>


<sect>LILO boot error codes.<p>
<nidx/LILO, error codes/

Questions about these errors are asked so often on Usenet that we include
them here as a public service.  This summary is excerpted from Werner
Almsberger's LILO User Documentation, available at <url
url="http://metalab.unc.edu/pub/Linux/system/boot/lilo/lilo-u-21.ps.gz">.

When LILO loads itself, it displays the word ``<tt/LILO/''.  Each letter is
printed before or after performing some specific action.  If LILO fails at
some point, the letters printed so far can be used to identify the problem.

<descrip>

<tag>(nothing)</tag> 
    No part of LILO has been loaded.  LILO either isn't installed or the
    partition on which its boot sector is located isn't active.

<tag/L/   The first stage boot loader has been loaded and started, 
    but it can't load the second stage boot loader.  The two-digit error codes
    indicate the type of problem. (See also section ``Disk error codes''.)
    This condition usually indicates a media failure or a geometry mismatch
    (e.g. bad disk parameters)

<tag/LI/   The first stage boot loader was able to load the second stage boot 
    loader, but has failed to execute it. This can either be caused by a 
    geometry mismatch or by moving /boot/boot.b without running the map 
    installer. 

<tag/LIL/   The second stage boot loader has been started, but it can't load 
    the descriptor table from the map file. This is typically caused by a 
    media failure or by a geometry mismatch. 

<tag/LIL?/   The second stage boot loader has been loaded at an incorrect 
    address. This is typically caused by a subtle geometry mismatch or by
    moving <file>/boot/boot.b</file> without running the map installer.

<tag/LIL-/   The descriptor table is corrupt. This can either be caused by a 
    geometry mismatch or by moving /boot/map without running the map 
    installer. 

<tag/LILO/   All parts of LILO have been successfully loaded. 

</descrip>

If the BIOS signals an error when LILO is trying to load a boot image, the
respective error code is displayed.  These codes range from <tt/0x00/ through
<tt/0xbb/.  See the LILO User Guide for an explanation of these.


<sect>Sample rootdisk directory listings.<p>
<label id="listings">
<nidx/root filesystem/

Here are the contents of a sample root filesystem and a utility diskette.

<p>

<tscreen><verb>
Root directory:
drwx--x--x   2 root     root         1024 Nov  1 15:39 bin
drwx--x--x   2 root     root         4096 Nov  1 15:39 dev
drwx--x--x   3 root     root         1024 Nov  1 15:39 etc
drwx--x--x   4 root     root         1024 Nov  1 15:39 lib
drwx--x--x   5 root     root         1024 Nov  1 15:39 mnt
drwx--x--x   2 root     root         1024 Nov  1 15:39 proc
drwx--x--x   2 root     root         1024 Nov  1 15:39 root
drwx--x--x   2 root     root         1024 Nov  1 15:39 sbin
drwx--x--x   2 root     root         1024 Nov  1 15:39 tmp
drwx--x--x   7 root     root         1024 Nov  1 15:39 usr
drwx--x--x   5 root     root         1024 Nov  1 15:39 var

/bin:
-rwx--x--x   1 root     root        62660 Nov  1 15:39 ash
-rwx--x--x   1 root     root         9032 Nov  1 15:39 cat
-rwx--x--x   1 root     root        10276 Nov  1 15:39 chmod
-rwx--x--x   1 root     root         9592 Nov  1 15:39 chown
-rwx--x--x   1 root     root        23124 Nov  1 15:39 cp
-rwx--x--x   1 root     root        23028 Nov  1 15:39 date
-rwx--x--x   1 root     root        14052 Nov  1 15:39 dd
-rwx--x--x   1 root     root        14144 Nov  1 15:39 df
-rwx--x--x   1 root     root        69444 Nov  1 15:39 egrep
-rwx--x--x   1 root     root          395 Nov  1 15:39 false
-rwx--x--x   1 root     root        69444 Nov  1 15:39 fgrep
-rwx--x--x   1 root     root        69444 Nov  1 15:39 grep
-rwx--x--x   3 root     root        45436 Nov  1 15:39 gunzip
-rwx--x--x   3 root     root        45436 Nov  1 15:39 gzip
-rwx--x--x   1 root     root         8008 Nov  1 15:39 hostname
-rwx--x--x   1 root     root        12736 Nov  1 15:39 ln
-rws--x--x   1 root     root        15284 Nov  1 15:39 login
-rwx--x--x   1 root     root        29308 Nov  1 15:39 ls
-rwx--x--x   1 root     root         8268 Nov  1 15:39 mkdir
-rwx--x--x   1 root     root         8920 Nov  1 15:39 mknod
-rwx--x--x   1 root     root        24836 Nov  1 15:39 more
-rws--x--x   1 root     root        37640 Nov  1 15:39 mount
-rwx--x--x   1 root     root        12240 Nov  1 15:39 mt
-rwx--x--x   1 root     root        12932 Nov  1 15:39 mv
-r-x--x--x   1 root     root        12324 Nov  1 15:39 ps
-rwx--x--x   1 root     root         5388 Nov  1 15:39 pwd
-rwx--x--x   1 root     root        10092 Nov  1 15:39 rm
lrwxrwxrwx   1 root     root            3 Nov  1 15:39 sh -> ash
-rwx--x--x   1 root     root        25296 Nov  1 15:39 stty
-rws--x--x   1 root     root        12648 Nov  1 15:39 su
-rwx--x--x   1 root     root         4444 Nov  1 15:39 sync
-rwx--x--x   1 root     root       110668 Nov  1 15:39 tar
-rwx--x--x   1 root     root        19712 Nov  1 15:39 touch
-rwx--x--x   1 root     root          395 Nov  1 15:39 true
-rws--x--x   1 root     root        19084 Nov  1 15:39 umount
-rwx--x--x   1 root     root         5368 Nov  1 15:39 uname
-rwx--x--x   3 root     root        45436 Nov  1 15:39 zcat

/dev:
lrwxrwxrwx   1 root     root            6 Nov  1 15:39 cdrom -> cdu31a
brw-rw-r--   1 root     root      15,   0 May  5  1998 cdu31a
crw-------   1 root     root       4,   0 Nov  1 15:29 console
crw-rw-rw-   1 root     uucp       5,  64 Sep  9 19:46 cua0
crw-rw-rw-   1 root     uucp       5,  65 May  5  1998 cua1
crw-rw-rw-   1 root     uucp       5,  66 May  5  1998 cua2
crw-rw-rw-   1 root     uucp       5,  67 May  5  1998 cua3
brw-rw----   1 root     floppy     2,   0 Aug  8 13:54 fd0
brw-rw----   1 root     floppy     2,  36 Aug  8 13:54 fd0CompaQ
brw-rw----   1 root     floppy     2,  84 Aug  8 13:55 fd0D1040
brw-rw----   1 root     floppy     2,  88 Aug  8 13:55 fd0D1120
brw-rw----   1 root     floppy     2,  12 Aug  8 13:54 fd0D360
brw-rw----   1 root     floppy     2,  16 Aug  8 13:54 fd0D720
brw-rw----   1 root     floppy     2, 120 Aug  8 13:55 fd0D800
brw-rw----   1 root     floppy     2,  32 Aug  8 13:54 fd0E2880
brw-rw----   1 root     floppy     2, 104 Aug  8 13:55 fd0E3200
brw-rw----   1 root     floppy     2, 108 Aug  8 13:55 fd0E3520
brw-rw----   1 root     floppy     2, 112 Aug  8 13:55 fd0E3840
brw-rw----   1 root     floppy     2,  28 Aug  8 13:54 fd0H1440
brw-rw----   1 root     floppy     2, 124 Aug  8 13:55 fd0H1600
brw-rw----   1 root     floppy     2,  44 Aug  8 13:55 fd0H1680
brw-rw----   1 root     floppy     2,  60 Aug  8 13:55 fd0H1722
brw-rw----   1 root     floppy     2,  76 Aug  8 13:55 fd0H1743
brw-rw----   1 root     floppy     2,  96 Aug  8 13:55 fd0H1760
brw-rw----   1 root     floppy     2, 116 Aug  8 13:55 fd0H1840
brw-rw----   1 root     floppy     2, 100 Aug  8 13:55 fd0H1920
lrwxrwxrwx   1 root     root            7 Nov  1 15:39 fd0H360 -> fd0D360
lrwxrwxrwx   1 root     root            7 Nov  1 15:39 fd0H720 -> fd0D720
brw-rw----   1 root     floppy     2,  52 Aug  8 13:55 fd0H820
brw-rw----   1 root     floppy     2,  68 Aug  8 13:55 fd0H830
brw-rw----   1 root     floppy     2,   4 Aug  8 13:54 fd0d360
brw-rw----   1 root     floppy     2,   8 Aug  8 13:54 fd0h1200
brw-rw----   1 root     floppy     2,  40 Aug  8 13:54 fd0h1440
brw-rw----   1 root     floppy     2,  56 Aug  8 13:55 fd0h1476
brw-rw----   1 root     floppy     2,  72 Aug  8 13:55 fd0h1494
brw-rw----   1 root     floppy     2,  92 Aug  8 13:55 fd0h1600
brw-rw----   1 root     floppy     2,  20 Aug  8 13:54 fd0h360
brw-rw----   1 root     floppy     2,  48 Aug  8 13:55 fd0h410
brw-rw----   1 root     floppy     2,  64 Aug  8 13:55 fd0h420
brw-rw----   1 root     floppy     2,  24 Aug  8 13:54 fd0h720
brw-rw----   1 root     floppy     2,  80 Aug  8 13:55 fd0h880
brw-rw----   1 root     disk       3,   0 May  5  1998 hda
brw-rw----   1 root     disk       3,   1 May  5  1998 hda1
brw-rw----   1 root     disk       3,   2 May  5  1998 hda2
brw-rw----   1 root     disk       3,   3 May  5  1998 hda3
brw-rw----   1 root     disk       3,   4 May  5  1998 hda4
brw-rw----   1 root     disk       3,   5 May  5  1998 hda5
brw-rw----   1 root     disk       3,   6 May  5  1998 hda6
brw-rw----   1 root     disk       3,  64 May  5  1998 hdb
brw-rw----   1 root     disk       3,  65 May  5  1998 hdb1
brw-rw----   1 root     disk       3,  66 May  5  1998 hdb2
brw-rw----   1 root     disk       3,  67 May  5  1998 hdb3
brw-rw----   1 root     disk       3,  68 May  5  1998 hdb4
brw-rw----   1 root     disk       3,  69 May  5  1998 hdb5
brw-rw----   1 root     disk       3,  70 May  5  1998 hdb6
crw-r-----   1 root     kmem       1,   2 May  5  1998 kmem
crw-r-----   1 root     kmem       1,   1 May  5  1998 mem
lrwxrwxrwx   1 root     root           12 Nov  1 15:39 modem -> ../dev/ttyS1
lrwxrwxrwx   1 root     root           12 Nov  1 15:39 mouse -> ../dev/psaux
crw-rw-rw-   1 root     root       1,   3 May  5  1998 null
crwxrwxrwx   1 root     root      10,   1 Oct  5 20:22 psaux
brw-r-----   1 root     disk       1,   1 May  5  1998 ram
brw-rw----   1 root     disk       1,   0 May  5  1998 ram0
brw-rw----   1 root     disk       1,   1 May  5  1998 ram1
brw-rw----   1 root     disk       1,   2 May  5  1998 ram2
brw-rw----   1 root     disk       1,   3 May  5  1998 ram3
brw-rw----   1 root     disk       1,   4 May  5  1998 ram4
brw-rw----   1 root     disk       1,   5 May  5  1998 ram5
brw-rw----   1 root     disk       1,   6 May  5  1998 ram6
brw-rw----   1 root     disk       1,   7 May  5  1998 ram7
brw-rw----   1 root     disk       1,   8 May  5  1998 ram8
brw-rw----   1 root     disk       1,   9 May  5  1998 ram9
lrwxrwxrwx   1 root     root            4 Nov  1 15:39 ramdisk -> ram0
***  I have only included devices for the IDE partitions I use.
***  If you use SCSI, then use the /dev/sdXX devices instead.
crw-------   1 root     root       4,   0 May  5  1998 tty0
crw--w----   1 root     tty        4,   1 Nov  1 15:39 tty1
crw-------   1 root     root       4,   2 Nov  1 15:29 tty2
crw-------   1 root     root       4,   3 Nov  1 15:29 tty3
crw-------   1 root     root       4,   4 Nov  1 15:29 tty4
crw-------   1 root     root       4,   5 Nov  1 15:29 tty5
crw-------   1 root     root       4,   6 Nov  1 15:29 tty6
crw-------   1 root     root       4,   7 May  5  1998 tty7
crw-------   1 root     tty        4,   8 May  5  1998 tty8
crw-------   1 root     tty        4,   9 May  8 12:57 tty9
crw-rw-rw-   1 root     root       4,  65 Nov  1 12:17 ttyS1
crw-rw-rw-   1 root     root       1,   5 May  5  1998 zero

/etc:
-rw-------   1 root     root          164 Nov  1 15:39 conf.modules
-rw-------   1 root     root          668 Nov  1 15:39 fstab
-rw-------   1 root     root           71 Nov  1 15:39 gettydefs
-rw-------   1 root     root          389 Nov  1 15:39 group
-rw-------   1 root     root          413 Nov  1 15:39 inittab
-rw-------   1 root     root           65 Nov  1 15:39 issue
-rw-r--r--   1 root     root          746 Nov  1 15:39 ld.so.cache
***  ld.so.cache is created by ldconfig and caches library locations.
***  Many things break at boot time if ld.so.cache is missing.
***  You can either remake it after creating the bootdisk, or 
***  include ldconfig on the bootdisk and run it from an rc.x script
***  to update the cache.
-rw-------   1 root     root           32 Nov  1 15:39 motd
-rw-------   1 root     root          949 Nov  1 15:39 nsswitch.conf
drwx--x--x   2 root     root         1024 Nov  1 15:39 pam.d
-rw-------   1 root     root          139 Nov  1 15:39 passwd
-rw-------   1 root     root          516 Nov  1 15:39 profile
-rwx--x--x   1 root     root          387 Nov  1 15:39 rc
-rw-------   1 root     root           55 Nov  1 15:39 shells
-rw-------   1 root     root          774 Nov  1 15:39 termcap
-rw-------   1 root     root           78 Nov  1 15:39 ttytype
lrwxrwxrwx   1 root     root           15 Nov  1 15:39 utmp -> ../var/run/utmp
lrwxrwxrwx   1 root     root           15 Nov  1 15:39 wtmp -> ../var/log/wtmp

/etc/pam.d:
-rw-------   1 root     root          356 Nov  1 15:39 other

/lib:
*** I have an ELF system with glibc, so I need the ld-2.so loader.
-rwxr-xr-x   1 root     root        45415 Nov  1 15:39 ld-2.0.7.so
lrwxrwxrwx   1 root     root           11 Nov  1 15:39 ld-linux.so.2 -> ld-2.0.7.so
-rwxr-xr-x   1 root     root       731548 Nov  1 15:39 libc-2.0.7.so
lrwxrwxrwx   1 root     root           13 Nov  1 15:39 libc.so.6 -> libc-2.0.7.so
lrwxrwxrwx   1 root     root           17 Nov  1 15:39 libcom_err.so.2 -> libcom_err.so.2.0
-rwxr-xr-x   1 root     root         6209 Nov  1 15:39 libcom_err.so.2.0
-rwxr-xr-x   1 root     root       153881 Nov  1 15:39 libcrypt-2.0.7.so
lrwxrwxrwx   1 root     root           17 Nov  1 15:39 libcrypt.so.1 -> libcrypt-2.0.7.so
-rwxr-xr-x   1 root     root        12962 Nov  1 15:39 libdl-2.0.7.so
lrwxrwxrwx   1 root     root           14 Nov  1 15:39 libdl.so.2 -> libdl-2.0.7.so
lrwxrwxrwx   1 root     root           16 Nov  1 15:39 libext2fs.so.2 -> libext2fs.so.2.4
-rwxr-xr-x   1 root     root        81382 Nov  1 15:39 libext2fs.so.2.4
-rwxr-xr-x   1 root     root        25222 Nov  1 15:39 libnsl-2.0.7.so
lrwxrwxrwx   1 root     root           15 Nov  1 15:39 libnsl.so.1 -> libnsl-2.0.7.so
-rwx--x--x   1 root     root       178336 Nov  1 15:39 libnss_files-2.0.7.so
lrwxrwxrwx   1 root     root           21 Nov  1 15:39 libnss_files.so.1 -> libnss_files-2.0.7.so
lrwxrwxrwx   1 root     root           14 Nov  1 15:39 libpam.so.0 -> libpam.so.0.64
-rwxr-xr-x   1 root     root        26906 Nov  1 15:39 libpam.so.0.64
lrwxrwxrwx   1 root     root           19 Nov  1 15:39 libpam_misc.so.0 -> libpam_misc.so.0.64
-rwxr-xr-x   1 root     root         7086 Nov  1 15:39 libpam_misc.so.0.64
-r-xr-xr-x   1 root     root        35615 Nov  1 15:39 libproc.so.1.2.6
lrwxrwxrwx   1 root     root           15 Nov  1 15:39 libpwdb.so.0 -> libpwdb.so.0.54
-rw-r--r--   1 root     root       121899 Nov  1 15:39 libpwdb.so.0.54
lrwxrwxrwx   1 root     root           19 Nov  1 15:39 libtermcap.so.2 -> libtermcap.so.2.0.8
-rwxr-xr-x   1 root     root        12041 Nov  1 15:39 libtermcap.so.2.0.8
-rwxr-xr-x   1 root     root        12874 Nov  1 15:39 libutil-2.0.7.so
lrwxrwxrwx   1 root     root           16 Nov  1 15:39 libutil.so.1 -> libutil-2.0.7.so
lrwxrwxrwx   1 root     root           14 Nov  1 15:39 libuuid.so.1 -> libuuid.so.1.1
-rwxr-xr-x   1 root     root         8039 Nov  1 15:39 libuuid.so.1.1
drwx--x--x   3 root     root         1024 Nov  1 15:39 modules
drwx--x--x   2 root     root         1024 Nov  1 15:39 security

/lib/modules:
drwx--x--x   4 root     root         1024 Nov  1 15:39 2.0.35

/lib/modules/2.0.35:
drwx--x--x   2 root     root         1024 Nov  1 15:39 block
drwx--x--x   2 root     root         1024 Nov  1 15:39 cdrom

/lib/modules/2.0.35/block:
-rw-------   1 root     root         7156 Nov  1 15:39 loop.o

/lib/modules/2.0.35/cdrom:
-rw-------   1 root     root        24108 Nov  1 15:39 cdu31a.o

/lib/security:
-rwx--x--x   1 root     root         8771 Nov  1 15:39 pam_permit.so

***  Directory stubs for mounting
/mnt:
drwx--x--x   2 root     root         1024 Nov  1 15:39 SparQ
drwx--x--x   2 root     root         1024 Nov  1 15:39 cdrom
drwx--x--x   2 root     root         1024 Nov  1 15:39 floppy

/proc:

/root:
-rw-------   1 root     root          176 Nov  1 15:39 .bashrc
-rw-------   1 root     root          182 Nov  1 15:39 .cshrc
-rw-------   1 root     root           47 Nov  1 15:39 .glintrc
-rwx--x--x   1 root     root          455 Nov  1 15:39 .profile
-rw-------   1 root     root         4014 Nov  1 15:39 .tcshrc

/sbin:
-rwx--x--x   1 root     root        23976 Nov  1 15:39 depmod
-rwx--x--x   2 root     root       274600 Nov  1 15:39 e2fsck
-rwx--x--x   1 root     root        41268 Nov  1 15:39 fdisk
-rwx--x--x   1 root     root         9396 Nov  1 15:39 fsck
-rwx--x--x   2 root     root       274600 Nov  1 15:39 fsck.ext2
-rwx--x--x   1 root     root        29556 Nov  1 15:39 getty
-rwx--x--x   1 root     root         6620 Nov  1 15:39 halt
-rwx--x--x   1 root     root        23116 Nov  1 15:39 init
-rwx--x--x   1 root     root        25612 Nov  1 15:39 insmod
-rwx--x--x   1 root     root        10368 Nov  1 15:39 kerneld
-rwx--x--x   1 root     root       110400 Nov  1 15:39 ldconfig
-rwx--x--x   1 root     root         6108 Nov  1 15:39 lsmod
-rwx--x--x   2 root     root        17400 Nov  1 15:39 mke2fs
-rwx--x--x   1 root     root         4072 Nov  1 15:39 mkfs
-rwx--x--x   2 root     root        17400 Nov  1 15:39 mkfs.ext2
-rwx--x--x   1 root     root         5664 Nov  1 15:39 mkswap
-rwx--x--x   1 root     root        22032 Nov  1 15:39 modprobe
lrwxrwxrwx   1 root     root            4 Nov  1 15:39 reboot -> halt
-rwx--x--x   1 root     root         7492 Nov  1 15:39 rmmod
-rwx--x--x   1 root     root        12932 Nov  1 15:39 shutdown
lrwxrwxrwx   1 root     root            6 Nov  1 15:39 swapoff -> swapon
-rwx--x--x   1 root     root         5124 Nov  1 15:39 swapon
lrwxrwxrwx   1 root     root            4 Nov  1 15:39 telinit -> init
-rwx--x--x   1 root     root         6944 Nov  1 15:39 update

/tmp:

/usr:
drwx--x--x   2 root     root         1024 Nov  1 15:39 bin
drwx--x--x   2 root     root         1024 Nov  1 15:39 lib
drwx--x--x   3 root     root         1024 Nov  1 15:39 man
drwx--x--x   2 root     root         1024 Nov  1 15:39 sbin
drwx--x--x   3 root     root         1024 Nov  1 15:39 share
lrwxrwxrwx   1 root     root           10 Nov  1 15:39 tmp -> ../var/tmp

/usr/bin:
-rwx--x--x   1 root     root        37164 Nov  1 15:39 afio
-rwx--x--x   1 root     root         5044 Nov  1 15:39 chroot
-rwx--x--x   1 root     root        10656 Nov  1 15:39 cut
-rwx--x--x   1 root     root        63652 Nov  1 15:39 diff
-rwx--x--x   1 root     root        12972 Nov  1 15:39 du
-rwx--x--x   1 root     root        56552 Nov  1 15:39 find
-r-x--x--x   1 root     root         6280 Nov  1 15:39 free
-rwx--x--x   1 root     root         7680 Nov  1 15:39 head
-rwx--x--x   1 root     root         8504 Nov  1 15:39 id
-r-sr-xr-x   1 root     bin          4200 Nov  1 15:39 passwd
-rwx--x--x   1 root     root        14856 Nov  1 15:39 tail
-rwx--x--x   1 root     root        19008 Nov  1 15:39 tr
-rwx--x--x   1 root     root         7160 Nov  1 15:39 wc
-rwx--x--x   1 root     root         4412 Nov  1 15:39 whoami

/usr/lib:
lrwxrwxrwx   1 root     root           17 Nov  1 15:39 libncurses.so.4 -> libncurses.so.4.2
-rw-r--r--   1 root     root       260474 Nov  1 15:39 libncurses.so.4.2

/usr/sbin:
-r-x--x--x   1 root     root        13684 Nov  1 15:39 fuser
-rwx--x--x   1 root     root         3876 Nov  1 15:39 mklost+found

/usr/share:
drwx--x--x   4 root     root         1024 Nov  1 15:39 terminfo

/usr/share/terminfo:
drwx--x--x   2 root     root         1024 Nov  1 15:39 l
drwx--x--x   2 root     root         1024 Nov  1 15:39 v

/usr/share/terminfo/l:
-rw-------   1 root     root         1552 Nov  1 15:39 linux
-rw-------   1 root     root         1516 Nov  1 15:39 linux-m
-rw-------   1 root     root         1583 Nov  1 15:39 linux-nic

/usr/share/terminfo/v:
-rw-------   2 root     root         1143 Nov  1 15:39 vt100
-rw-------   2 root     root         1143 Nov  1 15:39 vt100-am

/var:
drwx--x--x   2 root     root         1024 Nov  1 15:39 log
drwx--x--x   2 root     root         1024 Nov  1 15:39 run
drwx--x--x   2 root     root         1024 Nov  1 15:39 tmp

/var/log:
-rw-------   1 root     root            0 Nov  1 15:39 wtmp

/var/run:
-rw-------   1 root     root            0 Nov  1 15:39 utmp

/var/tmp:

</verb></tscreen>

<sect>Sample utility disk directory listing.<p>
<label id="utilitylist">
<nidx/utility diskette/

<tscreen><verb>
total 579
-rwxr-xr-x   1 root     root        42333 Jul 28 19:05 cpio*
-rwxr-xr-x   1 root     root        32844 Aug 28 19:50 debugfs*
-rwxr-xr-x   1 root     root       103560 Jul 29 21:31 elvis*
-rwxr-xr-x   1 root     root        29536 Jul 28 19:04 fdisk*  
-rw-r--r--   1 root     root       128254 Jul 28 19:03 ftape.o
-rwxr-xr-x   1 root     root        17564 Jul 25 03:21 ftmt*  
-rwxr-xr-x   1 root     root        64161 Jul 29 20:47 grep*
-rwxr-xr-x   1 root     root        45309 Jul 29 20:48 gzip*
-rwxr-xr-x   1 root     root        23560 Jul 28 19:04 insmod*
-rwxr-xr-x   1 root     root          118 Jul 28 19:04 lsmod*
lrwxrwxrwx   1 root     root            5 Jul 28 19:04 mt -> mt-st*
-rwxr-xr-x   1 root     root         9573 Jul 28 19:03 mt-st*
lrwxrwxrwx   1 root     root            6 Jul 28 19:05 rmmod -> insmod*
-rwxr-xr-x   1 root     root       104085 Jul 28 19:05 tar*
lrwxrwxrwx   1 root     root            5 Jul 29 21:35 vi -> elvis*
</verb></tscreen>


</article>
