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.

df reports 16G partition at 100%. du on root reports about 1G in files. Where did all my disk space go?

share|improve this question
add comment

4 Answers

Do you have a large number of very very small files? Linux (and most operating systems) write files in block-sized chunks (say 4k), and every file uses a multiple of that size. For example, if you have a 121 byte file, 4096 bytes are still used on the disk. The rest of the space in that block are essentially "wasted".

share|improve this answer
1  
That accounts for a few megabytes, but not 94% of the partition. –  Justin Love Sep 17 '09 at 22:07
1  
True, except in the extreme case where you have written an out-of-control program that spawns millions of these little files... Been there, done that :( –  Doug Sep 18 '09 at 18:31
add comment

You might have programs running with old unlinked files open. Those files are still stored on disk until those programs close, but will not be linked from the filesystem tree.

Note that this is different from windows behavior, which will not let you delete such a file.

share|improve this answer
add comment

In addition to the wasted space matter that Doug discusses, some file systems have a limited number of inodes (unique file IDs) in total, and once those have been created there is no way to make new files. Use df -i to see where you stand on inodes.

Further, it is possible for ext[23] filesystems (and others?) to reserve a fraction of the disk to the superuser. Normally this is only a few percent (5 is typical on older systems), but it can be set much higher than that. I believe you want to use tune2fs here (Mac OS and possibly other unixes calls this tunefs) with the -m option.

share|improve this answer
add comment
up vote 7 down vote accepted

Files can be hidden by a mount point.

(A scheduled program (backup) must have run while while I had the secondary volume offline for maintenance, and gleefully recreated it's directory structure rather than failing.)

share|improve this answer
    
Ah. Very good. A nice puzzle to show us when we're not as smart as we like to think. –  dmckee Sep 17 '09 at 22:16
add comment

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.