1

I have a ubuntu in which disk is getting full. When I checked the disk usage, I noticed that most of the disk was getting used in /tmp folder. When I opened the /tmp folder, I realized, it has folders created with name rust_mozprofile2oIotz and Temp-fecb01ff-12cd-47bc-8617-882a1256e and there were around 4k folders. And below are the contents of it:

enter image description here

What should I do with these. I am not sure if we can delete them or not. I need to free up some space. Thanks

S Andrew
  • 484
  • 1
    /tmp is NOT impacting your disk space - it is a tmpfs type system - it exists in RAM for the most part, and is erased automatically on reboots. It is not unusual to see lots of items in /tmp but it is not the cause of your disk space being lost. Check the output of mount | grep /tmp to see and verify that /tmp is a tmpfs - your output will look like this: tmpfs on /tmp type tmpfs (rw,nosuid,nodev,noatime,size=10485760k) – Thomas Ward Feb 02 '21 at 14:47
  • @ThomasWard I think the machine was not rebooted/powered down from last many days (not sure about this). I rebooted it just now and I can see the space is automatically cleared. Also when I run the command mount | grep /tmp. It doesnt showed me anything – S Andrew Feb 02 '21 at 14:51
  • 2
    /tmp is by default not tmpfs in Ubuntu. But it gets emptied after each reboot. – pLumo Feb 02 '21 at 15:08
  • might be you (or any software you have installed) uses selenium + geckodriver ? See https://stackoverflow.com/questions/49719015/geckodriver-is-creating-rust-mozprofile-directories-when-i-use-selenium-webdrive/49817725 – pLumo Feb 02 '21 at 15:11
  • 1
    "I need to free up some space" /tmp/ is not going to get you a lot of free space PLUS it will fill up again in no time. Look elsewhere if you need to free up space. Start with /var/log/ and see if you can delete old logs and if those logs are rotated. – Rinzwind Feb 02 '21 at 15:12
  • @SAndrew Please verify that it is indeed /tmp that is eating up your disk space and add the information to your question, see https://askubuntu.com/questions/911865/no-more-disk-space-how-can-i-find-what-is-taking-up-the-space – pLumo Feb 02 '21 at 15:16
  • Please explain where you are in need of space. Maybe the output of df -h could be helpful. – Soren A Feb 02 '21 at 15:23

1 Answers1

1

As already mentioned in the comments, /tmp is cleared automatically on reboot. If you plan to keep your computer running for long time (several days) without reboot, it may be reasonable to install tmpreaper package. It will automatically clean your /tmp directory from files that haven't been used longer than a preconfigured time.

raj
  • 10,353