Setting the Size of tmpfs and shmfs

Support knowledgebase (tmpfs_config)
Applies to

SuSE Linux: All versions
Kernel: Version 2.4.x

Symptom

By default, the virtual file system tmpfs is mounted to "/dev/shm" with half the available RAM.

Cause

The cause is a definition to this effect in the boot scripts.

Solution

Disable the following entries, approximately line 489, in the file /etc/init.d/boot or, for version 8.0 or later, /etc/init.d/boot.swap:
# mount shmfs is necessary (2.4 kernels)
#
#unset HAVE_SHM
#while read dev type; do
#    test "$type" = "shm" && HAVE_SHM=1
#done < /proc/filesystems
#if test ! -z "$HAVE_SHM"; then
#    ECHO_RETURN=$rc_done
#    test -d /dev/shm || mkdir /dev/shm
#    echo -n "Mount SHM FS on /dev/shm"
#    mount -t shm shmfs /dev/shm || ECHO_RETURN=$rc_failed
#    echo -e $ECHO_RETURN
#fi
#unset HAVE_SHM
Instead, insert an entry in the file /etc/fstab and specify the desired size in the parameter "size". An example with 1G:
tmpfs /dev/shm tmpfs size=1g 0 0

Keywords: TMPFS, SHMFS, MYSAP

Categories: Kernel

SDB-tmpfs_config, Copyright SuSE Linux AG, Nürnberg, Germany - Version: 02. Mai 2002
SuSE Linux AG - Last generated: 13. Mai 2002 by ip (sdb_gen 1.40.0)