Reply
Thread Tools
nowave7's Avatar
Posts: 245 | Thanked: 62 times | Joined on Jan 2009 @ Bad Homburg, Deutschland
#1
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?
__________________
Save the whales, feed the hungry, free the mallocs!
 
Posts: 3,617 | Thanked: 2,412 times | Joined on Nov 2009 @ Cambridge, UK
#2
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.
 

The Following User Says Thank You to Rob1n For This Useful Post:
spanner's Avatar
Posts: 253 | Thanked: 184 times | Joined on Nov 2009 @ Bristol, UK
#3
"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's Avatar
Posts: 245 | Thanked: 62 times | Joined on Jan 2009 @ Bad Homburg, Deutschland
#4
@Rob1n

Ah, yes, you were right. Rebooted the device and there really are only 5MB of data occupied. Thank you very much!
__________________
Save the whales, feed the hungry, free the mallocs!
 
spanner's Avatar
Posts: 253 | Thanked: 184 times | Joined on Nov 2009 @ Bristol, UK
#5
Originally Posted by Rob1n View Post
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's Avatar
Posts: 245 | Thanked: 62 times | Joined on Jan 2009 @ Bad Homburg, Deutschland
#6
Originally Posted by spanner View Post
"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.
__________________
Save the whales, feed the hungry, free the mallocs!
 
Posts: 3,841 | Thanked: 1,079 times | Joined on Nov 2006
#7
Originally Posted by Rob1n View Post
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.
__________________
N800/OS2007|N900/Maemo5
-- Metalayer-crawler delenda est.
-- Current state: Fed up with everything MeeGo.
 

The Following User Says Thank You to TA-t3 For This Useful Post:
nowave7's Avatar
Posts: 245 | Thanked: 62 times | Joined on Jan 2009 @ Bad Homburg, Deutschland
#8
Originally Posted by TA-t3 View Post
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.
__________________
Save the whales, feed the hungry, free the mallocs!
 
Reply


 
Forum Jump


All times are GMT. The time now is 18:34.