You are not logged in.

#1 2013-03-17 10:33:35

mibadt
Member
Registered: 2009-09-25
Posts: 396

/var/tmp full with systemd-private* directories

Hi,
I'm running a fully updated Arch_64/KDE with a separate 6.2 GB /var partition.
Recently, I've noticed my /vat almost full, and it's not the pacman cache!
Searching (look below) I've found /var/tmp to be filled with many directories, all of them with names beginning with "systemd-private".

1. is this OK?
2. Can I (as root) safely delete all those folders (inc. contents) to regain my /var space?

Thanks


-----------copy of terminal output--------------

# pwd

/var

[root@Miki_Arch var]# ls -l

total 1832

drwxr-xr-x     7 root root     4096 Jul 20  2012 cache
drwxr-xr-x     3 root root     4096 Jan 28 11:41 db
drwxr-xr-x     2 root root     4096 Jun 20  2012 empty
drwxrwxr-x     2 root games    4096 Mar 14 21:20 games
drwxr-xr-x    24 root root     4096 Mar 16 08:53 lib
drwxr-xr-x     2 root root     4096 Mar 14 21:20 local
lrwxrwxrwx     1 root root       11 Mar 14 21:20 lock -> ../run/lock
drwxr-xr-x     7 root root     4096 Mar 17 09:32 log
drwx------     2 root root    16384 Jul 20  2012 lost+found
lrwxrwxrwx     1 root root       10 Mar 14 21:20 mail -> spool/mail
drwxr-xr-x     2 root root     4096 Mar 14 21:20 opt
lrwxrwxrwx     1 root root        6 Mar 14 21:20 run -> ../run
drwxr-xr-x     6 root root     4096 Mar 16 08:53 spool
drwxrwxrwt 39193 root root  1818624 Mar 17 09:41 tmp

Best regards,
Michael Badt

Offline

#2 2013-03-17 10:58:40

65kid
Member
From: Germany
Registered: 2011-01-26
Posts: 663

Re: /var/tmp full with systemd-private* directories

mibadt wrote:

1. is this OK?

yes, they are part of systemds' PrivateTmp feature.

mibadt wrote:

2. Can I (as root) safely delete all those folders (inc. contents) to regain my /var space?

no, these are not supposed to be deleted. Are you sure these directories actually waste space? On my systems all of them are empty.

Offline

#3 2013-03-17 11:01:27

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,731
Website

Re: /var/tmp full with systemd-private* directories

Offline

#4 2013-03-17 12:28:42

mibadt
Member
Registered: 2009-09-25
Posts: 396

Re: /var/tmp full with systemd-private* directories

Thanks all!
One more question:
df -h reports that of the 6.8 available for /var, 6.2 GB is used (see below).
Yet the largest (/var) sub-directory is the tmp which uses only 1.8GB which is WAY SMALLER than the 6.2GB reported above.
Can somebody explain me what's "eating" my /var space?

Thanks!

--------------copy of terminal-----------

[root@Miki_Arch /]# df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/sda2        12G  5.8G  5.2G  53% /
dev             3.9G     0  3.9G   0% /dev
run             3.9G  6.7M  3.9G   1% /run
tmpfs           3.9G  904K  3.9G   1% /dev/shm
tmpfs           3.9G     0  3.9G   0% /sys/fs/cgroup
/dev/sda3       1.1T 1002G   26G  98% /home
tmpfs           3.9G   64K  3.9G   1% /tmp
/dev/sdb1        74G   59G   15G  81% /windows
/dev/sda1        46M   30M   14M  70% /boot
/dev/sdb6       6.8G  6.2G  204M  97% /var
/dev/sda7        64G   47G   17G  74% /images_sda
/dev/sdb2        49G   38G   11G  78% /lin_back
/dev/sdb3       1.3T  789G  471G  63% /photos
[root@Miki_Arch /]# cd /var
[root@Miki_Arch var]# ls -al
total 1840
drwxr-xr-x    13 root root     4096 Mar 16 08:53 .
drwxr-xr-x    27 root root     4096 Mar 16 08:53 ..
drwxr-xr-x     7 root root     4096 Jul 20  2012 cache
drwxr-xr-x     3 root root     4096 Jan 28 11:41 db
drwxr-xr-x     2 root root     4096 Jun 20  2012 empty
drwxrwxr-x     2 root games    4096 Mar 14 21:20 games
drwxr-xr-x    24 root root     4096 Mar 16 08:53 lib
drwxr-xr-x     2 root root     4096 Mar 14 21:20 local
lrwxrwxrwx     1 root root       11 Mar 14 21:20 lock -> ../run/lock
drwxr-xr-x     7 root root     4096 Mar 17 10:23 log
drwx------     2 root root    16384 Jul 20  2012 lost+found
lrwxrwxrwx     1 root root       10 Mar 14 21:20 mail -> spool/mail
drwxr-xr-x     2 root root     4096 Mar 14 21:20 opt
lrwxrwxrwx     1 root root        6 Mar 14 21:20 run -> ../run
drwxr-xr-x     6 root root     4096 Mar 16 08:53 spool
drwxrwxrwt 39193 root root  1818624 Mar 17 14:18 tmp

Best regards,
Michael Badt

Offline

#5 2013-03-17 12:52:00

65kid
Member
From: Germany
Registered: 2011-01-26
Posts: 663

Re: /var/tmp full with systemd-private* directories

mibadt wrote:

Thanks all!
One more question:
df -h reports that of the 6.8 available for /var, 6.2 GB is used (see below).
Yet the largest (/var) sub-directory is the tmp which uses only 1.8GB which is WAY SMALLER than the 6.2GB reported above.
Can somebody explain me what's "eating" my /var space?

Thanks!

--------------copy of terminal-----------

[root@Miki_Arch /]# df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/sda2        12G  5.8G  5.2G  53% /
dev             3.9G     0  3.9G   0% /dev
run             3.9G  6.7M  3.9G   1% /run
tmpfs           3.9G  904K  3.9G   1% /dev/shm
tmpfs           3.9G     0  3.9G   0% /sys/fs/cgroup
/dev/sda3       1.1T 1002G   26G  98% /home
tmpfs           3.9G   64K  3.9G   1% /tmp
/dev/sdb1        74G   59G   15G  81% /windows
/dev/sda1        46M   30M   14M  70% /boot
/dev/sdb6       6.8G  6.2G  204M  97% /var
/dev/sda7        64G   47G   17G  74% /images_sda
/dev/sdb2        49G   38G   11G  78% /lin_back
/dev/sdb3       1.3T  789G  471G  63% /photos
[root@Miki_Arch /]# cd /var
[root@Miki_Arch var]# ls -al
total 1840
drwxr-xr-x    13 root root     4096 Mar 16 08:53 .
drwxr-xr-x    27 root root     4096 Mar 16 08:53 ..
drwxr-xr-x     7 root root     4096 Jul 20  2012 cache
drwxr-xr-x     3 root root     4096 Jan 28 11:41 db
drwxr-xr-x     2 root root     4096 Jun 20  2012 empty
drwxrwxr-x     2 root games    4096 Mar 14 21:20 games
drwxr-xr-x    24 root root     4096 Mar 16 08:53 lib
drwxr-xr-x     2 root root     4096 Mar 14 21:20 local
lrwxrwxrwx     1 root root       11 Mar 14 21:20 lock -> ../run/lock
drwxr-xr-x     7 root root     4096 Mar 17 10:23 log
drwx------     2 root root    16384 Jul 20  2012 lost+found
lrwxrwxrwx     1 root root       10 Mar 14 21:20 mail -> spool/mail
drwxr-xr-x     2 root root     4096 Mar 14 21:20 opt
lrwxrwxrwx     1 root root        6 Mar 14 21:20 run -> ../run
drwxr-xr-x     6 root root     4096 Mar 16 08:53 spool
drwxrwxrwt 39193 root root  1818624 Mar 17 14:18 tmp

the number you see is in bytes, meaning that /var/tmp is actually 1,8MB, not GB. This number does not represent the size of the actual directory including its content. It's only the number of bytes the directory itself uses on the filesystem (or something like that, I'm not sure how exactly this value is calculated, I think this depends on the filesystem as well).
If you want to know what actually uses all that space, you better use something like "du":

# du -sh /var/*
44M	/var/abs
393M	/var/cache
44K	/var/db
0	/var/empty
0	/var/games
22M	/var/lib
0	/var/local
4,0K	/var/lock
291M	/var/log
4,0K	/var/mail
0	/var/opt
4,0K	/var/run
0	/var/spool
0	/var/tmp

Offline

#6 2013-03-17 18:55:39

teateawhy
Member
From: GER
Registered: 2012-03-05
Posts: 1,138
Website

Re: /var/tmp full with systemd-private* directories

My guess is that the pacman cache in /var/cache/pacman/pkg has been growing in size since you installed arch.
Try this:
https://aur.archlinux.org/packages/cacheclean

Last edited by teateawhy (2013-03-17 18:59:32)

Offline

#7 2013-03-17 19:18:13

Xyne
Forum Fellow
Registered: 2008-08-03
Posts: 6,965
Website

Re: /var/tmp full with systemd-private* directories

Install "ncdu" from [community]. It will show how much space each directory is taking and let you navigate to the files that are responsible for most of it.

As for the systemd empty folder spam in /var/tmp, you can create the following file to get rid of them:

/etc/tmpfiles.d/remove-empty-dirs_var-timp.conf

r /var/tmp/* - - - 1d -

I've had that on my system for months without any issue and it keeps my /var/tmp nice and clean.


My Arch Linux StuffForum EtiquetteCommunity Ethos - Arch is not for everyone

Offline

#8 2013-03-17 19:26:44

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: /var/tmp full with systemd-private* directories

teateawhy wrote:

My guess is that the pacman cache in /var/cache/pacman/pkg has been growing in size since you installed arch.
Try this:
https://aur.archlinux.org/packages/cacheclean

There is actually a nice script in pacman-contrib that has this functionality.  No need for cacheclean anymore.  I mean, of course you're welcome to continue using that, but I used to use it, and I find that paccache is far superior in its functionality.  Its up to you though.

Offline

#9 2013-03-17 20:36:28

teateawhy
Member
From: GER
Registered: 2012-03-05
Posts: 1,138
Website

Re: /var/tmp full with systemd-private* directories

Yes, paccache is better.

Offline

#10 2013-03-17 21:14:48

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,731
Website

Re: /var/tmp full with systemd-private* directories

+1 for paccache which I just discovered here in this thread smile

Offline

Board footer

Powered by FluxBB