Bug: /def/shm does not use /etc/fstab attributes after reboot

SOLVED: this issue is solved in Linux 6.4 (kernel: 2.6.39-400.17.1.el6uek and 2.6.32-358.el6).
A single entry in /etc/fstab like [tmpfs /dev/shm tmpfs size=3g 0 0] now works as it should!

There is a bug in Red Hat Linux 6 and Oracle Enterprise Linux 6 (UEK and RHEL-kernel) and probably all other Red Hat 6 related Linux Distro’s.

When you need more memory for SGA/PGA when using MEMORY_MAX_TARGET, you need to resize /dev/shm. By default this is 50% of total memory and Oracle tells you to add the following to /etc/fstab, ‘mounting’ the /dev/shm twice (?):

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

Which works…

(IMPORTANT NOTE: make sure the first field (fs_spec) ‘shmfs’ has the same name as the already existing ‘defaults’ name). So if you have a line [tmpfs /dev/shm tmpfs defaults 0 0], make sure the ‘overruled’ line also starts with ‘tmpfs’: [tmpfs /dev/shm tmpfs size=3g 0 0]. If not, a `mount -a` will un-mount (!!!) the ‘shmfs’ and remount ‘tmpfs’, this results in immediate clearing the ‘/dev/shm’ memory and all your SGA is instantly gone! Running this when databases are running, your databases with AMM will crash! This ‘issue’ is still there last time checked in Linux 7.3. In Oracle documentation about /dev/shm, the first field is ‘shmfs’ with can result in crashing databases when a `mount -a` done!

But, sometimes that line is alread there, which in my opinion should be used and should work:

#tmpfs /dev/shm tmpfs defaults 0 0
tmpfs /dev/shm tmpfs size=3g 0 0

This works after a remount: ‘mount -o remount /dev/shm’, but it doesn’t work after a reboot…

It seems to be a bug in a module called ‘dracut’. Setting attributes for /dev/shm should work at tmpfs entry, but the attributes are not taken from /etc/fstab :

https://bugzilla.redhat.com/show_bug.cgi?id=669700

https://bugzilla.redhat.com/show_bug.cgi?id=783884

“Cause: /dev/shm is mounted in dracut without attributes from fstab. Consequence: /dev/shm does not have attributes from fstab. Fix: Remount /dev/shm in rc.sysinit. Result: /dev/shm has attributes from fstab.”

But, adding it again (shmfs see above) to /etc/fstab also works…

This is the case when using the Oracle Enterprise Linux 6 (UEK and RHEL) and Red Hat Linux 6, so I think also Red Hat 6 related distributions like CentOS will suffer from this bug.
Update: This is fixed in Linux 6.4, so an extra line is not necessary.

Happy rebooting!

Tagged , , , . Bookmark the permalink.

2 Responses to Bug: /def/shm does not use /etc/fstab attributes after reboot

  1. HieuLe says:

    Dear,
    I have a system server with 256GB memory, my question is, best config for tmpfs and oracle AMM?
    Thanks.

    • Ian Hoogeboom says:

      Hi HieuLe,

      The ‘best’ size would be adding the MEMORY_(MAX_)TARGETS or SGA’s max and PGA’s targets of all the databases running on your server.
      But… when you have this much memory, Oracle recommends using Huge Pages on Linux level. One disadvantage with Huge Pages is that AMM is uncompatible. This means stay on or go back to ASMM.
      See restrictions here: Overview of HugePages

      Cheers, Airell.

Leave a Reply

Your email address will not be published. Required fields are marked *