Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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    .

root@SERVER:/home/.root/TMP/tnt/d1/xxx# 
share|improve this question
    
I ran across this same problem today after growing a disk image using qemu-img resize. –  Pete Jul 30 at 14:35

1 Answer 1

up vote 13 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
1  
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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.