Skip to content

Instantly share code, notes, and snippets.

@jasisk
Created October 24, 2017 19:37
Show Gist options
  • Save jasisk/a1c35e337edb3585585201b9763a3e99 to your computer and use it in GitHub Desktop.
Save jasisk/a1c35e337edb3585585201b9763a3e99 to your computer and use it in GitHub Desktop.
Mount an APFS ramdisk in High Sierra
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