Karl’s Blog

09 May 12 How to Create a RAM Disk in Mac OSX

This is a useful example of how to create a RAM disk in Mac OSX. The number 1165430 represents the number of sectors to allocate; each sector contains 512 bytes. The example below will create a RAM disk named ramdisk with 569.06 MB of space.

diskutil erasevolume HFS+ "ramdisk" `hdiutil attach -nomount ram://1165430`