View previous topic :: View next topic |
Author |
Message |
Martin_D n00b
Joined: 30 Jan 2008 Posts: 2
|
Posted: Wed Jan 30, 2008 1:43 pm Post subject: Different amount of used disk space shown by df and du |
|
|
Hi,
Last week I had the problem of having no space left on the root-partition. But when i was looking for the reason for it, i was not able to find any files or folders on this partition, which were using the space. After a reboot of the system the space was free again. This was suprising, because I wasn't wiping the /tmp directory at starup. So I watched the develpement of the used space over the last days and found a difference between the output of df and du. Df showed me a constantly rising amount of used disk space, while du didn't. So here is how it looks like:
Code: | pc / # df -h
Dateisystem Größe Benut Verf Ben% Eingehängt auf
/dev/hda5 518M 159M 360M 31% /
udev 10M 156K 9,9M 2% /dev
/dev/hda6 8,1G 5,0G 3,1G 63% /usr
/dev/hda7 2,1G 937M 1,1G 46% /var
/dev/hda8 1,1G 791M 238M 77% /opt
/dev/hda9 5,1G 3,4G 1,7G 68% /home
/dev/hda11 11G 4,7G 6,3G 43% /ccache
shm 251M 0 251M 0% /dev/shm |
Code: |
pc / # du -xh --max-depth=1
4,7M ./bin
0 ./dev
5,4M ./etc
7,3M ./lib
0 ./mnt
512 ./opt
18M ./tmp
0 ./sys
512 ./var
512 ./usr
5,7M ./boot
0 ./home
0 ./proc
6,3M ./sbin
1,6M ./root
4,0K ./media
0 ./service
2,0K ./ccache
0 ./.reiserfs_priv
4,0K ./.links
48M .
|
Is there anybody, who had the same effekts?
I'm using coreutils-6.9-r1 and a 2.6.21-suspend2-r7-kernel. |
|
Back to top |
|
|
Veldrin Veteran
Joined: 27 Jul 2004 Posts: 1945 Location: Zurich, Switzerland
|
Posted: Wed Jan 30, 2008 1:48 pm Post subject: |
|
|
It's normal... read here for details
and please use the search function!
cheers
V. |
|
Back to top |
|
|
frostschutz Advocate
Joined: 22 Feb 2005 Posts: 2977 Location: Germany
|
Posted: Wed Jan 30, 2008 1:49 pm Post subject: |
|
|
df sees available space on a file system, there are many factors to it, including root reserve etc.
du sees only files. files can be hidden completely by mountpoints.
there are many reasons as to why the results would be different. if you want to know the size of visible files, use du, if you want to know the space on a filesystem regardless of actual files use df. |
|
Back to top |
|
|
Martin_D n00b
Joined: 30 Jan 2008 Posts: 2
|
Posted: Wed Jan 30, 2008 2:25 pm Post subject: |
|
|
But if the files are hidden by mountpoints, why was there 450 MB free space after the reboot, without wiping the /tmp-directory? And shortly after the reboot both had the same amount of used space.
During the last 24 hours the amount of used space increased from ~60MB to 165MB, but there were just 20 MB used by files. And I have this problem since i have made the last system update last week. So I was thinking, wheater its a bug, which cause the system to reserve disk space and doesn's release it. |
|
Back to top |
|
|
Hu Administrator
Joined: 06 Mar 2007 Posts: 23069
|
Posted: Thu Jan 31, 2008 3:56 am Post subject: |
|
|
Are you running Konsole with a large scrollback buffer? The behavior you describe is often caused by applications writing large amounts of data to deleted files. The file exists as long as the application keeps it open, so it consumes space even when it has no name. Since it has no name, du cannot find it. When you reboot, you kill the application and reclaim the space. |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|