Image files

An image file is a regular file that contains an image of a disk.

Usually, RAM disks are volatile and used precisely because they erase all their contents after the computer is turned off. However, some users require the contents of a RAM disk to be kept. In this case, an image file can be used for saving the contents of a RAM disk before the computer is turned off, and restoring the contents back to the RAM disk when it is turned on next time.

The RAM Disk software uses its own format for image files. These image files can either be mounted as regular disks for copying files onto them, or serve as a base for RAM disks. A RAM disk can also be based on a disk image in the operating system's own format.

When stored on a supported storage medium, an image file is kept as a sparse file. For storage efficiency, this means that even a multi-gigabyte image only occupies as much disk space as its actual contents require. When used with dynamically allocated and TRIM-enabled RAM disks, deleting files from the RAM disk creates sparse holes in the image, further reducing the space occupied on the storage medium.

To begin working with an image file, you need to create it first by choosing Image – Create Image from the main menu. Specify the name of the image file with the full path to its location, and the size. This size should not exceed the amount of RAM that you can dedicate to a RAM disk, because the size of the image determines the size of the RAM disk based on this image. If you are planning to use hard disk emulation, select the Hard Disk image type; otherwise leave it as Volume. Optionally choose the file system and specify the volume label:

RAM Disk - Create Image window

The image file is now ready to be used as a base for a RAM disk: choose Disk – Add and specify it as the image file. See adding a RAM disk for details.

Optionally, you can mount the image first by choosing Image – Mount Image, to copy files onto it beforehand or to format an image that was created without a file system:

RAM Disk - Mount Image window

Use Windows Explorer or other tools to format the disk (disk A:\ in this example) and copy whatever files you would like to store in the image. Once you have finished, unmount the image: choose Image – Mounted Images from the main menu, select the image and click Unmount:

RAM Disk - Mounted Images window

Disk images of the operating system

A RAM disk can also be based on a disk image in the operating system's own format, which the system and other software can open when RAM Disk is not using it: a VHD or VHDX file on Windows, a read/write DMG on macOS, or a raw image on Linux. Specify the file as the image when adding a RAM disk. It is loaded into memory and saved back like RAM Disk's own images.

To create one, choose Image – Create Image and select the system's file type: *.vhdx, *.dmg or *.raw. To copy an existing RAM disk to one, right-click the disk and choose Save As. On Windows a new file is always a dynamically expanding VHDX of up to 2 TB.

  • The file must hold a single partition, or a file system with no partition table.
  • Mount Image accepts RAM Disk's own images only. Do not attach or open the file elsewhere while a RAM disk is using it.
  • Windows: differencing disks, VHDX files with 4096-byte sectors and hard disk emulation are not supported. A VHDX that was not detached cleanly must be attached and detached in Windows once.
  • macOS: compressed, read-only, sparse and encrypted images are not supported. Convert them to read/write in Disk Utility first.
  • Linux: virtual machine formats such as qcow2 and VMDK are not supported. Convert them with qemu-img convert -O raw first.
  • Enlarging has limits of its own, see resizing a disk.