Creating a RAM disk in unRAID (and macOS)

I’ve been playing around with unRAID for about a month now and find it very interesting. I just purchased 2 10 GBE ASUS/Aquantia NICs and wanted to test the network transfer speed.

Unfortunately, one quickly finds out the Array and/or SSD cache read speeds become the bottleneck and you don’t see the full 10 Gbps throughput. In order to mitigate this, I created a RAM disk on the unRAID server and then another RAM disk on my Hackintosh. Creating the macOS RAM disk is easy but it took some digging to find how to create a RAM disk on unRAID. Hopefully this will help anyone trying to create a RAM disk on unRAID moving forward.

Creating a RAM disk in unRAID

Stop the Array.

Go to Settings > SMB

In Samba extra configuration, paste the following:

[ramdisk]
path = /mnt/ramdisk
comment =
browseable = yes
public = yes
writeable = yes
vfs objects =

Click Apply, then Done.

Restart Array.

Mount your Flash drive/share

Open the Go file (inside the Config folder) using a text editor.

Paste the following:

mkdir -p /mnt/ramdisk

Save the Go file.

Reboot the unRAID server.

While the ramdisk will not show up under the Shares tab, it will show up as a share when you connect to your unRAID server. It will also show up in Krusader under /mnt/ramdisk. The size of the RAM disk defaults to half of the available RAM.

Creating a RAM disk in macOS (Catalina)

Open the Terminal app and enter the following command:

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

This will create a 4GB APFS formatted RAMdisk. The RAM amount is specified in blocks. You calculate the RAM amount as follows:

2048 (blocks) * RAM disk size in MB (1GB = 1024MB)

4GB RAM disk = 2048 * 4 * 1024 = 8388608

1GB RAM disk = 2097152

Enjoy!