maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Nokia N810 (https://talk.maemo.org/forumdisplay.php?f=28)
-   -   Phantom space usage in apt cache (https://talk.maemo.org/showthread.php?t=43751)

nowave7 2010-02-08 11:16

Phantom space usage in apt cache
 
I'm experiencing some strange behavior running du -h in /var/cache/apt.
It states that the there is 18MB used, but I can not find any files(or directories) that take up that much space. Here is what I mean:

Code:

Nokia-N810-43-7:/var/cache/apt# ls -lah
drwxr-xr-x    3 root    root            0 Feb  8 11:54 .
drwxr-xr-x    5 root    root            0 Dec  4  2008 ..
drwxr-xr-x    3 root    root            0 Feb  8 11:54 archives
-rw-r--r--    1 root    root        2.5M Feb  8 11:54 pkgcache.bin
-rw-r--r--    1 root    root        2.5M Feb  8 11:26 srcpkgcache.bin
Nokia-N810-43-7:/var/cache/apt# du -h | sort -n -k1
0      ./archives
0      ./archives/partial
18.5M  .
Nokia-N810-43-7:/var/cache/apt#

According to this, there seems to be some 13MB unaccounted for. Any ideas?

Rob1n 2010-02-08 11:32

Re: Phantom space usage in apt cache
 
There was a bug prior to PR1.1 (I thought it had been fixed though), where deleted package files weren't properly cleared up until after a reboot. This could be related to that - the file has been deleted, so doesn't show up in ls, but is being held open, so continues to occupy space in the directory as reported by du.

spanner 2010-02-08 11:37

Re: Phantom space usage in apt cache
 
"ls -lah" doesn't recurse.

The directory "archives", in itself doesn't take up any space. Its 13Mb of contents will be picked up by "du" but not by "ls".

nowave7 2010-02-08 11:38

Re: Phantom space usage in apt cache
 
@Rob1n

Ah, yes, you were right. Rebooted the device and there really are only 5MB of data occupied. Thank you very much!

spanner 2010-02-08 11:39

Re: Phantom space usage in apt cache
 
Quote:

Originally Posted by Rob1n (Post 515981)
the file has been deleted, so doesn't show up in ls, but is being held open, so continues to occupy space in the directory as reported by du.

This kind of file doesn't have a parent directory, so "du" won't find it. "df" will, though.

nowave7 2010-02-08 11:40

Re: Phantom space usage in apt cache
 
Quote:

Originally Posted by spanner (Post 515998)
"ls -lah" doesn't recurse.

The directory "archives", in itself doesn't take up any space. Its 13Mb of contents will be picked up by "du" but not by "ls".

True, but took a look in the archives folder and it was empty.
What Rob1n said, helped. It seems that the bug is still present.

TA-t3 2010-02-08 13:14

Re: Phantom space usage in apt cache
 
Quote:

Originally Posted by Rob1n (Post 515981)
There was a bug prior to PR1.1 (I thought it had been fixed though), where deleted package files weren't properly cleared up until after a reboot.

What's technically happening is that there is an application keeping the file(s) there open. Deleted files aren't physically removed from the filesystem until the last process which had opened the file closes it. Reboot will of course close the process, thus freeing the space. But if you can identify the active process then it would be enough to kill, or otherwise terminate the offending process.

nowave7 2010-02-08 23:22

Re: Phantom space usage in apt cache
 
Quote:

Originally Posted by TA-t3 (Post 516177)
What's technically happening is that there is an application keeping the file(s) there open. Deleted files aren't physically removed from the filesystem until the last process which had opened the file closes it. Reboot will of course close the process, thus freeing the space. But if you can identify the active process then it would be enough to kill, or otherwise terminate the offending process.

Ok, thanks, will keep that in mind for future reference.


All times are GMT. The time now is 17:58.

vBulletin® Version 3.8.8