“How can the defragmentation of a hard drive affect PC speed?”

(Answer requested by Ahmed Belkhouja)

Very easily!

Here’s why: Files are stored on a hard drive in very small chunks called clusters. On a conventional NTFS-formatted drive, for example, the default cluster size is 4KB; large files are stored as a series of 4KB clusters.

On a new, empty, spinning-platter drive, saved files will be stored in sequential/adjacent clusters; but on an in-use drive, files will be saved in any available open clusters, including the “holes” where files were previously deleted. The result is that in-use file clusters get scattered, non-sequentially, around the disk.

Let’s look at a random, example file: Excel.exe. The copy I’m looking at occupies 17.5 MB (18,354,176 bytes) of disk space on my system. Divide 17.5MB by 4KB, and you’ll see that this one file occupies almost 4600 clusters.

Current spinning-platter hard drives have an average nonsequential seek time — the time it takes to mechanically move the drive heads from one random place to another on the drive — of around 7ms. (High-end drives are faster, cheap drives slower; 7ms is a reasonable average for this rough approximation.)

A little more math (4600 clusters multiplied by a 7ms average seek time per cluster) shows you that loading a completely fragmented Excel.exe would require over 32 seconds just in mechanical head-movement-time. Note that this doesn’t count the actual read-in time, or any processing or setting up of Excel — it’s 32 seconds lost in just getting the drive’s heads in position to read the file’s pieces!

Too extreme an example? Maybe: Few files are that badly fragmented. So let’s say the file is only half fragmented: Would you be OK with 16 seconds of totally unnecessary dead time while launching Excel? (I wouldn’t!) Even if the file is only one-fourth fragmented, you’d still be needlessly wasting about an extra 8 seconds.

Of course, defragging isn’t about loading just one file. It’s about all files, including system startup, when all of Windows itself and every single startup program — hundreds and hundreds of megabytes in all — must be read from the disk into memory. On a badly fragmented disk, this can require literally tens of thousands of totally unnecessary head seeks. It can add up to entire minutes of needless, purely-mechanical dead time!

Defragmentation shuffles each file’s clusters so they’re as close as possible to optimal, perfectly-sequential order. A 100% defragmented file requires just one nonsequential seek (the very first one that moves the head to the start of the file).

A good defragger will also go a step further and reposition your startup programs so they are not only defragmented, but also in the correct order for boot-time loading. That way, your drive’s heads can glide through one startup program after another in a long, smooth, unbroken read instead of having to jitter and jump all over the disk, gathering tens of thousands of scattered file fragments.

Thorough defragging can eliminate virtually all — all — unnecessary disk-head movements. And because good defragging tools are either built-in or free, and running them is point-and-click simple, why wouldn’t you defrag?

Honest: Defragging can makes a huge difference!

Visualization of fragmentation and defragmentation
(by XZise [CC BY-SA 3.0])

(Note: More detailed information is available in the AskWoody Archives.)

Permalink: https://langa.com/?p=3504

[seperator]

COMMENT / QUESTION on THIS ITEM? See the Comment box at bottom of this page!

NEW QUESTION?
Ask here!

(Want free notification of new content? Click here!)

Comment? Question? Reply...?