Problem

/tmp is not automatically mounted after reboot even though an entry is present in /etc/fstab.

Below outputs show an example of the issue:

# uptime
16:44:11 up 2 min, 1 user, load average: 0.21, 0.55, 0.44
# df -h
Filesystem                                        Size    Used Avail Use% Mounted on
devtmpfs                                          252G       0 252G    0% /dev
tmpfs                                             252G    817M 251G    1% /dev/shm
tmpfs                                             252G     11M 252G    1% /run
tmpfs                                             252G       0 252G    0% /sys/fs/cgroup
/dev/mapper/VolGroupXXX-LogVolRoot                 30G     25G 3.2G   89% /
/dev/mapper/VolGroupXXX-LogVolVar                 7.8G    588M 6.8G    8% /var
/dev/sda1                                         477M    234M 218M   52% /boot
/dev/mapper/VolGroupSys-LogVolHome                2.0G     12M 1.8G    1% /home
tmpfs                                              51G       0  51G    0% /run/user/0
# cat /etc/fstab
/dev/mapper/VolGroupXXX-LogVolRoot                  /             ext3 defaults 1 1
UUID=xxxx6a54-xxxx-xxxx-xxxx-121xxxxxxx83           /boot         ext3 defaults 1 2
/dev/mapper/VolGroupXXX-LogVolSwap                  swap         swap defaults 0 0
/dev/mapper/VolGroupXXX-LogVolTmp                   /tmp           ext3 defaults 1 2
/dev/mapper/VolGroupXXX-LogVolHome                  /home        ext3 defaults 1 2
/dev/mapper/VolGroupXXX-LogVolVar                   /var            ext3 defaults 1 2

Running “mount -a” mounts /tmp without any issues.

# mount -a
# df -h /tmp
Filesystem                                        Size    Used Avail Use% Mounted on
/dev/mapper/VolGroupXXX-LogVolTmp                  40G     22G  17G   57% /tmp

Solution

On investigation, it was found that tmp.mount was masked in systemd. To check the masked status, use:

# systemctl status tmp.mount
* tmp.mount
  Loaded: masked (/dev/null; bad)
  Active: inactive (dead)

Hence systemd ignores the entry to mount /tmp that is present in /etc/fstab.

In order to resolve the issue, we need to unmask the tmp.mount using systemctl:

# systemctl unmask tmp.mount

Then reboot the server to verify if custom entry for /tmp from /etc/fstab is mounted at boot.