Index | Thread | Search

From:
Job Snijders <job@bsd.nl>
Subject:
Re: make 'df -hi' more human readable
To:
Theo de Raadt <deraadt@openbsd.org>
Cc:
tech@openbsd.org
Date:
Thu, 8 Jan 2026 14:38:49 +0000

Download raw body.

Thread
  • ASOU Masato:

    make 'df -hi' more human readable

  • On Wed, Jan 07, 2026 at 08:00:17AM -0700, Theo de Raadt wrote:
    > > With fmt_scaled(1) the df utility reports 37 million fewer inodes
    > > than actually are available, and worse, it reports 400K more inodes
    > > than actually are in use. In larger file system the deviation
    > > matters.
    > 
    > It is obviously better if it rounds DOWN, than if it rounds UP.
    > 
    > If it rounds down, your eyeball measure will be short at runtime.
    
    My apologies, I typed 'more' where I should've typed 'less'.
    
    Perhaps underreporting the number of free inodes is tolerable, but it
    seems an unnecessary complication when the utility underreports the
    number of USED inodes.
    
    I looked into improving at least the column alignment (without applying
    any scaling to the numbers), but gave up on that direction because
    widening the 'iused' and 'ifree' columns even further seems just a
    stopgap measure as disks are becoming larger and larger (and perhaps
    worse, widening those columns takes away from space on the same line
    that probably better is used for printing the mountpoint).
    
    Having considered various alternatives, I really think it is best to
    scale a decimal number as a decimal number and use this diff
    https://marc.info/?l=openbsd-tech&m=176778893806944&w=2
    
    Kind regards,
    
    Job
    
    
  • ASOU Masato:

    make 'df -hi' more human readable