修改tmpfs内存的方法
1. vi /ect/fstab
将tmpfs /dev/shm tmpfs defaults 0 0
修改为
tmpfs /dev/shm tmpfs defaults,size=2G 0 0
size按该机器的实际配置修改
2. vi /etc/rc.d/rc.sysinit
第一步:注释如下语句
#mount -f /dev/shm >/dev/null 2>&1
第二步:搜索关键字READONLY
将
if [ "$READONLY" != "yes" ] ; then
action $"Mounting local filesystems: " mount -a -t nonfs,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
action $"Mounting local filesystems: " mount -a -t tmpfs,nonfs,nfs4,smbfs,ncpfs,cifs,gfs,gfs2 -O no_netdev
else
action $"Mounting local filesystems: " mount -a -n -t tmpfs,nonfs,nfs4,smbfs,ncpfs,cifs,gfs,gfs2 -O no_netdev
fi
3. 重启服务器:reboot