github shundhammer/qdirstat 1.7
New QDirStat Release: 1.7

latest releases: 1.9, 1.8.1, 1.8...
3 years ago

Overview

The QDirStat project proudly presents its latest release: QDirStat 1.7.

This is a stable release. It brings a number new features and some bug fixes:

  • Closing the gap between sizes reported by QDirstat and sizes reported by the du command: Now also taking the allocated size into account.

  • Now also displaying the allocated size where it makes sense.

  • New "Mounted Filesystems" window showing output similar to the df command (but without the cruft).

  • New directory selection dialog showing all (real) filesystems.

  • New checkbox to cross filesystems (temporarily) in the directory selection dialog.

  • Workaround for NTFS oddities: Ignoring hard links on NTFS.

  • Added config option to ignore hard links in general.

  • Added a document about Btrfs free size and how different tools tend to show different values:
    Btrfs-Free-Size.md

  • Bug fixes

Details

Closing the Gap Between QDirstat and the "du" Command

QDirStat now also takes the allocated size (the number of allocated disk blocks) into account.

There were repeated threads on various social media where users wondered why QDirStat displayed different sizes than the du or the df commands, sometimes slightly different, sometimes off by quite a lot.

In short, this is mostly due to the difference between a file's byte size and its allocated blocks: On most filesystem types, a file of 49 bytes still consumes a minimum of 4 KB (4096 bytes); disk space is allocated in clusters (typically 4 KB), not byte by byte. On a typical Linux root filesystem with many thousands of tiny files, this difference can add up to a lot.

Formerly, QDirStat only added up the byte sizes, disregarding the allocated, but really unused part at the end of tiny files. The rationale was that some filesystem types handle that in more intelligent ways, yet there is no documented way to get information from a filesystem if it actually does that. It turned out that in reality, most of them don't bother; they simply let most of that last cluster go to waste.

Now QDirStat displays both sizes where useful:

  • For tiny files, the tree view now shows both sizes: "49 B (4k)"

  • For directories, the tree view now shows the total of the allocated sizes. This may sound a bit inconsistent, but it feels very natural and intuitive: You are typically interested in how much disk space the subtree consumes, no matter if some part of that is really wasted.

  • The details view shows both sizes when there is a difference (in the displayed numeric precision): "Size: 42.1 MB" vs. "Allocated: 42.2 MB", but not "Size: 42.0 MB" vs. "Allocated: 42.0 MB".

  • Treemap tiles now correspond to a file's allocated size. This makes a real difference for tiny files.

More details at GitHub Issue #134: Size Difference between QDirStat Reports and the "du" and "df" Commands.

New "Mounted Filesystems" Window

Menu "View" -> "Show Mounted Filesystems" or Ctrl-M:

This shows information about "normal" mounted filesystems (excluding system mounts like /dev, /proc, /sys, bind mounts, Btrfs subvolumes) with usage data as reported by the filesystem itself. The "Reserved" column shows the disk space reserved for the root user on that filesystem, "Free" is the available space for non-privileged users.

Sometimes the "Used" size reported here may be different from what QDirStat reports after reading that complete filesystem; this can be due to metadata, journals or snapshots. Notice that in those cases, the du command will also display a different value than the df command.

New Directory Selection Dialog

QDirStat now has its own custom directory selection dialog; it no longer uses one of the simplistic Qt standard file dialogs:

The "Places" bar on the left shows your home directory and all "real" filesystems (the same as in the new "Mounted Filesystems" window). For each filesystem, it shows

  • The mount point
  • The total size of the filesystem
  • The filesystem type ("ext4", "btrfs", "ntfs", ...)
  • The device name ("/dev/sda2") (in a tooltip)

In the "Path" combo box you can simply edit the path or copy and paste it from another window. Use the "Up" button to move one directory level up.

Crossing Filesystems Temporarily

The "Cross Filesystems" checkbox lets you temporarily override the global configuration option of the same name: QDirStat will then no longer stop when a mount point is found during reading a subtree, it will descend into that mounted filesystem and read it, too; but again, only for "real" filesystems, not for system mounts such as /dev, /sys, /proc, not for bind mounts, not for filesystems mounted multiple times, and not for network mounts (NFS, Samba / CIFS).

More details at GitHub Issue #129.

NTFS File Sizes and Hard Links

Added a workaround for wrong size sums on NTFS: Now disregarding hard links on NTFS.

The (current?) ntfs-3g implementation using fuseblk seems to disagree with Windows tools which files really have hard links.

It appears that ntfs-3g regards even the MS-DOS compatible short filename (PROGRA~2 vs. Program Files) as a hard link which is of course utter nonsense; that means that almost all files on an NTFS partition are reported as having multiple hard links, so QDirStat displayed them as having only half their real size.

Notice that this is a bug in ntfs-3g, not in QDirStat.

See also GitHub Issue #88.

Completely Ignore Hard Links

Added a config option to ignore hard links.

This is useful for a very small number of use cases. Hard links are not very common anymore in today's Linux / BSD / Unix-like systems, so most users won't have to bother with this at all.

By default, QDirStat sums up the disk space for a file with multiple hard links for each hard link's share of the overall size: If a file with 1 MB has 4 hard links, for each of those 4 links QDirStat adds 1/4 of the size (i.e., 256 kB) to the parent directory. If all those 4 links are in the same directory, that's very simple: They add up to 4 * 256 kB = 1 MB, so the sum is correct.

If those hard links are all in different directories, each directory only gets part of that disk space allocated, because in fact they share the disk space among each other; the total disk space sum taking all those directories into account is still correct, of course.

The trouble starts when you want to make a backup of only one of those directories: Even though the disk space is still shared with other directories, on the backup medium, you still need the disk space for that complete file, i.e. the full 1 MB, not only that directory's share (256 kB). With a lot of hard-linked files, that can add up to a lot of difference between what QDirStat displays and what disk space you actually need for the backup.

There was a user who makes heavy use of that, and for that kind of use case there is now the option to ignore hard links: In that case, QDirStat sums up the complete size (the full 1 MB) for each hard link of the file.

While that is useful for this special case, and you can now see the total size that you will need for your backup medium for that one directory, the total size higher up in the directory tree where more than one of those directories that share hard linked files with each other is off: That file now appears 4 times with 1 MB each, so it will add up to 4 MB.

There is now a new config option in ~/.config/QDirStat/QDirStat.conf:

[DirectoryTree]
...
IgnoreHardLinks=false

This is intentionally not available in the GUI config dialog to avoid confusion; use a text editor (while QDirStat is not running) to change this setting.

Please use that config option only when you are aware of the consequences; this is a specialized option for rare, specialized use cases. It basically makes sense only if the other hard links are all outside the subtree that QDirStat displays.

More details at GitHub Issue #124.

New Document about Btrfs Free Size

There is now a new document about Btrfs free size and how different tools tend to show different values: Btrfs-Free-Size.md

Whenever users run out of disk space on Btrfs (which happens a lot, mostly because of snapshots) and they try to figure out where all their disk space went, they are confused about different tools reporting totally different and inconsistent sizes; traditional Linux / Unix command line tools like du and df just like GUI tools like QDirStat. Hopefully, this document will shed some light on that.

Bug Fixes

  • Fixed the internal cache writer (the one called from the File menu, not the qdirstat-cache-writer Perl script): For files with multiple hard links, it wrote the wrong size to the cache file: The result of size / links, not size.

    This was part of GitHub Issue #124.

  • Fixed crash when terminating with Ctrl-Q while reading directories
    (GitHub Issue #122).

  • Now automatically reopening the old current branch in the tree view when using actions like "refresh selected" and "continue reading at mount point
    (GitHub Issue #135).

  • Not a bug, but a minor new feature: Now automatically expanding the first directory level of a mount point after "continue reading at mount point".

  • Now correctly labelling a mount point as mount point in the "Details" panel.

Don't miss a new qdirstat release

NewReleases is sending notifications on new releases.