#+ # NAME: # mkramdisk # PURPOSE: # Set up ramdisk # CATEGORY: # CALLING SEQUENCE: # . $COM/mkramdisk # INPUTS: # (ramdisk entry in /etc/fstab) # OUTPUTS: # (env var $ramdisk) # PROCEDURE: # The ramdisk should be set up already at mount point /tmp/ramdisk. # This can be done as follows: # mkdir /tmp/ramdisk # mke2fs /tmp/ramdisk # Add the following line to /etc/fstab # /dev/ramdisk /tmp/ramdisk ext2 noauto,user 0 0 # # The ramdisk is primarily used by the IDL procedure gunzip_file # to store temporary unzipped files. # MODIFICATION HISTORY: # JUL-2004, Paul Hick (UCSD/CASS; pphick@ucsd.edu) #- if [ -z "$ramdisk" ]; then if [ -z "$(mount | grep ramdisk)" ]; then mount /tmp/ramdisk 2> /dev/null mounted=$? else mounted=0 fi if [ $mounted == 0 ]; then touch /tmp/ramdisk/tmp.tmp 2> /dev/null if [ $? == 0 ]; then rm /tmp/ramdisk/tmp.tmp ramdisk=/tmp/ramdisk export ramdisk fi fi fi