Re:Show HN: Dut, a fast Linux disk usage calculator
by kstrauser on Thursday July 11, 2024 @01:28AM
(#40933919)
And it would know they did not change without scanning them because how?
[ Parent
| on HN ]
Re:Show HN: Dut, a fast Linux disk usage calculator
by svpg on Thursday July 11, 2024 @01:42AM
(#40933967)
It could hash the contents of a dir. Along the lines of git
Re:Show HN: Dut, a fast Linux disk usage calculator
by Galanwe on Thursday July 11, 2024 @01:57AM
(#40934012)
Except hashing requires... reading.
There is not much to be done here. Directories entries are just names, no guarantees that the files were not modified or replaced.
The best you could do is something similar to the strategies of rsync, rely on metadata (modified date, etc) and cross fingers nobody did `cp -a`.
Re:Show HN: Dut, a fast Linux disk usage calculator
by shellfishgene on Thursday July 11, 2024 @02:23AM
(#40934101)
I would be fine with the latter, the program could display a warning like "Results may be inaccurate, full scan required" or something.
I guess I'm just annoyed that for Windows/NTFS really fast programs are available but not for Linux filesystems.
Re:Show HN: Dut, a fast Linux disk usage calculator
by legends2k on Thursday July 11, 2024 @01:57AM
(#40934013)
And to hash something needs reading all of its data. I think deducing the file size would actually be faster in some file systems and never slower with any.
Re:Show HN: Dut, a fast Linux disk usage calculator
by mort96 on Thursday July 11, 2024 @03:19AM
(#40934378)
Faster in all file systems I'd guess, stat is fast, opening the file and reading its contents and updating a checksum is slow, and gets slower the larger the file is.
Re:Show HN: Dut, a fast Linux disk usage calculator
by shellfishgene on Thursday July 11, 2024 @07:08AM
(#40935399)
Maybe it could run in the background and use inotify to just update the database all the time, or at least keep track of what needs rescanning?
Re:Show HN: Dut, a fast Linux disk usage calculator
by shellfishgene on Thursday July 11, 2024 @07:16AM
(#40935441)
Thinking about this some more, does this system not already exist for the disk quota calculation in the kernel? How does that work? Would it be possible for a tool to scan the disk once, and then get information about file modifications from the system that's used to update quota info?