
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.  It has
networking (telnet, rlogin, ftp, etc.) with the PPP driver and
the NE-2000 and 3C509 network board drivers. It can also mount
the DOS partition so you can download right from the net to your
hard disk.  The only requirement is that you have 8 MB of RAM
(since the file-system is a RAM-disk).  You can login as "guest".

You can write the "cramdisk.net" file to a floppy with the
command: "dd if=cramdisk.net of=/dev/fd0 bs=16b" or you can write
it with the "rawrite.exe" program (obtainable from a linux site
such as sunsite.unc.edu).

Networking

   In order to network from the cramdisk, you need to modify the
/etc/hosts, /etc/HOSTNAME, /etc/resolv.conf, and
/etc/rc.d/rc.inet1 files.  See the NET-2-HOWTO document (at
sunsite or mirrors) for more background on this.  To get the ppp
dialin scripts going (/usr/bin/ppp-on-com2, etc.) you need to
modify the chat-penn script and add a telephone number and your
login sequence.  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).

Ethernet connections

 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-com1", "ppp-on-com2", etc.
If you need to, you can modify these with the "pico" editor.
To turn off the ppp connection, run "ppp-off".


Mounting the DOS partition

Do:
    su
    mount_dos      (aliased to "mount -t msdos /dev/hda1 /usr/dos")

To unmount the DOS partition, do:
    su
    umount_dos

You can also mount a Linux partition file system with:

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


Mounting a remote NFS file system

Do:
   mount -t nfs -o 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

  NFS exports are controlled by /etc/exports.  Change this file
and reboot to effect a change.

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


ncftp

The "ncftp" command is included on the cramdisk because it is
very useful for downloading.  This is an automatic anonymous
login "ftp" that has lots of nice features.  For example, you
could type:

  ncftp ftp.pht.com:/pub/linux/sunsite/docs/howto/NET-2-HOWTO

and the file is transferred automatically to the current
directory.  Neat!

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-1.0" distribution, which is stored
in /usr/src.  

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
"/usr/src/README.cram.gz" (read it with "zless").


Happy networking...

Rob
