[ubuntu-uk] df and du give different results

Stuart Bird e_tective at yahoo.co.uk
Thu Jan 3 19:34:21 GMT 2008


I have just done some testing as promised with the hidden trash folder on my ntfs drive and found that both df -h and du -hs /* did not report the changes in file sizes on the /media volume until I manually deleted the files from it (therefore it would appear that both commands respond to changes in hidden files at least when files are deleted from them). However they were consistently 0.9 Gb adrift in the sizes they were reporting despite the fact that the folder I was using for testing was a little under 300 Mb.

I am going to do some more testing as this happens to have some bearing on my line of work. I will post back if I come up with anything significant/relevant/interesting.

If anyone out there can provide a full explanation of why/how this occurs I would be very interested. I am sad enough that I find this kind of thing fascinating :-) 

I hope you resolve your issue soon.


----- Original Message ----
From: Alan Pope <alan at popey.com>
To: British Ubuntu Talk <ubuntu-uk at lists.ubuntu.com>
Sent: Thursday, 3 January, 2008 6:33:38 PM
Subject: Re: [ubuntu-uk] df and du give different results

On Thu, 2008-01-03 at 12:49 +0000, Chris Rowson wrote:
> Now that just doesn't add up.
> Please help me :-O

du counts disk space used at a block level and not accurately counted
bytes. There is a -b parameter which gives the more realistic apparent
size of files.

Also du doesn't by default count hidden files. 

You're also counting /proc and /dev which aren't really directories
files in on disk.


Support the World Aids Awareness campaign this month with Yahoo! For Good http://uk.promotions.yahoo.com/forgood/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://lists.ubuntu.com/archives/ubuntu-uk/attachments/20080103/42291723/attachment.htm 

More information about the ubuntu-uk mailing list