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

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • VCS
  • Interview Questions
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • 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. How to Find Filesystem Inode Utilization in Linux
  2. How to get Fibre Channel HBA information from Linux SOSreport
  3. How to disable IPv6 on CentOS / RHEL 7
  4. How to disable timeout in ssh during login prompt (login session inactivity) in Linux
  5. Bash for loop Examples
  6. CentOS / RHEL 7 : How to boot into Rescue Mode or Emergency Mode
  7. How to use perf tool for tracing similar to dtrace
  8. CentOS / RHEL : How to collect sosreport
  9. CentOS / RHEL 6 : How to extract initramfs image and edit/view it
  10. Can’t start X11 applications after “su” or “su -” to another user

You May Also Like

Primary Sidebar

Recent Posts

  • JavaFX ComboBox: Set a value to the combo box
  • Nginx load balancing
  • nginx 504 gateway time-out
  • Images preview with ngx_http_image_filter_module

© 2022 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright