Live data from Hacker News

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

github.com

21–30 of 78 posts

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

#21
post #3

This made me think of https://e4rat.sourceforge.net/ , which moves boot files into sequential runs, which was helpful on spinning disks where seeks were slow but sequential reads were fast. Just as an idea for a feature your defragmenter could have. (Also this is a side thought; but I wonder if AWS AMIs and EBS volumes will boot faster if also organized sequentially.)

> Also this is a side thought; but I wonder if AWS AMIs and EBS volumes will boot faster if also organized sequentially.

Probably a measurable, but small, difference. I would expect it's not worth the effort unless you're spending a lot of time booting, and even then, there's probably better things to work on in the boot process, such as reducing the amount of things that run or reducing the size of them.

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

#22

Earlier quoted context omitted.

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…

iOS has never worked the way you are describing. It's easy to disprove your claim that the app is killed by just switching between different apps you have open. iOS keeps the apps open to make it fast to switch back to them.

Well, it closes the apps somewhat arbitrarily, but they definitely arent all open. If the most recent app is a resource-intensive game or something it will more aggressively close things. but you can have more open if they are all lightweight apps.

But the switcher shows every app ever opened and tries to pretend these apps aren't being closed. Right now for instance, i just checked and as best i can tell, the last 3 were open. going back any further and i could tell the app had to reload. but i can scroll to the left back forever. the one on the furthest left i easily haven't opened for months

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

#23
post #19

Earlier quoted context omitted.

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

Is it possible to determine which sectors are physically sequential given remapping for wear-leveling? Otherwise the claimed defragmentation here is not actually resulting in sequential data.

You cannot directly inspect the degree of fragmentation, because it has less to do with being contiguous in the Logical Block Address (LBA) space and more to do with having been written at the same time. To properly defragment a file on a SSD, you pretty much need to sequentially re-write the whole file in one go, to a newly-allocated part of the drive's LBA space.

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

#24
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.

I feel so seen right now. My partner complains about me closing apps on my phone consistently. I also have to hold myself back from defragging and continually cleaning up my storage drives. I too am nearly certain that the positive benefits are approaching nil, but I still feel it should be helpful.

When you die, you will leave behind nice orderly contiguous files. It's thoughtful. hehe

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

#25

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.

Prefetching applies to SSDs too, and that's generally sequential in some sense.

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

#27

Earlier quoted context omitted.

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…

iOS has never worked the way you are describing. It's easy to disprove your claim that the app is killed by just switching between different apps you have open. iOS keeps the apps open to make it fast to switch back to them.

This is literally always how iOS has worked. You can refer to the application lifecycle documentation: https://developer.apple.com/documentation/uikit/managing-you...

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

#28
post #26

This cool, but can we get an option to emulate HDD noises please? I really miss the whirrs, clicks and creaks. And the little LED that indicated disk activity... but that'd be a separate project.

Be in a very quiet room and I can still hear my SSD.

I suspect the noise is caused by the power supply emitting a tiny bit of 'coil whine' when put under more load

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

#29
post #26

This cool, but can we get an option to emulate HDD noises please? I really miss the whirrs, clicks and creaks. And the little LED that indicated disk activity... but that'd be a separate project.

Be in a very quiet room and I can still hear my SSD. I suspect the noise is caused by the power supply emitting a tiny bit of 'coil whine' when put under more load

Coil whine is common in budget setups, but often it is also just cheap MLCC Piezoelectric acoustic harmonic noise. Most EE impassioned pleas for large solid polymer capacitors to knock down the noise completely... are often ignored for cost reasons, or factory replaced with liquid-electrolytic type that slowly degrade over time until they literally explode on occasion.

The "Fast, Cheap, or Good... choose any two..." joke is very real. =3

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

#30
So now we are using vibe coded disk fragmenters that actually touch the disk state on your machine. It has little to no tests.

Now HNers here don't even question the soundness of this software and just assume it works as it was suspiciously built in 4 days.

One side-effect of the AI mania is that developers have lost the ability to reason around the verification stage of vibe coded software.

Oh dear.

Post reply on HN