Last active
December 14, 2015 04:29
-
-
Save chaucerbao/5028421 to your computer and use it in GitHub Desktop.
(Mac OSX) Create a ram disk under /Volumes/RamDisk. Put it in `/usr/local/bin/`. Usage:
./ramdisk.sh [size(MB)]
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
#!/bin/sh | |
SIZE_MB=${1:-1024} | |
SECTORS=$((${SIZE_MB}*1024*1024/512)) | |
diskutil erasevolume HFS+ "RamDisk" `hdiutil attach -nomount ram://${SECTORS}` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment