Live data from Hacker News

Show HN: I missed the moving blocks, so I built a real Linux disk defragmenter

github.com

41–50 of 78 posts

Re: Show HN: I missed the moving blocks, so I built a real Linux disk defragmenter

#41

Earlier quoted context omitted.

Except for some backups, all of my machines use solid state storage so I don't think there is a point for most people, is there?

Sequential reads are faster for SSDs. As long as defragmentation is reducing the chance of doing a random read, it is beneficial.

[flagged]

Re: Show HN: I missed the moving blocks, so I built a real Linux disk defragmenter

#43
Neat! I have several questions here. First of all, why does Linux not need defragmentation?

Second, is it actually true that it doesn't need it? The readme implies that this defragmenter (for Linux) produces actual benefits.

Third, it says the benefits exist even on NVMe, i.e. on SSDs? I thought defragging was relevant for spinny disks only?

Thanks

Re: Show HN: I missed the moving blocks, so I built a real Linux disk defragmenter

#45

[flagged]

Yeah, can't wait for Linux to add the forced system update that restarts the computer while I'm away, closing all my open programs.

Like the cleaning lady who ignored my DO NOT RESTART note on the PS1 at the after school daycare and nuked all my progress.

Re: Show HN: I missed the moving blocks, so I built a real Linux disk defragmenter

#46
> I needed a reproducible storage layout while testing a high-throughput logger.

Of course just having a compressed filesystem image to restore for each test, or a collection of images to cover various cases instead of only optimising for ideal, would be more efficient…

But I love that this now exists instead!

Re: Show HN: I missed the moving blocks, so I built a real Linux disk defragmenter

#47

Earlier quoted context omitted.

> My partner complains about me closing apps on my phone consistently. I'd be curious to know the reqson why she would care on her own phone and why it would be an issue on someone else's phone?

At least on iPhone, it basically doesn't do anything. Apple aggressively kills all background apps automatically. the "open" apps in the switcher are almost always just screenshots of previously-open-but-now-closed apps. if it was recent, the latest app or two in the switcher might actually be open, but rarely more than that. Despite this, many of my relatives have somehow learned this habit of opening the switcher a…

i’m convinced the real reason people do this is because they don’t want anyone to see what apps they were using.

Re: Show HN: I missed the moving blocks, so I built a real Linux disk defragmenter

#48
post #43

Neat! I have several questions here. First of all, why does Linux not need defragmentation? Second, is it actually true that it doesn't need it? The readme implies that this defragmenter (for Linux) produces actual benefits. Third, it says the benefits exist even on NVMe, i.e. on SSDs? I thought defragging was relevant for spinny disks only? Thanks

Mostly, they try to avoid it by allocating extents instead of blocks (so, they look for a contiguous space to store most files) and by delaying allocation to accommodate for a growing files.

Re: Show HN: I missed the moving blocks, so I built a real Linux disk defragmenter

#49
post #2

Beautiful. Defragmenting my drives manually is one of those things like closing apps on my phone I am not using. Everyone says there is no need to do it. It might even be slightly worse overall. I even have enough self control to avoid doing it and have for years... But deep down in my heart, I truly FEEL like if I did it would improve things... somehow.

only HDD drives I use are in a ZFS pool which has a very usable fragmentation value from zpool.

In case you (or others aren’t aware) the FRAG value ZFS shows, is an arbitrary calculation to help give a value to free space fragmentation.

The purpose is to have a sense of when ZFS may developing trouble quickly finding contiguous blocks of free space to dump new data into. Mostly only a concern for high active and highly full pools. When you start watching the number climb past double digits, you may start finding performance issues but it’s a very contextual thing, rather than “at x value it’s bad”.

Basically it has nothing to do with written file fragmentation, or potential read speed.

Because ZFS is a copy on write filsystem, attempts at defragmentation an active pool are generally not effective. An exception would be a pool that is full of large files that was written in a non contiguous way (like torrents), in which case copying the data to a new dataset and deleting the old roughly achieves the purpose. Or you could use something like https://github.com/salesforce/zfs_defrag

Re: Show HN: I missed the moving blocks, so I built a real Linux disk defragmenter

#50
Not to make everything about AI, but..

The current analogy I am using when vibe coding is it's like defragging a hard drive in terms of time wasted.

Years of sitting there as the bar crept closer to 99 in the vain hope I could turn the computer off and go to bed, just to have to sit there for another hour or so until finished.

So many late nights wasted doing, I'm not sure what.

And now I'm sat there waiting for the agent to come back..

Running for 17m.. "dealing with a complex response"..

Codex (GPT5.6) has me hooked on that loop moreso as it is, in practice, so much quicker than Claude (Opus or Fable), so I don't quite ever walk away.

Nostalgia.

Post reply on HN