Thursday, August 25, 2011

Oracle Linux 6 - Problem resizing tmpfs ???

I installed Oracle Linux 6.1 and I was curious about resizing tmpfs (when I rebooted). It's fixed at 50% of memory???
[root@mytest ~]# grep shm /etc/fstab
tmpfs /dev/shm tmpfs defaults 0 0

[root@mytest ~]# df -h | grep shm
tmpfs 903M 176M 728M 20% /dev/shm

[root@mytest ~]# grep shm /etc/fstab
tmpfs /dev/shm tmpfs size=2g 0 0
Tested to reboot!!!
[root@mytest ~]# df -h | grep shm
tmpfs 903M 0 903M 0% /dev/shm

[root@mytest ~]# grep shm /etc/fstab
tmpfs /dev/shm tmpfs size=2g 0 0
Oops!!! not affect, after rebooted. What wrong? I read this link for idea.
So, I fixed /etc/rc.d/rc.sysinit file.
[root@mytest ~] cp -a /etc/rc.d/rc.sysinit /etc/rc.d/rc.sysinit.org
[root@mytest ~] vi /etc/rc.d/rc.sysinit
******************************************************
- mount -f /dev/shm >/dev/null 2>&1
+ #mount -f /dev/shm >/dev/null 2>&1
******************************************************
if [ "$READONLY" != "yes" ] ; then
- action $"Mounting local filesystems: " mount -a -t nonfs,nfs4,smbfs,ncpfs,cifs,gfs,gfs2 -O no_netdev
+ action $"Mounting local filesystems: " mount -a -t tmpfs,nonfs,nfs4,smbfs,ncpfs,cifs,gfs,gfs2 -O no_netdev
******************************************************
After I changed rc.sysinit file.
[root@mytest ~]# diff /etc/rc.d/rc.sysinit.org /etc/rc.d/rc.sysinit
504c504
< mount -f /dev/shm >/dev/null 2>&1
---
> # mount -f /dev/shm >/dev/null 2>&1
512c512
< action $"Mounting local filesystems: " mount -a -t nonfs,nfs4,smbfs,ncpfs,cifs,gfs,gfs2 -O no_netdev
---
> action $"Mounting local filesystems: " mount -a -t tmpfs,nonfs,nfs4,smbfs,ncpfs,cifs,gfs,gfs2 -O no_netdev
[root@mytest ~]# df -h | grep shm
tmpfs 903M 176M 728M 20% /dev/shm

[root@mytest ~]# grep shm /etc/fstab
tmpfs /dev/shm tmpfs size=2g 0 0

Tested to reboot!!! again -)
[root@mytest ~]# df -h | grep shm
tmpfs 2.0G 655M 1.4G 32% /dev/shm

No comments: