usually creating RAM disks works with the following commands
hdid -nomount ram://
Returns e.g. /dev/disk2 Then I would format
Found a solution:
hdid -nomount ram://
diskutil erasedisk
where
is taken from diskutil listFilesystems
from the "Personality" column. Yes, it seems weird to me too that you may have to quote this parameter, e.g. when specifying case-sensitive variants, but oh well...
is 2048 * desired size in megabytes
The last command formats the RAM disk and mounts it to /Volumes/
It seems to be the case that when now entering diskutil list
that you will see two new disks, the one hdid
created, and a synthesized one.
To destroy the RAM disk again, call diskutil eject
, e.g. diskutil eject /dev/disk2
This will do all the work for you, unmounting the /Volumes/
path and destroy the two disks, releasing your memory.
Keep in mind that the minimum/maximum values for
depend on the chosen
. Also,
cannot always be chosen arbitrarily. Exemplary, FAT32 requires it to consist of upper-case letters!
Cheers!