[tlbuild] Spurious warning about insufficient disk space

Karl Berry karl at freefriends.org
Tue Feb 21 23:48:36 CET 2023


Hi Marc,

    Looks like the available space is divided by 2. 

Yes, something is clearly awry.

       By default, all sizes are reported in 512-byte block counts.

Yes. That's what's expected. The command we actually run is:
  POSIXLY_CORRECT=1 df -P /tl/install/dir
which is supposed to do everything possible to get 512-byte blocks.
(GNU df defaults to 1024-byte blocks, not that that's relevant for you.)

What is the output of that command?

Also, if you run install-tl -v, some debug lines should be output, like:

Installing to: /tmp/ki
D:checking diskfree() in /tmp/ki/
D:diskfree: used=135130632 (512-block), avail=284092928 (512-block)

These numbers seem correct for my filesystem.

The code (in TLUtils.pm) looks like this:
  debug("checking diskfree() in $td\n");
  ($output, $retval) = run_cmd("df -P \"$td\"", POSIXLY_CORRECT => 1);
  if ($retval == 0) {
    # Output format should be this:
    # Filesystem      512-blocks       Used  Available Capacity Mounted on
    # /dev/sdb3       6099908248 3590818104 2406881416      60% /home
    my ($h,$l) = split(/\n/, $output);
    my ($fs, $nrb, $used, $avail, @rest) = split(' ', $l);
    debug("diskfree: df -P output: $output");
    debug("diskfree: used=$used (512-block), avail=$avail (512-block)\n");
    # $avail is in 512-byte blocks, so we need to divide by 2*1024 to
    # obtain Mb. Require that at least 100M remain free.
    return (int($avail / 2048));
  } else {
    # error in running df -P for whatever reason
    return (-1);
  }

Thanks,
Karl


More information about the tlbuild mailing list.