Skip to content

Instantly share code, notes, and snippets.

@dr-dimitru
Created December 1, 2013 03:39
Show Gist options
  • Save dr-dimitru/7728259 to your computer and use it in GitHub Desktop.
Save dr-dimitru/7728259 to your computer and use it in GitHub Desktop.
Create RAM Disk (Mac OS X) via Terminal
diskutil erasevolume HFS+ "diskname" `hdiutil attach -nomount ram://2048`
#The line above mounts disk with name "diskname" and with size of 2048 blocks (~1 MB)
#More info: http://osxdaily.com/2007/03/23/create-a-ram-disk-in-mac-os-x/
#Convert blocks to megabytes and vise versa - http://www.unitconversion.org/data-storage/blocks-to-megabytes-conversion.html
#Note: Disk will be unmounted and all data will be lost on: empty battery, system reboot.
#How to save data on RAM disk on reboot, sleep or empty battery: http://puregin.org/setting-up-a-persistent-ramdisk-on-MacOS
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment