Skip to content

Instantly share code, notes, and snippets.

@ZachOrr
Forked from chaucerbao/ramdisk
Created July 23, 2013 12:49
Show Gist options
  • Save ZachOrr/6062101 to your computer and use it in GitHub Desktop.
Save ZachOrr/6062101 to your computer and use it in GitHub Desktop.
#!/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