On 14/6/13 3:41 PM, Bernhard Voelker wrote:
On June 14, 2013 at 8:53 AM Otto Rodusek <otto@applied.com.sg> 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, e.g.:
$ df -BE / Filesystem 1E-blocks Used Available Use% Mounted on /dev/sda3 1E 1E 1E 29% /
[1] http://pubs.opengroup.org/onlinepubs/007904875/utilities/df.html
Have a nice day, Berny
***OOPS*** sorry for the previous top posting reply!! *** Hi Berny, Thanks for the reply. I'm not sure I understand tho. I know what you mean by "human-readable" and "each non-integer number is rounded up to the next higher unit." but the numbers are so way off. For example - df --block-size=1K Filesystem 1K-blocks Used Available Use% Mounted on devtmpfs 2983260 32 2983228 1% /dev tmpfs 2998284 0 2998284 0% /dev/shm tmpfs 2998284 17844 2980440 1% /run /dev/sda3 25806716 4626964 19868828 19% / tmpfs 2998284 0 2998284 0% /sys/fs/cgroup tmpfs 2998284 17844 2980440 1% /var/lock tmpfs 2998284 17844 2980440 1% /var/run /dev/sda1 159564 128 159436 1% /boot/efi /dev/sda4 933396656 795692408 90290440 90% /public Let's look at /dev/sda4 ( if I take 933,396,565 - 795,692,408 I get and expect to get 137,704,248 and not the reported 90,290,440 a difference of 47GB!!!!). If that is the case with df, how does one get a "reasonable" size of used and available space?? This is rather confusing as the numbers are so far apart!! Otto. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org