Home > Commands N-Z > Configuration R

RAMDRIVE.SYS


Description | Syntax | Parameters | Switches | Related | Notes | Examples | Errorlevels | Availability

Uses part of your computer's random-access memory (RAM) to simulate a hard disk drive. This device driver must be loaded by a DEVICE or DEVICEHIGH command in your CONFIG.SYS file.

RAM drives are much faster than hard disk drives because your computer can read information faster from memory than from a hard disk. A RAM drive appears to be a normal hard disk drive; you can use it just as you would any hard disk drive. The most important difference between a real disk drive and a RAM drive is that because it exists only in memory, information on a RAM drive is lost when you turn off or restart your computer. You can set up as many RAM drives as you want, up to the amount of memory your computer has. To do this, add one RAMDRIVE.SYS line to your CONFIG.SYS file for each additional RAM drive you want.


Syntax

DEVICE=[drive:][\path\]RAMDRIVE.SYS [Disk_size Sector_size [Num_entries]]] [/A | /E]


Parameters
Disk_size (v3.0)
Specifies how many kilobytes of memory you want to use for the RAM drive. If you don't specify an amount, RAMDrive will create a 64K RAM drive. You can specify a value from 4 to 32767. However, you cannot specify more memory than your system has available.
[drive:][\path\] (v3.0)
Specifies the location of the RAMDRIVE.SYS file.
Num_entries (v3.0)
Limits the number of files and directories you can create in the RAM drive's root directory. The limit can be from 2 to 1024 entries; the limit you specify is rounded up to the nearest sector size boundary. If you do not specify a limit, you can create up to 64 entries in the RAM drive's root directory. (If you include a value for Num_entries, you must also include values for Disk_size and Sector_size.)
If there is not enough memory to create the RAM drive as specified, RAMDrive will try to create it with a limit of 16 directory entries. This may result in a RAM drive with a different limit from the one you specified.
Sector_size (v3.0)
Specifies the disk sector size in bytes. The size can be 128, 256, or 512 bytes. (If you include a Sector_size value, you must also include a value for Disk_size.)
Generally, you should use the default sector size of 512 bytes.

Switches
/A (v3.0)
Creates the RAM drive in expanded memory.
For RAMDrive to use expanded memory, your system must be configured so that it provides expanded memory, and the DEVICE command for the expanded-memory manager (such as EMM386.EXE, 386MAX, CEMM, or QEMM) must appear in your CONFIG.SYS file before DEVICE command for RAMDRIVE.SYS.
/E (v3.0)
Creates the RAM drive in extended memory.
For RAMDrive to use extended memory, your system must be configured so that it provides extended memory, and a DEVICE command for the extended-memory manager (HIMEM.SYS) must appear in your CONFIG.SYS file before the DEVICE command for RAMDRIVE.SYS. In general, it is best to create a RAM drive in extended memory if your system has extended memory.

Related

none.


Notes
Using conventional memory

Although specifying a memory type is optional, it is strongly recommended. If you omit both the /A and /E switches, RAMDRIVE.SYS uses your system's conventional memory. It is not a good idea to use conventional memory for a RAM drive, because this reduces available work space for programs. However, if you don't have extended memory, expanded memory, or a hard disk drive, you might want to use conventional memory for a RAM drive. A RAM drive can increase the speed of a floppy disk system significantly enough that it may be worth the loss of some conventional memory.


Using extended memory

If your system has extended memory installed (starting at the 1-megabyte boundary), you can use this extended memory for one or more RAM drives. For RAMDRIVE.SYS to use extended memory, you must first install HIMEM.SYS or another extended-memory manager that conforms to the Lotus/Intel/Microsoft/AST eXtended Memory Specification (XMS). In your CONFIG.SYS file, the DEVICE command that installs the XMS extended-memory manager must precede the commands that install the RAM drive.


Using expanded memory

For RAMDRIVE.SYS to use expanded memory, you must configure your system so that it provides expanded memory. In your CONFIG.SYS file, the DEVICE command that installs the expanded-memory manager (EMM386.EXE) must precede the DEVICE command that installs RAMDRIVE.SYS. The expanded-memory manager must conform to the Lotus/Intel/Microsoft Expanded Memory Specification (LIM EMS).


Increasing the efficiency of a RAM drive

For the best results with a RAM drive, you can define a %TEMP% environment variable and set it to a directory on the RAM drive. If you use Windows, be sure the RAM drive is at least 2 MB in size; otherwise, there might not be enough space to create temporary files for printing.


Compressing a RAMDrive

To compress a RAMDrive, use the DRVSPACE /CREATE command. Although it is possible to compress a RAMDrive by using the DRVSPACE /COMPRESS command, it is not recommended. Due to the inherent volatility of a RAMDrive, DriveSpace's automatic recovery mechanisms cannot work on a RAMDrive.

If you compress your RAMDrive, make sure the DEVICE command for RAMDRIVE.SYS appears in your CONFIG.SYS file before the DEVICE command for DRVSPACE.SYS Otherwise, the compressed RAMDrive will not be automatically mounted when your computer starts.


Examples

To create a RAM drive in extended memory and allocate 64K (the default amount) of extended memory to RAMDRIVE.SYS, add to your CONFIG.SYS file:

    DEVICE=C:\DOS\RAMDRIVE.SYS /E

This command loads RAMDRIVE.SYS from the C:\DOS directory.


Suppose you want to install RAMDRIVE.SYS in expanded memory and allocate 4 MB (4096K) of expanded memory to the RAM drive. To do this and to specify that RAMDRIVE.SYS is located in the DOS directory on drive C, add to your CONFIG.SYS file:

    DEVICE=C:\DOS\RAMDRIVE.SYS 4096 /A

Now suppose you want to allocate 2048K of extended memory to RAMDRIVE.SYS and create a RAM drive that has 512-byte sectors and a limit of 1024 entries in its root directory. To do this and to specify that RAMDRIVE.SYS is located in the DEVICES directory on drive D, add to your CONFIG.SYS file:

    DEVICE=D:\DEVICES\RAMDRIVE.SYS 2048 512 1024 /E

Errorlevels

none.


Availability
External
DOS
v3.0 v3.20 v3.05 v3.1 v3.21 v3.25 v3.30 v3.3A v3.3R v3.3T v3.31 v3.40 v4.0 v4.01 v4.01A v5.0 v5.0A v5.00.02 v5.001A v5.01 v5.02 v6.0 v6.10 v6.2 v6.21 v6.22 v6.23 v7.00 v7.0R1 v7.10 v8.00
Windows
none
Windows NT
none