mirror of
https://github.com/bootandy/dust.git
synced 2026-06-08 11:29:05 +03:00
[GH-ISSUE #517] show amount of disk space used by files with zero hardlinks #226
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @lolbinarycat on GitHub (Jul 11, 2025).
Original GitHub issue: https://github.com/bootandy/dust/issues/517
unlinked files generally occur one of two ways:
I recently encountered a situation where tmpfs got filled up by a logfile, and then removing the logfile did not actually free up any space, because the program was still holding the fd of the logfile.
These files are not seen by programs like
du, however,dfis able to see the total amount of space used on a drive, including unlinked files, so simple subtraction could be used to see how much of the disk is taken up by unlinked files.@bootandy commented on GitHub (Jul 11, 2025):
is this the same as: https://github.com/bootandy/dust/issues/444 ?
@lolbinarycat commented on GitHub (Jul 11, 2025):
Similar, but I'm proposing a much simpler solution: just ask the fs for the total used space (like how
dfdoes), then subtracting the size of named files from that, and displaying that number if it is significant.@bootandy commented on GitHub (Aug 13, 2025):
Can you tell me how I can create that situation - I need to be able to create it before I can process it. - Some method of creating and removing files/symlinks ? (I have ext4 and tmpfs).
@lolbinarycat commented on GitHub (Aug 13, 2025):
symlinks have nothing to do with this.
you can either use O_TMPFILE, or you can create a file, open it, then delete it while holding the file descriptor. in both cases the file will only stay alive while the fd lives, which means having a process stay running while you're testing.