
Networkers,

Here's a treat.  A one-floppy Linux system that boots on 3/4/586
machines and doesn't require any space on a hard disk.  The "net"
disk has networking (rlogin, ftp, etc.) with the PPP driver and
the 3c509 and NE-2000 network board drivers. The "ppa" disk has a
driver for the Iomega parallel port ZIP drive. When the cramdisk
boots, it mounts /dev/hda1 if it is a DOS or Linux partition so
you can download right from the net to your hard disk.  The
"mtools" series of Linux-DOS commands are included so you can
read/write and format a DOS floppy conveniently. The only
requirement is that you have 4 MB of RAM (since the file-system
is a RAM-disk).  You can login as "guest" or "root".

To run the one-floppy Linux system, write the "cramdisk.net" or
"cramdisk.ppa" files to a floppy with the Linux command: "dd
if=cramdisk.net of=/dev/fd0 bs=16b" or under DOS you can use the
"rawrite.exe" program (obtainable from a linux site such as
sunsite.unc.edu:/pub/Linux/system/Install/rawwrite).

1) Networking

In order to network to ethernet from cramdisk.net, you need to
modify the /etc/hosts, /etc/HOSTNAME, /etc/resolv.conf, and
/etc/rc.d/rc.inet1 files.  The script "netcfg" can help you do
this. See the NET-2-HOWTO document (at sunsite or mirrors) for
more background on these files.  To get the ppp dialin scripts
going (/usr/bin/ppp-on-com, etc.) you need to modify the
chat-univ script and add a telephone number and your login
sequence. Two configure scripts are included to help you setup
your PPP scripts (see below).  Once you do that, the generic
script will work with many university logins.  To make these
changes permanent, you need to modify the cramdisk on the floppy
(see the instructions below).

2) Ethernet connections

 The cramdisk.net image contains NE2000 and 3c509 drivers which
should automatically recognize ethernet cards at boot time. If
you're connected by ethernet to another machine running Linux,
the cramdisk can run programs remotely with NFS (Network File
System), so for example you could run X-Windows remotely.  Also,
you can export your own filesystem, which can include your DOS
partition, so (if you turn on this feature) you can NFS your DOS
partition with remote machines (even through the PPP modem
connection).

PPP connections

 To connect through a modem to a remote machine, there are
several scripts in /usr/bin, "ppp-on-com", "ppp-linux", etc.
You can copy them, modify them and rename them as desired.
To turn off the ppp connection, run "ppp-off".

Two scripts are included to help you to modify the ppp commands.
"ppp-config" creates a standard university dialin script that
will dialin to a phone number that you specify, and will give a
userid and password that you specify.  It expects to see "Network
ID:" before entering your user id, "password:" before entering
your password, and "annex:" before entering ppp to start the PPP
daemon on the remote end.  

The "ppp-linux-conf" script creates a "Linux-PPP" dialin that
sets up a PPP link to another Linux machine connected to the net.
For this one you specify the phone number, your login information
and the host address and your machine's IP address.  You can run
the "ppp-config" and "ppp-linux-conf" scripts at "run-time" (i.e.
when you're running the cramdisk in memory) or you can read the
cramdisk file system onto a partition and run the config scripts
for a permanent change. 

 If you would like to add the new scripts to /usr/bin, you should
"su; cd /usr/bin" before running the config scripts.  Otherwise,
the new PPP scripts will be created in the current directory.
Either works OK.  There are also template PPP scripts in /usr/bin
equivalent to the ones created by the configure scripts.

Using the Hard Disk partition

The DOS partition is automatically mounted at boot-time if it
is /dev/hda1.  You can access it under the /dos directory.

A Linux partition is also automatically mounted at boot-time if
it is /dev/hda1.  Otherwise you can mount it with:

   mount -t ext2 /dev/hda? /hd     (mounts a Linux partition)


Mounting a remote NFS file system

Do:
   mount -t nfs -o timeo=10,bg,soft,ro  remote_mach:/dir? /dir?  

   where 
      ro   = "read-only",  (rw) = read-write
      remote_mach = remote machine name (e.g.  "linuxftp.caltech.edu") 
      dir?  any directory that is NFS exported (see "/etc/exports").

  Note that both remote_mach:/dir? and /dir? must both exist
before the mount can proceed.  The previous contents of the local
/dir?  disappear, and are replaced with the contents of the
remote /dir? (the old contents come back when the remote dir is
unmounted).  Of course the remote and local directories can have
different names, though it usually reduces confusion if they're
named the same or similar.  To remote mount a directory, the
remote machine must have "NFS exported" it. Look with the
showmount command:

   /usr/sbin/showmount -e remote_machine
                          (either text or number address)

Note that NFS is slower than ftp, i.e. if you merely want to
transfer a file or look at a directory once, "ftp" may be about
twice as fast.  This is very important over a modem connection,
but NFS is fast enough to be used extensively over Ethernet
connections.

Swap space

You can increase the amount of virtual memory available by making
a swap file (or even better, a swap partition) on the hard drive.
This would be necessary, for example if you were going to run
many local processes or have several logins.

The swap file can be on the DOS partition, and in fact can be the
DOS Windows swap file.  You can make a swap file with:

   dd if=/dev/zero of=swapfile bs=1024 count=8192     (makes 8MB swap file)
   mkswap swapfile 8192                        (makes valid Linux swapfile)
   sync                                        (resets file system)
   swapon swapfile                             (adds space to virtual memory)

Note that the "regular" file must exist before running "mkswap"
on it, and that the file must not contain any "holes" (so using
'cp' to make the file is not acceptable).  If you make a swap
partition, or if the file already exists you can skip the "dd" step.
Note that to use the DOS swapfile you need to mount the DOS
partition before you run "mkswap".

Cramdisk modifications

Since the "cramdisk" is stored on a floppy and is read into RAM
each time you boot, the filesystem is effectively "cast in
stone". The kernel sits on the first quarter of the disk, and the
compressed file system fills the rest of the disk.  The disk was
constructed with the "cramdisk-2.0" distribution, which is
included along with this distribution.

You can copy the file system from the disk and make a copy on the
hard disk, and then modify it, and write it back to the floppy
with the "cramdisk" distribution.  See the file "README.howto".

Happy networking...

Rob
