There are various resources about how to create a RAM disk, but they all deal with HFS+ RAM disks. But how does one create an APFS RAM disk?
I tried passing APFS
as file system to the diskutil
command like below, but that doesn't work. Since diskutil
has a whole bunch of APFS-related subcommands I assume there's more magic necessary.
DISK_ID=`hdiutil attach -nomount ram://$((4 * 1024 * 2048))`
diskutil eraseVolume APFS "RAM Disk" "$DISK_ID"