Create RAM disk in macOS High Sierra (10.13.3), macOS Monterey (12.6.5) ARM, macOS Sonoma (14.5) ARM
Tested on macOS Monterey (12.6.5) with Apple M1 Pro chip (ARM architecture)
Tested on macOS Sonoma (14.5) with Apple M1 Pro chip (ARM architecture)
diskutil list
hdiutil attach -nomount -nobrowse ram://120000 # 120000 * 512bytes = ~ 61.4 MB RAM disk
# 6000000 = ~ 3 GB RAM disk
newfs_hfs /dev/disk* # <- * is number generated by previous command
# Aware: '/tmp/ramdisk' path MUST exist first
mount -t hfs -v /dev/disk* /tmp/ramdisk # <- * is number generated by previous command
umount /tmp/ramdisk
hdiutil detach /dev/disk* # <- * is number generated by previous command