title: Create APFS RAM disk on macOS High Sierra
body: <p>usually creating RAM disks works with the following commands</p>
  
  <pre><code>hdid -nomount ram://&lt;blocksize&gt;
  </code></pre>
  
  <p>Returns e.g. /dev/disk2
  Then I would format the disk, with say </p>
  
  <pre><code>newfs_hfs /dev/disk2
  </code></pre>
  
  <p>followed by mounting it:</p>
  
  <pre><code>mount -t hfs /dev/disk2 /some/mount/target
  </code></pre>
  
  <p>This procedure doesn't seem to work with APFS. I'm on High Sierra beta 9. The mount command doesn't output any error, but the path is not mounted.</p>
  
  <p>In my case, after the <code>hdid</code> command finished, <code>newfs_apfs -i /dev/disk2</code> yields</p>
  
  <pre><code>nx_kernel_mount:1364: checkpoint search: largest xid 1, best xid 1 @ 1
  nx_kernel_mount:1422: sanity checking all nx state... please be patient.
  spaceman_metazone_init:278: no metazone for device 0, of size 209715200 bytes, block_size 4096
  apfs_newfs:18075: FS will NOT be encrypted.
  </code></pre>
  
  <p>When I then enter <code>mount -t apfs /dev/disk2 /some/target/path</code> then the mount commands seems to work for 2 seconds, doesn't give any output and the mount was NOT succesful.</p>
  
  <p>Can anyone tell me how to actually make a APFS RAM disk s.t. it works? :p</p>
  
  <p>PS: I've also tried something like <code>diskutil partitionDisk /dev/disk2 GPT APFS myvolumename 0b</code> which does mount the volume to <code>/Volumes/myvolumename</code> but creates yet another disk (<code>disk3</code> in this case) which seems odd to me!</p>