RAM Disk: troubleshooting
Solutions to common problems with RAM Disk on Windows. For how it works and what each setting does, see the RAM Disk manual.
Files stay on the RAM disk after a shutdown
A RAM disk without an image file is meant to be empty after every shutdown or restart. If files are still there after you shut down, Windows’ hybrid boot, also called Fast Startup, is the cause. With it, shutting down saves the state of the system, RAM disks included, to the hard disk, and starting up restores it. A restart is not affected.
Hybrid boot can also make a RAM disk with an image file slow to mount or save, so we recommend turning it off. The RAM Disk installer offers this as Disable Windows Hybrid Boot (recommended) when hybrid boot is on. To turn it off yourself, open a command prompt as administrator and type:
REG ADD "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Power" /V HiberbootEnabled /T REG_DWORD /D 0 /F
If you do not use hibernation, you can turn hibernation off instead, which also turns off hybrid boot and frees the disk space its file takes:
powercfg /h off
To clear the RAM disk just once, shut down fully with this command:
shutdown /s
Saving is slow, or “the process cannot access the file”
If a RAM disk takes a long time to mount, unmount or save to its image, or shows “Win32 error code = 32. The process cannot access the file because it is being used by another process”, another program is opening the image file at the same time. This is usually antivirus or other security software, checking the file as it is written. Exclude the folder of your RAM disk images from its scanning.
Hybrid boot can cause the same, so check that it is turned off as described above.
Backup software using Shadow Copy fails
Many backup programs use Windows’ Volume Shadow Copy Service (VSS). With a RAM disk present, they may fail to complete a backup, because the service treats the RAM disk as a regular volume and runs into an error with it. Either:
- exclude the RAM disk’s drive from the backup; or
- tick Hard Disk Emulation (slower) in the RAM disk’s properties, so that it appears as a complete hard drive with partitions, which VSS can handle. The option is not available for disks that use a VHD image.
Still have questions? Drop us a line.