How can we re-mount the RAM disk automatically after the reboot on AIX?

Hi All,

I was trying to know more about RAM disk concept in AIX. I found something on IBM site.

I was able to create and use/delete RAM disk as per IBM instructions.
But as you guys know, this RAM disk is a temporary storage. (*when ever we reboot the AIX LPAR, content/RAM disk will be gone)

My question is,

Can we create a RAM disk on AIX and make it permanent even after system reboot. ? (incase if i have some important content on it). How can i retrive and re mount the RAM disk automatically after a
system crash/reboot ?

(* i know that, we need to frequently backup the content on RAM disk)

but is there anyway this RAM disk can be brought up after system crash/reboot (like adding some commands in init file ?)

Please guide me.

thank you

You can place an entry in the /etc/inittab or use /etc/rc.d directories and place in whatever run-level directory you want (probably 2)

@blackrageous

Thanks for you response. But i do not know how we remount the RAM disk as before.
My thinking is once we reboot the system, we loose the RAM disk.

do i need to add the RAM disk create commands in a file and add an entry in /etc/initab or /etc/rc2.d (run level 2)
& then copy the content from backups ?

[

](blackrageous's profile and badges)

In simple words: Yes :slight_smile:

We do this in a similar way

/etc/inittab:

ramdisk:2:once:/usr/local/bin/ramdisk/ramdisk.ksh >/dev/null 2>&1

/usr/local/bin/ramdisk/ramdisk.ksh:

...<SNIP>...
RAMDISK=`mkramdisk 5M`
mkdir /ramdisk >/dev/null 2>&1
DEVICE="/dev/ramdisk`echo $RAMDISK | awk -F'ramdisk' '{print $2}'`"
echo "yes" | mkfs -V jfs $DEVICE
mount -V jfs -o nointegrity $DEVICE /ramdisk
...<SNIP>...
cp <whatever you need> /ramdisk

If you find a better solution, please let me know.

Regards

@[-=XrAy=-

](-=XrAy=-'s profile and badges)Thanks for your response. Sure, i will let you know in case if i find a better solution.
thank you