Created
September 11, 2013 18:22
-
-
Save dnozay/6527648 to your computer and use it in GitHub Desktop.
create a ramdisk on OSX.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# you can add this to your ~/.bash_profile | |
# based on: http://www.tekrevue.com/tip/how-to-create-a-4gbs-ram-disk-in-mac-os-x/ | |
create_ramdisk() { | |
# usage: create_ramdisk ramdisk_name size_in_kb | |
# e.g. "create_ramdisk ramdisk 4096" will create a 4GB ramdisk. | |
let ramsize=$2*2048; | |
diskutil erasevolume HFS+ $1 `hdiutil attach -nomount ram://$ramsize`; | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment