Defrag anymore?

I remember back before HDDs grew past 1TB, I would defrag fairly often.
It just occurred to me that I don’t remember the last time I did so.
Does anyone regularly defrag drives larger than 1TB?
I guess if space is limited, like in a laptop it would make sense?

Windows defrags in the background. Linux filesystems don’t fragment for the most part, so not necessary.

Also the bigger the drive the less fragmentation happens in the first place.

3 Likes

Yeah, I was thinking the larger drives allowed the system more breathing space to find large enough gaps for files/slot smaller files in spaces left behind easier

Defragging atleast for me was never about freeing up space. i rarely saw much improvements past a few hundred megs. It was always about improving speed and reducing access times. Though i never keep a OS around enough to really worry about so meh?

2 Likes

If you let a large drive fill up it’ll fragment exactly the same as small ones. That’s just less likely to happen on giant drives.

But yeah, Windows defrags automatically via scheduled tasks, SSDs should never be defragmented, and EXT4 is less likely to fragment than NTFS. EXT4 actually will fragment if you let it get full, look for non-contiguous inodes in fsck, but fsutils doesn’t even include a defragment command so they clearly don’t think it’s a big deal.

Yeah, I looked at it not for freeing useable space, rather for having the right spaced gaps so files can be written contiguously, so drive doesn’t have to seek several times to read a whole file.

I use UltimateDefrag to place my games folder at the outer rings of the HDD in alphabetical order. And I tend to do that every time I install or uninstall a game. Other than that I rarely defrag my other HDD’s that are mostly for music and videos etc. Once every 4 months perhaps.

Sure, if it makes you feel better, go for it.

Well, yeah. That’s what I was meaning to say :wink:

I used to do that, but I didn’t feel much of a difference so…
Also depends on the game, because when you have a game that patches often, this is actually counter-productive because there’s no space to put the new data on.

1 Like

My understanding is it’s fine to defragment more recent SSDs. You will get a performance improvement from data locality. To defragment an SSD manually in Windows 10 you need to use the command line; but, Windows should be running that defrag already about once a month.

You shouldn’t have to defrag an SSD, as the more spread out the data, the more potentially Faster the read- the drive can issue several reads across multiple [edit: pages?], not being constrained by the read head having to swing between tracks.
Also a defrag isn’t good for the write cycles of the nand chips

1 Like

It is NOT fine to defragment SSDs, you will see no benefit, and you’ll decrease your SSD’s lifetime if you do.

The reason to defragment is because random access speeds are much slower than continuous access on magnetic drives, because the physical drive head needs to skip around to read those non-continuous blocks. That is not the case on SSDs, which have no moving parts and blazingly fast random access. SSDs do get fragmented but that doesn’t impact performance, so there’s no reason to “fix” it.

Due to the way NAND flash works, it has a limited number of writes in its lifespan. You want to minimize writes, and a full defrag can literally rewrite all the data on the drive. So it’s actively harmful to do it.

2 Likes

^ This ^
Do NOT EVER defrag an SSD, your NAND WON’T thank you.

2 Likes

I’m sorry for having gone a bit overboard about SSD’s, their write endurance is much much better than I give them credit for, and you are welcome to scrub your drives however you see fit.

I am just incredibly cheap, and try to handle my flash drives with the lightest of touches (write wise) so the last as long as I can get them to.

For that reason, I typically over provision them too (so basically over-paying in the first place)

Windows is defragging the SSD most likely anyways. Probably about once a month.

Fragmentation still impacts SSD performance. It just isn’t as noticeable as a mechanical drive. I think it’s mostly down to the file system not being contiguous.

Sources: https://superuser.com/questions/1150641/should-i-defragment-my-ssd
This one has the nuances of the issue: http://www.hanselman.com/blog/TheRealAndCompleteStoryDoesWindowsDefragmentYourSSD.aspx

The point is as long as your not defragging constantly with a modern OS, the OS and filesystem will address fragmentation issues.

Thanks for the links, that’s fascinating. So shadow copies require a certain amount of continuous space, and Windows does defrag SSDs to address that. And also to avoid max fragmentation, which is more of a theoretical thing with most use cases.

I don’t see anything talking about performance in those links, but it’s true that random access is slower on SSDs, it just isn’t ridiculously slower like on magnetic disks, such that defragging for performance reasons is not justified.

It’s the difference between .27 nano seconds and .15 nano seconds. Probably only really matters for servers and professional work involving opening tons of large and small files.

http://www.sami-lehtinen.net/blog/ssd-file-fragmentation-myth-debunked

No, its not. If you’re using an SSD then it will not defrag it and instead enables TRIM.

Well yeah if you want to be pedantic about it. But if it really comes down to the nano-seconds then that problem is solved by just spending more money for something faster.

Defragging an SSD is like writing the entire drives worth of data for no reason. So you’ve just wasted a potentially full write cycle for every bit on the drive.

It should only do this if it cannot find enough continuous free space to make the copy. Meaning, you’re using a very full drive >=88%.

1 Like

I still find in regards to windows and hdds that defragging and file optimizing is still necessary. Nvme and sdds have trim which seem to do well enough. I still consider defragging necessary in regards to windows and hdds.

There are two problems that can happen due to fragmentation:

  1. HD performance goes down due to physical head movement (this is why hard drives would typically be defragged)
  2. (less common) - eventually NTFS (possibly other filesystems too) can run out of “free space” (or rather, lose the ability to write new data to the filesystem) even when there is free space due to excessive fragmentation and running out of (inodes?) nodes to file fragments.

I’ve seen #2 happen on a couple of very old servers (SQL 2000) a few times and a defrag fixed the free space issue.

#2 will still eventually happen on a heavily used SSD that sees a lot of changes when fairly full.

No filesystem is fully immune to fragmentation, but some do better than others.

So, there isn’t “no reason” to defrag even SSD storage. But it’s not required anywhere near as much - running scheduled defrags all the time is a bad idea because as above it causes extra wear on the NAND.