Exercise modern computers still need the kind of routine defragmentation procedures that older computers called for? Read on to learn about fragmentation and what modernistic operating systems and file systems do to minimize functioning impacts.

Today's Question & Respond session comes to united states courtesy of SuperUser—a subdivision of Stack Exchange, a community-bulldoze group of Q&A web sites.

The Question

SuperUser reader Simon Sheehan is curious well-nigh the country of defragmentation in modern drives:

Equally a part of regular Windows maintenance, I defragment my hard drive. Simply why does the hard drive fragment on NTFS and Fat* systems? Obviously EXT* does non, why is this? Should I also exist defragmenting my USB drives?

Allow's plough to some of the contributor answers to investigate Simon'southward question.

The Answer

SuperUser contributor Daniel R. Hicks fields the question:

Fragmentation is non the consequence information technology was 30 years ago. Back then you lot had hard drives that were scarcely faster than floppies, and processor memory sizes that were minuscule. Now yous have very fast drives and large processor memories, and sometimes substantial buffering on the hard drive or in the controller. Plus sector sizes have gotten larger (or files are allocated in larger blocks) then that more than data is inherently face-to-face.

Operating systems have gotten smarter as well. Whereas DOS i.x would have fetched each sector from disk as information technology was referenced, a modernistic Bone is able to come across that you have a file open up for sequential access and can reasonably predict that you'll be fetching boosted sectors in one case yous've consumed those y'all have now. Thus it can "pre-fetch" the next several (dozen) sectors.

And any more it's ofttimes better to non accept a file contiguous. On a (large) organisation where the file arrangement is spread across multiple drives a file can actually be accessed faster if it is "spread" likewise, since multiple disks can be seeking the file simultaneously.

I defragment every 2-3 years, whether my box needs it or not.

[I'll add that the of import thing is not so much whether the data on the deejay gets defragmented as whether the costless space does. FAT was terrible at this — unless y'all defragged things kept getting worse and worse until in that location were no 2 contiguous blocks of free space. Most other schemes tin coalesce free space and classify pieces in a somewhat "smart" manner so the fragmentation reaches a certain threshold and so stabilizes, rather than getting worse and worse.]

Journeyman Geek adds in the following information about Linux file systems:

ALL file systems fragment. ext and other Linux file systems fragment less due to the style they're designed – to quote Wikipedia regarding the Linux Network Administrators' Guide:

Modern Linux filesystem(south) go on fragmentation at a minimum past keeping all blocks i n a file close together, even if they can't exist stored in consecutive sectors. Some filesystems, like ext3, effectively allocate the free block that is nearest to other blocks in a file. Therefore it is non necessary to worry about fragmentation in a Linux organization.

I'd note though that ext4 has online defragmentation so somewhen fragmentation IS an issue, even with Linux file systems.

Windows file systems have their clusters placed wherever at that place'southward space to put them, and defrag runs around and replaces them. With Linux, files are preferentially placed where at that place's enough infinite.

I'd note though, Windows 7 has scheduled defragmentation runs, so it isn't really necessary to run defrag manually.

1 element of the original question that wasn't addressed is whether or not yous should defragment your flash drive. Defragmentation is a very reader/write intensive procedure and should be avoided on solid-state storage devices like flash drives and Solid Land Disks (SSDs). For more than information on defragmentation, file systems, and SSDs, check out the post-obit HTG manufactures:

  • HTG Explains: Exercise You lot Really Demand to Defrag Your PC?
  • HTG Explains: What'south a Solid State Drive and What Practise I Need to Know?
  • HTG Explains: Why Linux Doesn't Demand Defragmenting

Have something to add to the caption? Sound off in the the comments. Want to read more answers from other tech-savvy Stack Exchange users? Check out the total discussion thread here.