Skip to content

Instantly share code, notes, and snippets.

@leviwilson
Created December 5, 2013 01:58
Show Gist options
  • Save leviwilson/7798973 to your computer and use it in GitHub Desktop.
Save leviwilson/7798973 to your computer and use it in GitHub Desktop.
Create memory backed disk on OSX

Create a memory-backed disk in OSX. Useful for sending git filter-branch to it to speed things up.

# to mount
hdiutil attach -nomount ram://$(( 128 * 1024 * 2 )) # returns device with 128 MB (in 512k blocks)
diskutil erasevolume JHFS+ "tmp" /dev/disk1 # whatever the hdiutil command returns

# when done
diskutil unmount /dev/disk1
hdiutil detach /dev/disk1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment