• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • VCS
  • Interview Questions
  • Database
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

CentOS/RHEL: /tmp mount point not automatically mounting when added in /etc/fstab

by admin

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.

# systemctl reboot

Filed Under: CentOS/RHEL, CentOS/RHEL 7, CentOS/RHEL 8, Linux

Some more articles you might also be interested in …

  1. unlink: command not found
  2. How to change the number of commands stored in Bash History
  3. What is HBA Queue Depth and How to Check the Current Queue Depth Value and how to Change it
  4. How to configure xhost to be persistent across reboots in Linux
  5. rpm-ostree Command Examples in Linux
  6. How to Install GUI On CentOS/RHEL 8
  7. Firewalld Command line Reference (Cheat Sheet)
  8. Understanding iscsiadm Utility in CentOS / RHEL
  9. CentOS / RHEL 5 : How to use the faillog command to track failed login attempts
  10. How to use command redirection under Linux

You May Also Like

Primary Sidebar

Recent Posts

  • glab Command Examples
  • “glab repo” Command Examples
  • “glab release” Command Examples
  • “glab pipeline” Command Examples

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright