Create memory resident filesystems (RAM disk) on AIX

AIX supports memory-resident file systems. It can be used to maximize disk performance. It’s equivalent to Solaris tmpfs filesystem.
NOTE: RAM disk doesn’t survive a reboot.

Steps to create a RAM disk on AIX:

  • Get size of real (online) memory.
  • Create the RAM disk
  • Create the file system
  • Mount the file system.

 

  • Get size of real (online) memory.
1
2
3
4
[root@aix:/] lparstat -i|grep Memory|egrep 'Minimum|Online|Maximum'
Online Memory                              : 16384 MB
Maximum Memory                             : 24576 MB
Minimum Memory                             : 256 MB

Or,

1
2
[root@aix:/] bootinfo -r
16777216
  • Create the RAM disk.
1
2
[root@aix:/] mkramdisk 1024M
/dev/rramdisk0

NOTE: By default, RAM disk pages are pinned. if you want to create RAM disk pages that are not pinned use ‘-u’ flag.

  •   Create the file system.
1
2
3
4
5
6
7
[root@aix:/] mkfs -V jfs2 /dev/ramdisk0
 mkfs: destroy /dev/ramdisk0 (yes)? y
   File system created successfully.
   16176 kilobytes total disk space.
   Device /dev/ramdisk0:
   Standard empty filesystem
   Size:           2096680 512-byte (DEVBLKSIZE) blocks
  • Mount the file system.
1
[root@aix:/] mkdir /ramdiskfs
1
[root@aix:/] mount -V jfs2 -o log=NULL /dev/ramdisk0 /ramdiskfs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
[root@aix:/] mount
  node       mounted        mounted over    vfs       date        options
-------- ---------------  ---------------  ------ ------------ ---------------
         /dev/hd4         /                jfs2   Dec 07 09:33 rw,log=/dev/hd8
         /dev/hd2         /usr             jfs2   Dec 07 09:33 rw,log=/dev/hd8
         /dev/hd9var      /var             jfs2   Dec 07 09:33 rw,log=/dev/hd8
         /dev/hd3         /tmp             jfs2   Dec 07 09:33 rw,log=/dev/hd8
         /dev/hd1         /home            jfs2   Dec 07 09:33 rw,log=/dev/hd8
         /dev/hd11admin   /admin           jfs2   Dec 07 09:33 rw,log=/dev/hd8
         /proc            /proc            procfs Dec 07 09:33 rw
         /dev/hd10opt     /opt             jfs2   Dec 07 09:33 rw,log=/dev/hd8
         /dev/livedump    /var/adm/ras/livedump jfs2   Dec 07 09:33 rw,log=/dev/hd8
         /dev/syslog_lv   /var/syslog      jfs2   Dec 07 09:33 rw,log=/dev/hd8
         /dev/cores_lv    /CORES           jfs2   Dec 07 09:33 rw,log=/dev/hd8
         /dev/fslv00      /REPOS/SVN1SYNC  jfs2   Dec 07 09:33 rw,log=/dev/hd8
         /dev/db2inslv01  /db2inst1        jfs2   Dec 07 09:33 rw,log=/dev/loglv00
         /dev/adm_lv      /tsmadm          jfs2   Dec 07 09:33 rw,log=/dev/loglv00
         /dev/reportinlv  /reporting       jfs2   Dec 07 09:33 rw,log=/dev/loglv00
         /dev/fslv02      /powervp         jfs2   Dec 07 09:33 rw,log=/dev/hd8
         /dev/fslv03      /db2flash        jfs2   Dec 07 09:33 rw,log=/dev/loglv01
         /dev/ramdisk0    /ramdiskfs       jfs2   Feb 08 10:26 rw,log=NULL
1
2
3
[root@aix:/] df -m /ramdiskfs
Filesystem    MB blocks      Free %Used    Iused %Iused Mounted on
/dev/ramdisk0   1024.00   1023.52    1%        4     1% /ramdiskfs
  • To umount, delete RAM disk follow these steps
1
[root@aix:/] umount /ramdiskfs/
1
[root@aix:/] rmramdisk rramdisk0

That’s it!

0 (0)
Article Rating (No Votes)
Rate this article
Attachments
There are no attachments for this article.
Comments
There are no comments for this article. Be the first to post a comment.
Full Name
Email Address
Security Code Security Code
Related Articles RSS Feed
AIX 6/7 Script to create a file with commands to remove missing and failed paths
Viewed 3267 times since Tue, Jun 14, 2022
How to Analyze or Read OS Watcher Output in three easy steps -- With Example ?
Viewed 41220 times since Thu, Jun 21, 2018
Altering LVM Configuration When a Disk is Not in ODM Anymore
Viewed 2998 times since Mon, Jun 3, 2019
How to install filesets/software in aix?
Viewed 5778 times since Mon, Jul 8, 2019
AIX alt_disk_copy
Viewed 9764 times since Sun, Jun 30, 2019
LVM: Extend an existing Volume Group by adding a new disk
Viewed 5511 times since Sat, Jun 2, 2018
AIX Power replacing (hot-swap) failed disk in rootvg
Viewed 3594 times since Tue, Apr 16, 2019
AIX Changing ’defined’ or ’missing’ hard disk states to ’Available’ in IBM Smart Analytics System for AIX environment
Viewed 9433 times since Wed, May 22, 2019
AIX: How to set automatic logoff (only for terminals)
Viewed 2967 times since Mon, Jun 11, 2018
Monitoring Events with AIX Audit
Viewed 3913 times since Wed, May 30, 2018