TechJunkie is a BOX20 Media Company

Home PC Windows How to Create a 4GB/s RAM Disk in Mac OS X

How to Create a 4GB/s RAM Disk in Mac OS X

How to Create a 4GB/s RAM Disk in Mac OS X

RAM Disks, as the name indicates, are logical storage volumes created using a computer’s memory (RAM) instead of a traditional hard drive or solid state drive. The benefits are easy to understand: RAM operates at speeds far beyond current hard drive technology. But there’s also a major negative: data stored in RAM is not persistent, meaning that it is erased when the RAM loses power due to a reboot, shutdown, or power loss.
Despite this drawback, there are still several situations that can greatly benefit from the speed of a RAM Disk, including using it as a Photoshop scratch area, manipulating large video files, or testing complicated databases. If you’ve got good backups of your data and you’re willing to risk losing the contents of a RAM Disk in the event of a power failure, setting one up is easy and fun. Here’s how.

How Big Should a RAM Disk Be?

The methods for creating RAM Disks, outlined below, will allow you to create a volume of any size. You’ll want to be careful to leave enough RAM available to run your Mac, however; if you use most or all of your RAM for a RAM Disk, the system will begin paging aggressively to the hard drive and overall system performance will plummet.
Therefore, make sure to choose a good ratio between your needs and your overall system memory. In general, it’s wise to keep your RAM Disk at or below 50 percent of your total physical memory. On a Mac with 16 GB of RAM, for example, don’t make your RAM Disk bigger than 8 GB.
Your choice will also depend on what applications you need to run while the RAM Disk is mounted. If you’re doing heavy Photoshop work, for example, you’ll want to leave more memory available for the app. On the other hand, if you’re just muxing video and audio files you can choose a RAM Disk a bit higher than 50 percent of your total memory.
Play around with the tools and techniques below to determine the best choice for your Mac and your needs. Now, it’s time to create the Disk itself. In OS X, there are two primary methods of creating a RAM Disk: the Terminal or an app.

Creating a RAM Disk via Terminal

Open the Terminal app from Applications > Utilities and enter the following command:

diskutil erasevolume HFS+ 'RAM Disk' `hdiutil attach -nomount ram://XXXXX`

Replace the X characters with a number that represents the block size for the total capacity of your RAM Disk. Calculate this number by multiplying your desired size of disk in megabytes by 2048. In our example, we’ll create a 4 GB RAM Disk, which requires a number of 8388608 (4096 * 2048). Input this number in place of the X characters in the command above:

diskutil erasevolume HFS+ 'RAM Disk' `hdiutil attach -nomount ram://8388608`

OS X RAM Disk Terminal
You can also change the “Ram Disk” name inside the double quotes to another name you prefer. Once you’ve configured the command, press Return to launch it. After a brief moment, the system will create and mount your RAM Disk. You can now read and write to it as you would with any other drive, as long as you remember that any data stored on the disk will be lost after a reboot or power loss.

Creating a RAM Disk with a Third Party App

For an even easier method, you can use a third party app to create a RAM Disk. There are several apps that perform this function, but we’ll use RAM Disk Creator from programmer Florian Bogner.
Download the app and launch it on your Mac. It will ask you two questions: the desired size of your RAM Disk (in bytes, kilobytes, megabytes, or gigabytes) and the name you’d like to assign the disk. We’ll use an 8 GB disk with the unimaginative name “RAM Disk.”
RAM Disk Creator
Once you’ve made your choices, simply press “Create RAM Disk” and the disk will mount to your desktop.
With both methods, you can get rid of the RAM Disk by ejecting it or rebooting. Again, make sure that all data on the disk is backed up before doing this; the data will be irrevocably lost once you reboot or lose power.


The speed of RAM Disks will vary based on the performance level of your Mac’s RAM, but will still outperform traditional HDDs and SSDs by a wide margin. Here’s a performance comparison using a 16 GB RAM Disk on a 2011 27-inch 3.4GHz i7 iMac with a 240GB OWC Mercury Pro 6G SSD.
OS X RAM Disk Benchmark
The OWC SSD can achieve 490MB/s writes and 540MB/s reads, numbers that by normal standards are exceptional. When compared to the performance of a RAM Disk, however, the SSD’s performance isn’t worth a second look. The RAM Disk peaks at about 4.2 gigabytes per second in both reads and writes, and averages about 3.5GB/s throughout the transfer sizes. For disk-intensive tasks, this performance can be a game changer.


As you can see, RAM Disks can offer power users an amazing level of performance, but it cannot be stressed enough the dangers of using volatile memory for data storage. As long as you keep good backups and save your work to a standard hard drive frequently, however, many users may find that the benefits of RAM Disks far outweigh the risks.

How and Why to Use Private Browsing in iOS

Read Next 

16 thoughts on “How to Create a 4GB/s RAM Disk in Mac OS X”

sean says:
I symlinked cache folder to the ram drive which works, btw it only consume a few hundreds megabyte max. out of 4gb ram disk (i have 16gb ram).
I want to utilize almost of ram disk. should I copy the app to the ram disk?
ma non si capisce un cazzo come cazzo spieghi diooo
Dom says:
Thanks for these clear and precise instructions. I’m still a bit confused; does this increase the amount of RAM you have or is this an additional drive?
Daniel says:
It reduces the amount of workable RAM you have by using some to create an additional drive.
Andre Tenenbaum says:
Hi I am looking into a way to expand my Mac Mini and iMac (new ones with soldered RAM from fabric). it is possible to use a SD card as a RAM Disk? This could be great on my new 4g Mac Mini as it has fixed RAM or on my iMac with fixed 16RAM. It is possible? Best
B. Jefferson Le Blanc says:
No. But you could use an SD card as you would a RAM disk, supposing you know how to direct the application cache files you would use in the RAM disk. Still, this would not match the performance of a RAM disk. On the other hand, there would be no risk of data loss as there is with a RAM disk.
Pingback: Apple:Adding external ram to 2014 MacBook Pro – Apple Questions
Pingback: How to SWEB on your Mac with OS X | GhostLyrics' Journal
Pingback: Testing Drupal 8 in a RAM disk | easytech blog
Amaury Salas says:
What if I want to create a RAMDisk on a USB with more GB than my MacBook RAM?
TekRevue says:
RAM is different from the flash storage on a USB drive. You can just use the USB drive for extra storage; trying to make it a RAM disk is not helpful because it’s significantly slower than RAM, which defeats the purpose.
Amaury Salas says:
I suppose this applies to external drives too. For example, if I get a 2 TB external drive it would depend on the write/read speed? Or would it be useless as a flash drive.
Thank you very much, I`m new at this and I have a lot of questions (:
alex says:
But how and what are you moving to the RamDisk in order to get those speeds? Benchmark app saves the files temporary in a folder for testing on the SSD/HDD. Would be nice if you could show what to move to the RamDisk, or if I’m way off :P Thanks.
Andrei says:
ok, I create a second ram memo on hdd and now what? how can I use it? tks!
Pingback: Audirvana+ 1.6 wish list - Page 11
Ivan X says:
One place this tip is really useful for is when booted in the Recovery HD of OS X when you want to use some additional utility that’s on the web and you don’t have any writeable media handy. Because all the default filesystems are read-only, you have no place to temporarily save anything. The RAM disk does the trick. Thanks for the tip.
anon123 says:
Also, why multiple the desired size of disk (in megabytes) by 2048?
Surely it should by 1024 ?
TekRevue says:
It’s not exact, but multiplying by 2048 is an easy way to roughly convert block size to megabytes.
anon123 says:
fair enough, no prob.
anon123 says:
does this work with Time Machine as a backup solution?
TekRevue says:
No, Time Machine cannot use a RAM disk, nor would you want to as the contents would not be safe from a power outage or reboot.
anon123 says:
I setup a RAM disk as per above instructions and everything went smoothly.
Time Machine however doesn’t backup the contents of the Ram Disk, neither does if show up in the list of volumes for Time Machine to include/ignore. Ah well.
alex kent says:
I don’t think using a RAM disk for the Photoshop scratch disk is a good idea anymore.
Back when Photoshop was 32bit and limited to using <4GB RAM for the main app, it was interesting to setup a RAM disk for scratch, then when Photoshop ran out of main app memory, it started paging to scratch disk… but that disk was just more RAM so the paging performance hit was held off for a bit longer.
But now Photoshop is 64bit it'll happily eat up all of your RAM without any help from a RAM disk. I see no value in using a RAM disk for Ps now.
TekRevue says:
That’s a good point, Alex.
kcwookie says:
Ram Disks were the strength of the Amiga platform back in the day. Amiga created a Ram Disk as part of the booting process. That computer was able to out perform Macs and Windows computers at the time because of it.
BobBarker1 says:
But you could also have RAM disks on Macs and PCs, too. I used to use one on my Mac way back in the day.

Leave a Reply

Your email address will not be published.

Jim Tanous

May 21, 2013

676 Articles Published