Skip to content
  • Mike Fleetwood's avatar
    Don't show intrinsic unallocated space (#499202) · 7ebedc4b
    Mike Fleetwood authored and Curtis Gedak's avatar Curtis Gedak committed
    Most file systems report intrinsic unallocated space using the statvfs()
    system call when mounted, but not using their own tools.  They are:
    ext2/3/4, fat16/32, hfs, nilfs2, reiserfs and xfs.  Showing either a
    little or no unallocated space, depending on whether a file system is
    mounted or not, could be confusing to the user.
    
    When all file systems are created filling their partitions the unused
    figure reported by statvfs() and their own tools are the same or very
    close.  Also the used plus unallocated figure from statvfs() agrees with
    the used figure from their own tools.
    
    For all file systems don't display intrinsic unallocated space (that
    below the threshold of 2 to 5%), instead include it as used space.  As
    soon as the amount of unallocated space becomes significant display it
    everywhere and also trigger the warning.
    
    For display purposes always use the new Partition methods:
    get_sectors_used(), get_sectors_unused(), and get_sectors_unallocated().
    When calculating new usage figures during Paste and Resize/Move
    operations directly access sectors_used, sectors_unused and
    sectors_unallocated members.
    
    Bug #499202 - gparted does not see the difference if partition size
                  differs from filesystem size
    7ebedc4b