在redhat6之前,修改tmpfs大小只需要修改fstab里面的值就行了。

redhat 6  除了修改fstab外,还需要修改一下参数文件  /etc/rc.d/rc.sysinit

  1. 修改/etc/fstab

查看内存:

[root@oradbca ~]# grep MemTotal /proc/meminfo 
MemTotal:       65951744 kB

默认值

[root@oradbca ~]# grep tmpfs /etc/fstab 
tmpfs                   /dev/shm                tmpfs   defaults        0 0

 

通过 vi 改成

tmpfs                   /dev/shm                tmpfs   size=60g        0 0

 

   2.修改 /etc/rc.d/rc.sysinit

if [ "$READONLY" != "yes" ] ; then
        # Clear mtab
        (> /etc/mtab) &> /dev/null

        # Remove stale backups
        rm -f /etc/mtab~ /etc/mtab~~

        # Enter mounted filesystems into /etc/mtab
        mount -f /
        mount -f /proc >/dev/null 2>&1
        mount -f /sys >/dev/null 2>&1
        mount -f /dev/pts >/dev/null 2>&1
        mount -f /dev/shm >/dev/null 2>&1
        mount -f /proc/bus/usb >/dev/null 2>&1
fi

# Mount all other filesystems (except for NFS and /proc, which is already
# mounted). Contrary to standard usage,
# filesystems are NOT unmounted in single user mode.
# The 'no' applies to all listed filesystem types. See mount(8).
if [ "$READONLY" != "yes" ] ; then
        action $"Mounting local filesystems: " mount -a -t nonfsi,nfs4,smbfs,ncpfs,cifs,gfs,gfs2 -O no_netdev
else
        action $"Mounting local filesystems: " mount -a -n -t nonfs,nfs4,smbfs,ncpfs,cifs,gfs,gfs2 -O no_netdev
fi

 

改成

if [ "$READONLY" != "yes" ] ; then
        # Clear mtab
        (> /etc/mtab) &> /dev/null

        # Remove stale backups
        rm -f /etc/mtab~ /etc/mtab~~

        # Enter mounted filesystems into /etc/mtab
        mount -f /
        mount -f /proc >/dev/null 2>&1
        mount -f /sys >/dev/null 2>&1
        mount -f /dev/pts >/dev/null 2>&1
        ##mount -f /dev/shm >/dev/null 2>&1
        mount -f /proc/bus/usb >/dev/null 2>&1
fi

# Mount all other filesystems (except for NFS and /proc, which is already
# mounted). Contrary to standard usage,
# filesystems are NOT unmounted in single user mode.
# The 'no' applies to all listed filesystem types. See mount(8).
if [ "$READONLY" != "yes" ] ; then
        action $"Mounting local filesystems: " mount -a -t nonfsi,tmpfs,nfs4,smbfs,ncpfs,cifs,gfs,gfs2 -O no_netdev
else
        action $"Mounting local filesystems: " mount -a -n -t nonfs,tmpfs,nfs4,smbfs,ncpfs,cifs,gfs,gfs2 -O no_netdev
fi

 

修改了13行,22行,24行。

修改保存,重启生效。或者你觉得你改的东西保证没有问题,可以不重起临时修改tmpfs大小(临时生效)

命令为:

mount -o remount,size=60g /dev/shm

 

[root@oradbca ~]# df -h |grep tmpfs
tmpfs                  60G     0   60G   0% /dev/shm

修改成功。。