Creating RAM disk in macOS

Home   »   Creating RAM disk in macOS

# Built-in 

```sh
diskutil erasevolume HFS+ 'RAM Disk' `hdiutil attach -nobrowse -nomount ram://XXXXX`
```

where `XXXXX` is the size of the RAM disk in terms of memory blocks.

> **Notes**:
> 
> $2048$ memory blocks correspond to 1MB. Thus, `XXXXX` = `YYYY` * 2048 where `YYYY` is the size in MB.

E.g. 

- `ram://2048` will create 1MB RAM disk
- `ram://2097152` --> 1 GB
- `ram://4194304` --> 2 GB
- `ram://8388608` --> 4 GB

# Third-party Tools

- [**TmpDisk:**](https://github.com/imothee/tmpdisk):  Open Source RAM disk management app.
- [**Ultra RAM Disk**](https://itunes.apple.com/us/app/ultra-ram-disk/id503480494?mt=12) installs as a menu bar item that allows you to create RAM disks when needed.
- [**RAMDisk:**](https://itunes.apple.com/us/app/ramdisk/id429745495?mt=12) is  an app for creating as well as backing up RAM disks, to allow you to  save their contents as well as restore RAM disks when you restart your  Mac.
- [RAMDiskCreator](http://bogner.sh/wp-content/uploads/2012/12/RAMDiskCreator1.4.zip)

# Resources

- https://bogner.sh/2012/12/os-x-create-a-ram-disk-the-easy-way/
- https://blog.macsales.com/46348-how-to-create-and-use-a-ram-disk-with-your-mac-warnings-included
- https://www.jakobstoeck.de/2017/ramdisk-for-faster-applications-under-macos/

Leave a Reply

Your email address will not be published. Required fields are marked *