rraammddiisskk -- System Administration

Script to create a RAM-disk
/uussrr/bbiinn/rraammddiisskk

rraammddiisskk is a  script that creates a 500-kilobyte RAM  disk that is accessed
via device /ddeevv/rraamm00.

To use rraammddiisskk to create a RAM disk for you at boot-time, do the following:

11. Log in as the superuser rroooott.

22. Type:

       rm /dev/ram0

   This removes  the current  ram disk, should  one already be  loaded into
   memory.

33. Remake the ram disk as a smaller size device.  As an example, we'll make
   one that is 64 kilobytes.  Type the command:

       /etc/mknod /dev/ram0 b 8 1

   To break down this command:

   /eettcc/mmkknnoodd
        This is  the command  that creates a  special file (e.g.,  a block-
        special  file) through  which a  device  like a  printer or  RAM is
        accessed.

   /ddeevv/rraamm00
        The directory path and name of your RAM disk.

   bb    This  argument tells  mmkknnoodd to build  a block-special  file.  Every
        device like  a printer, floppy drive, COM port,  or RAM drives, are
        considered a ``block special file.''

   88    This is the major device  number for a RAM drive.  All major-device
        numbers are listed in the Lexicon entry for ``device drivers.''

   11    This is the  minor device number of your new  rraamm00. This shows that
        the rraamm00  you are building  will be 64  kilobytes in size.   If the
        minor  device number  would have  been `2', then  the size  of rraamm00
        would have been two times  64, or 128 kilobytes.  Each increment in
        the minor-device number is  equal to an additional 64 kilobytes for
        the RAM  device.  A minor  device of 16 multiplied  by 64 kilobytes
        would equal a one megabyte size RAM drive.

44. Next, make a file system in rraamm00:

       /etc/mkfs /dev/ram0 128

   The number  ``128'' is exactly  twice the memory  size, in this  case 64
   kilobytes.  Whatever size memory you choose to allocate to a RAM device,
   the block size  you specify in the mmkkffss command  will be double.  A one-
   megabyte RAM device for example would have 2,048 blocks.

55. Your new  RAM disk  is now  ready to be  mounted.  Typically,  you would
   mount ram0  in a directory named  ffaasstt or some other  unique name, so to
   mount, type;

       /etc/mkdir /fast
       /etc/mount /dev/ram0 /fast

   If /ffaasstt already exists, do not create it.

Once  you  have  created your  RAM  disk,  you  should  load commonly  used
utilities into it.

If you wish to create a  RAM disk automatically whenever you boot COHERENT,
un-comment and edit the appropriate lines in file /eettcc/rrcc.

_S_e_e _A_l_s_o
AAddmmiinniisstteerriinngg CCOOHHEERREENNTT, rraamm, rrcc

_N_o_t_e_s
This script only works in machines that have sufficient memory.
