Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am downloading a file with rtorrent,

But when i check the folder that the file is located on ,the filesize with ls command is 4.4GB but when i check the disk with du command it shows me 219MB, also the same problem with df command that seems just calculate the 219MB one

Here is the my console result

root@SERVER:/home/.root/TMP/tnt/d1/xxx# dir -alh

total 219M
drwxr-xr-x  2 root root 4.0K 2010-01-10 15:30 .
drwxr-xr-x 15 root root 4.0K 2010-01-10 15:30 ..
-rw-r--r--  1 root root 4.4G 2010-01-11 10:55 yyy.mkv

root@SERVER:/home/.root/TMP/tnt/d1/xxx# du -h

219M    .

share|improve this question
I ran across this same problem today after growing a disk image using qemu-img resize. – Pete Jul 30 '14 at 14:35
up vote 20 down vote accepted

It's a sparse file. ls is reporting the allocated size; du is reporting the amount of space actually used.

As your torrent client downloads more it will fill in the gaps and the du-reported size will grow to match what ls reports.

share|improve this answer
How can i force du and df to include sparces? – user24263 Jan 11 '10 at 7:42
Read man du; the second option listed is --apparent-size. – James Polley Jan 11 '10 at 7:45
my answer is 'du -s -B1 --apparent-size' – user24263 Jan 11 '10 at 7:45

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .