3

I'm running Ubuntu and have had a problem where the root partition has run out of disk space.

When I perform df -h I get the following:

Filesystem            Size  Used Avail Use% Mounted on
/dev/sda6             4.6G  4.5G     0 100% /

Yet there are only 2GB of files actually using up this partition. I then ran the following df -i and I get the following:

Filesystem            Inodes   IUsed   IFree IUse% Mounted on
/dev/sda6             305824  118885  186939   39% /

I have no idea what the -i flag does but it clearly shows that only 39% is used.

Can anyone explain where my disk space has gone?

Camsoft
  • 1,011

4 Answers4

8

You can try:

lsof +L1

to show unlinked files including their sizes and what has them open.

6

You probably have a process keeping a file open that's been deleted. Deleted but open files keep consuming disk space, but don't show up in du or ls. "df -i" is a red herring, it just shows you how many files you have, or more technically, how many inodes.

If you can't figure out what process is holding a big (deleted) file open, and chances are it's a zombie or something hung, it might be time for a reboot.

Paul Tomblin
  • 5,285
3

df -i shows inodes, which is not what you are looking for. Do you have an unusually large block size, maybe 128/256k? If you do, even a 1K file will take up that amount of space.

MDMarra
  • 101,323
2

df -i show how many of your i-nodes you have used, not how much space you have used.

Some Unix/Linux filesystems (you don't say what you use), do have a limit on how many files/i-nodes they can hold in addition to the disk space limit. That means if you have many very small files your filesystem might be full even with space remaining because all i-nodes are used up. To check this you can look at the i-nodes used with the df -i command.

markus_b
  • 421
  • 2
  • 5