Create an APFS RAM disk on macOS High Sierra

usually creating RAM disks works with the following commands

hdid -nomount ram://<blocksize>

Returns, for example. / Dev / disk 2 Then I formatted the disk, say

newfs_hfs /dev/disk2

and then install it:

mount -t hfs /dev/disk2 /some/mount/target

This procedure does not work with APFS. I am in High Sierra beta 9. The mount command does not display any errors, but the path is not mounted.

In my case, upon completion of the command hdid, newfs_apfs -i /dev/disk2gives

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.

When I enter mount -t apfs /dev/disk2 /some/target/path, then the mount commands work for 2 seconds, give no output, and mount was not successful.

Can someone tell me how to actually make an apfs std ram disk does it work ?: P

PS: - diskutil partitionDisk /dev/disk2 GPT APFS myvolumename 0b, /Volumes/myvolumename, (disk3 ), !

+18
3

:

hdid -nomount ram://<blocksize>
diskutil erasedisk <format> <diskname> <output path of previous hdid command>

<format> diskutil listFilesystems "". , , , , , . , , ...

<blocksize> 2048 * desired size in megabytes

RAM- /Volumes/<diskname>

, diskutil list , hdid .

RAM- , diskutil eject <output path of previous hdid command>, . diskutil eject /dev/disk2

, /Volumes/<diskname> , .

, / <blocksize> <format>. , <diskname> . : FAT32 , !

!

+15

@Glyph , :

diskutil partitionDisk $(hdiutil attach -nomount ram://2048000) 1 GPTFormat APFS 'ramdisk' '100%'

Glyph-, .

+18

, / RAM- . ramdisk /Volumes/'ramdisk', :

diskutil eject /Volumes/'ramdisk'
0

Source: https://habr.com/ru/post/1685695/


All Articles