Mailinglist Archive: opensuse (1239 mails)

< Previous Next >
Re: [opensuse] Odd results from df
On June 14, 2013 at 8:53 AM Otto Rodusek <otto@xxxxxxxxxxxxxx> wrote:
rsgpfp0002:~ # df -vh
Filesystem Size Used Avail Use% Mounted on
/dev/sda3 25G 4.5G 19G 19% /
/dev/sda4 891G 759G 87G 90% /public

rsgpfp0002:~ # df -v
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/sda3 25806716 4626136 19869656 19% /
/dev/sda4 933396656 795685260 90297588 90% /public

If I look at /dev/sd3 (25G - 4.5G does not equal 19G - I expect to get
20.5G!!!) or /dev/sda4 (891G - 759G does not equal 87G - I expect to get
132G!!!!), the numbers are way off!!!!!

Has anyone seen this before, and where has all my disk space gone to??

Df's -h option is short for --human-readable and equivalent to
--block-size=human-readable. According to the Texinfo manual
("info coreutils 'df invocation'"), each non-integer number is
rounded up to the next higher unit.

AFAIR the same question arrived the upstream coreutils mailing
list last year, and the answer was that this is mandated by
POSIX [1]:

... all quantities ... shall be rounded up to the next higher unit.

You get the weidest results when using astronomic block sizes,

$ df -BE /
Filesystem 1E-blocks Used Available Use% Mounted on
/dev/sda3 1E 1E 1E 29% /


Have a nice day,
To unsubscribe, e-mail: opensuse+unsubscribe@xxxxxxxxxxxx
To contact the owner, e-mail: opensuse+owner@xxxxxxxxxxxx

< Previous Next >