2

I recently created a RAM /tmp by adding this to /etc/fstab:

tmpfs /tmp tmpfs rw,nosuid,nodev,noatime   0    0

Everything works fine, and in theory the system runs faster now, but at boot time /var/log/syslog gets:

… tmp.mount: Directory /tmp to mount over is not empty, mounting anyway.

This situation seems inevitable, as there is never an opportunity to remove files from the filesystem version of /tmp.

The wasted space is trivial, but as a matter of interest, is there any easy way to clean out the junk hidden under the /tmp mountpoint?

4
mkdir /mnt/root
mount --bind / /mnt/root

This will mount your root partition in /mnt/root. Current mountpoints are not affected, so when looking in /mnt/root, you will see the original directory contents.

  • 2
    Perfect. That did it. – Ray Butterworth Jul 28 at 3:35
  • @Nuclear To make your answer more complete and more accessible to all audience, I suggest you edit your answer and add steps with instructions like: 1. Create a new mount point at /mnt/root 2. Mount your root system with original /tmp to /mnt/root 3. Access your original /tmp directory at /mnt/root/tmp 4. To delete all content in your original /tmp, please run rm -r /mnt/root/tmp/* . Voted one up for your answer. – Raffa Jul 30 at 3:16
0

The 'easy' way is to boot from a Live USB/CD. Then, your mount won't have happened.

0

To solve this:

  1. Please, edit your /etc/fstab file. Type in the terminal:

    sudo nano /etc/fstab

  2. Comment out the line below like so:

    # tmpfs /tmp tmpfs rw,nosuid,nodev,noatime 0 0

  3. Save the file, exit and reboot your system.

  4. After system reboot, edit your /etc/fstab file again and un-comment the line below like so:

    tmpfs /tmp tmpfs rw,nosuid,nodev,noatime 0 0

  5. Save the file and exit.

  6. Clear the /tmp directory by typing the command below in terminal:

    sudo rm -r /tmp/*

  7. Reboot your system.

Please, avoid running any applications other than the terminal during this process to avoid writing new files to the /tmp directory.

See if the log entry disappears now.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.