I tried
ramfs_size_mb=2048
mount_point=/usr/local/var/mysql
1024 bytes per kibibyte
1024 kibibytes per mebibyte
512 bytes per sector
ramfs_size_sectors=$((${ramfs_size_mb}10241024/512))
ramdisk_dev=hdid -nomount ram://${ramfs_size_sectors}
mkdir -p ${mount_point}
which up to this point had no errors.
then this fails (as recommended by Can I put /tmp and /var/log in a ramdisk on OS X? ):
newfs_hfs -v 'Volatile' ${ramdisk_dev}
newfs_hfs: cannot create filesystem on /dev/rdisk2 : No such file or directory
this also fails (as recommended by https://apple.stackexchange.com/questions/193883/to-have-ram-based-filesystem-in-osx ):
newfs_hfs ${ramdisk_dev}
newfs_hfs: cannot create filesystem on /dev/rdisk2 : No such file or directory
I'm not sure where /dev/rdisk2 comes from since ${ramdisk_dev} is /dev/disk2`
echo ${ramdisk_dev}
/dev/disk2
I can see the ram disk:
hdiutil info
framework : 595.140.1
driver : 595.140.1
================================================
image-path : ram://4194304
shadow-path : <none>
icon-path : /System/Library/PrivateFrameworks/DiskImages.framework/Resources/CDiskImage.icns
image-type : read/write
system-image : false
blockcount : 4194304
blocksize : 512
writeable : TRUE
autodiskmount : false
removable : TRUE
image-encrypted : false
mounting user : myusername
mounting mode : <unknown>
process ID : 17797
/dev/disk2
diskutil list
.
.
.
/dev/disk2 (disk image):
#: TYPE NAME SIZE IDENTIFIER
0: +2.1 GB disk2
Why can't I use new_hfs with my ramdisk?