COHERENT manpages
This page displays the COHERENT manpage for ramdisk [Script to create a RAM-disk].
List of available manpages
Index
ramdisk -- System Administration
Script to create a RAM-disk
/usr/bin/ramdisk
ramdisk is a script that creates a 500-kilobyte RAM disk that is accessed
via device /dev/ram0.
To use ramdisk to create a RAM disk for you at boot-time, do the following:
1. Log in as the superuser root.
2. Type:
touch /dev/ram0close
This closes the RAM disk and removes it from memory.
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:
/etc/mknod
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.
/dev/ram0
The directory path and name of your RAM disk.
b This argument tells mknod 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 This is the major device number for a RAM drive. All major-device
numbers are listed in the Lexicon entry for ``device drivers.''
1 This is the minor device number of your new ram0. This shows that
the ram0 you are building will be 64 kilobytes in size. If the
minor device number would have been `2', then the size of ram0
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. Next, make a file system in ram0:
/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 mkfs command will be double. A one-
megabyte RAM device for example would have 2,048 blocks.
5. Your new RAM disk is now ready to be mounted. Typically, you would
mount ram0 in a directory named fast or some other unique name, so to
mount, type;
/etc/mkdir /fast
/etc/mount /dev/ram0 /fast
If /fast 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 /etc/rc.
See Also
Administering COHERENT,
ram,
rc
Notes
This script only works in machines that have sufficient memory.



