How to bind mount to have more space in /tmp directory?

Solution Verified - Updated -

Environment

  • Red Hat Enterprise Linux 5
  • Red Hat Enterprise Linux 6
  • Red Hat Enterprise Linux 7

Issue

  • Don't have enough space in /tmp directory.
  • Application requires more space in /tmp directory.
  • /tmp directory is full. How to add more space to it?

Resolution

  • Stop any application using /tmp directory.
  • Identify the location with enough space to utilize as /tmp. Let's say to /backup directory has enough space.
  • Move the current contents /tmp to /backup
[root@hostname ~]# cp -pf /tmp /backup
  • Add entry in fstab for persistent bind mount.
/backup/tmp    /tmp    none    bind    0 0

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.

Comments