Skip to content

Instantly share code, notes, and snippets.

@JPKCom
Forked from dhlavaty/ramdisk-howto.md
Created April 19, 2018 06:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JPKCom/a938d910fbd7157fd0496588acc15a97 to your computer and use it in GitHub Desktop.
Save JPKCom/a938d910fbd7157fd0496588acc15a97 to your computer and use it in GitHub Desktop.
Create RAM disk in macOS High Sierra (10.13.3)

Create RAM disk in macOS High Sierra (10.13.3)

LIST DISKS

$ diskutil list

RAMDISK CREATE

$ hdiutil attach -nomount -nobrowse ram://120000               # 120000 * 512bytes

$ newfs_hfs /dev/disk*                                         # <- * is number generated by previous command

$ mount -t hfs -v /dev/disk* /tmp/ramdisk                        # <- * is number generated by previous command

RAMDISK DELETE

$ umount /tmp/ramdisk

$ hdiutil detach /dev/disk*                                    # <- * is number generated by previous command
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment