2

Why does it show 0 in the available column?

[root@server log]# df
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/sda2              4128448   4096484         0 100% /

It's an ext3 filesystem.

countermode
  • 7,373
  • 5
  • 31
  • 58
101010
  • 713
  • 1
  • 12
  • 18
  • 1
    Just because a question is covered by a broad other question doesn't make my specific question a dupe. If that were true, then we wouldn't need specific laws -- just one "Be nice to people". – 101010 Aug 25 '14 at 17:09
  • I quote: "*when I add the “Used” and “Available” columns of df, I don't get the total figure*". That is exactly what you're asking. – phemmer Aug 25 '14 at 17:10
  • This information has been covered multiple times before; see [What happened to my free space?](http://unix.stackexchange.com/q/2827/80216) and [Why is (free_space + used_space) != total_size in df?](http://unix.stackexchange.com/q/25602/80216) – G-Man Says 'Reinstate Monica' Aug 25 '14 at 17:34

1 Answers1

7

df reports the percentage of used blocks relative to the blocks not reserved for root use (by default I think it's 5% of the drive in ext3). It can be changed by using the -m option of tune2fs e.g. to set it to 2%

tune2fs -m 2 /dev/sdXY

The reserved blocks allow system daemons to keep going even when the disk is full, while non-root processes will not be able to write to it. It also helps reducing drive fragmentation.

pqnet
  • 2,570
  • 1
  • 14
  • 14