AIX Create a RAM Disk
We needed to create a RAM disk on AIX 7.1 for an application that uses file-systems as a scratch pool. We understand that ALL data in the RAM disk will be lost when the LPAR is rebooted, but for us, that is okay.
There are a couple of other blog posts about how to do this, but they all lack a critical option that will help to improve overall AIX filesytem performance. The missing option is the 'rbrw' mount setting, and you should probably also set the 'noatime' mount settings.
If you have the disk in RAM, then you should tell AIX to not use the JFS2 file cache for reads and writes to this filesystem, otherwise you will be double buffering the disk pages in JFS2 cache memory and the RAM disk.
Make the RAM Disk at 32GB.
/usr/sbin/mkramdisk 32G
Format the RAM Disk.
/usr/sbin/mkfs -V jfs2 /dev/rramdisk0
Make the Directory.
mkdir -p /scratch
Mount the RAM disk and tell it to flush the JFS2 cache for both reads and writes. This applies to AIX 6.1 and above.
/usr/sbin/mount -V jfs2 -o log=NULL,rbrw,noatime /dev/ramdisk0 /scratch
For AIX 5.3, use this mount option.
mount -V jfs -o nointegrity,rbrw,noatime /dev/ramdisk0 /scratch
To Remove the RAM Disk.
umount /scratch
rmramdisk ramdisk0