Created
October 24, 2017 19:37
-
-
Save jasisk/a1c35e337edb3585585201b9763a3e99 to your computer and use it in GitHub Desktop.
Mount an APFS ramdisk in High Sierra
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SIZE=1024 | |
DISKNAME=ramdisk | |
MOUNTPATH="$HOME/mnt" | |
DISK="$(basename $(hdiutil attach -nomount "ram://$(( ${SIZE} * 1024 * 1024 / 512 )))" | |
diskutil partitionDisk "${DISK}" GPT APFS %noformat% R | |
newfs_apfs -v "${DISKNAME} "${DISK}s1" | |
diskutil mount -mointPoint "${MOUNTPATH}" "${DISKNAME}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment