LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   /var/tmp hogging space (https://www.linuxquestions.org/questions/linux-newbie-8/var-tmp-hogging-space-4175571844/)

rbees 02-09-2016 08:04 PM

/var/tmp hogging space
 
Ladies & Gents

Thanks for all the help and guidance given on this site.

I discovered that /var/tmp is just loaded with data hogging space on my / disk partition. Since my partitions are encrypted resizing them is a pain. There were a lot of log files from Opera that I removed, somehow two and three year old crash logs are useless.

There are also a bunch of one and two year old files like
Code:

/var/tmp/mkinitramfs_uOipnE/:
total 40
drwxr-xr-x 6 root root 4096 Nov  8  2014 etc
drwxr-xr-x 2 root root 4096 Nov  8  2014 sbin
drwxr-xr-x 2 root root 4096 Nov  8  2014 bin
drwxr-xr-x 9 root root 4096 Nov  8  2014 lib
drwxr-xr-x 2 root root 4096 Nov  8  2014 lib64
drwxr-xr-x 3 root root 4096 Nov  8  2014 conf
drwxr-xr-x 8 root root 4096 Nov  8  2014 scripts
-rwxr-xr-x 1 root root 7018 Nov  8  2014 init
drwxr-xr-x 2 root root 4096 Nov  8  2014 run

/var/tmp/mkinitramfs_riyL5f/:
total 40
drwxr-xr-x 6 root root 4096 Nov  8  2014 etc
drwxr-xr-x 2 root root 4096 Nov  8  2014 sbin
drwxr-xr-x 2 root root 4096 Nov  8  2014 bin
drwxr-xr-x 9 root root 4096 Nov  8  2014 lib
drwxr-xr-x 2 root root 4096 Nov  8  2014 lib64
drwxr-xr-x 3 root root 4096 Nov  8  2014 conf
drwxr-xr-x 8 root root 4096 Nov  8  2014 scripts
-rwxr-xr-x 1 root root 7018 Nov  8  2014 init
drwxr-xr-x 2 root root 4096 Nov  8  2014 run

There are also a bunch of zero byte files from as much as two years ago like
Code:

| mkinitramfs-FW_ANOax7  │      0│Sep 17 13:28│
│ mkinitramfs-FW_ECQBtb  │      0│Sep 17 16:04│
│ mkinitramfs-FW_GLz7Uu  │      0│Sep 17 13:32│
│ mkinitramfs-FW_Geem7x  │      0│Sep 17 14:10│
│ mkinitramfs-FW_JwIrhB  │      0│Aug 21 17:08│
│ mkinitramfs-FW_OXVgFv  │      0│Jul 19  2015│
│ mkinitramfs-FW_PY6CtQ  │      0│Jul 19  2015

These can't all need to be kept can they? I gather that a lot of them are from update fails because of a lack of drive space to complete the install, which only compounds the problem, or because a package, like virtualbox, fails to complete its install for some reason. At a 170meg apiece for the directories, twenty one of them, it doesn't take long to chew up a bunch of space.

How much of it is safe to remove?

Thanks

rknichols 02-09-2016 08:27 PM

You can certainly get rid of all the mkinitramfs* directories. They are only used when installing a new kernel and really should be deleted automatically once that is done successfully.

To keep things clean in the future, install the tmpreaper package, "Cleans up files in directories based on their age."

frankbell 02-09-2016 08:40 PM

Do you have logrotate installed and working? http://www.debianhelp.co.uk/logwatch.htm

syg00 02-09-2016 09:13 PM

The OP is querying /var/tmp, not /var/log.

/var/tmp is non-permanent (rather than ephemeral like /tmp). If it's been there for what you consider too long, just delete it. And certainly the initramfs stuff can go anytime IMHO.

rbees 02-10-2016 04:43 AM

Thanks,

What about this type of directory? There are also a bunch of them although not as old.

Code:

/systemd-private-f88d44~-daemon.service-iDw68M
The more I think about it I think some of them are a result of KDE failing to launch the gui, which results in me having to ctrl+alt+f? to a different console and reboot leaving stuff behind.

I will check that logrotate is working correctly and look into tmpreaper when I get a chance.

Thanks again

Thanks again


All times are GMT -5. The time now is 03:00 PM.