How computer programs defrag your hard drive

While storage density has increased, so has the average file size. People no longer solely use their computers for book reports and simple spreadsheets, they store HD movies, music and large digital images. Particularly, the editing of these massive (comparatively to 1993) files creates even more fragmentation.

While a *very *basic user may not see significant improvement from defragmenting, anyone who uses their computers for photo/video editing, media storage, or gaming will have noticeable speed increases. Especially if they are using more than 50% of their freespace.

Many programs today offer seamless defragmentation options that solve the all of these issues.
*My response is obviously focused more on the home user arena since that seems to be the OPs environment.

Ha! People have been saying this since I first started working with computers back in 1967, and it hasn’t happened yet.

Not true unless pointer tables are constructed differently from years ago.

The first file tables I dissected (CP/M, MS-DOS)stored all pointers to the data in the directory listing. As the file grew, the directory listing added a link to another directory listing area (opened another “extent”). Each item in the directory listing pointed to a data location, even if the next location was in sequence.

Clearly the posting should have used a mix, SATA is, after all, Serial ATA.

[ul]
[li] ATA - transfer rates ranged from 1.3MB/s to 133MB/s over the life of the standard.[/li][li] SATA 1.0 - transfer rate 1.5 Gb/s yielding 150 GB/s (taking into account 10/8 coding mechanism) [/li][li] SATA 2.0 - transfer rate 3.0 Gb/s yielding 300 GB/s[/li][li] SATA 3.0 - transfer rate 6.0 Gb/s yielding 600 GB/s[/li][/ul]

There are other important differences. ATA could not manage multiple transactions - once you requested an operation you had to wait until it completed before another one could be requested. Sort of OK for basic PC use, but useless elsewhere. Cheap however.

But, the huge and important caveat. These are not disk performance numbers. They disk interface numbers. There are currently no disks that can actually read or write data to their surface at 600MB/s. The best you will see is closer to 100MB/s - which is still pretty impressive. You can talk to the controller at these speeds, and if the controller has the data in cache, it may be able to deliver it at these rates, but you can’t get the data off the disk this fast. Similarly you can’t write this fast. You can enqueue the data to be written, but once you fill the disk buffers, your transfer rates will drop to the the average rate that the physical media can cope with. The data transfer speed is limited by the areal density of the recording surface and the rotational speed. Adding platters doesn’t help. One of the unfortunate things about modern disks is that the tolerances are so tight, that even small temperature differences in the disk drive mean that you can’t guarantee that if the head is exactly over a track on one surface that the other heads will be centred over the equivalent track on the others. So you can only access one track at a time.

Bottom line is that there is a significant gulf between peak and average performance. How much this matters, and what you can do to ameliorate it, depends upon your needs.

I thought about adding a comment about the ability of applications to use up available space. Soon 3D images will be occupying more space and those huge disk drives won’t seem so big anymore. Video editting is certainly one those application specific areas that benefit from strategic use of disk space.

It is happening now. You can get flash drives that are doing the job of disk drives in the PC market and for reasonabe sized servers. These products are actually maturing. I remember promises like bubble memory too, but this time they actually have something. Of course the disk manufacturers could think up a way to increase density and speed and win in the end. But they seem to already be moving into the solid-state drive market themselves.

I use auslogics and it gives me two options.

  1. Defrag

  2. Defrag and optimize, which somehow seems to put files in some sort of order overall

Each defragger has its own defragmentation and file sequencing algorithm, hence the differences in defrag speed and final layout of files on the disk. The more advanced automatic defraggers (eg, Diskeeper) monitor the volume for most frequently accessed files and place those in the ‘fastest’ part of the logical disk, which I suppose corresponds to the edge of the physical platters. IIRC, it even leaves ‘some’ space for the files to grow in case of modification, which would make sense since future fragementation would be less of a concern.

Sorting by name serves little purpose except for speeding access in programs that load files alphabetically.

With the cheap price of hard disks now, many people have excess capacity. Mine, for example, is less than 1/3 full. So with that much extra space, it seems like a simple (fast) defragging technique would be to just copy files onto the empty part of my hard disk, defragging them as it does so. And reliable; the index points to the old copy until the new copy is completely done, so a power failure at that point would still leave the old copy valid.

And this would leave the disk with a section of used space, and a big, contiguous section of empty space. So new files would tend to be unfragmented. My current defragger identifies fragmented files and copies them to a contiguous space, and then marks the old spaces as empty. But that leaves behind various little scattered empty spaces where the parts of the file were, so the next big file written is immediately fragmented. So I defrag one day, and a couple days later, there are lots of new files that are fragmented.

But that is pretty frequent, isn’t it? Like every time I do a directory list, or Explorer list of files, or in my word processor doing a Save As where it gives a list of files with similar names. Or it that all done from the directory?

Way back when Peter Norton was first selling his Utilities, there was an option to reorganize your hard disk and put all the files in order alphabetically. As I remember, it seemed to make a noticeable difference in subsequent access time.

That’s all done from the directory. I have a dim recollection of this somewhere also, but it doesn’t make much sense. File access wouldn’t normally have anything to do with the name of the file. And on Windows it would put the frequently accessed executables in Windows and Program Files further from the directory tracks. Are we thinking about something else? Maybe that goes back to DOS days, and reordered the directory itself for some reason.

If you started doing this in 1967, congratulations, I don’t encounter many people who have been at it longer than I have. These days I torture the noobs with tales of punched cards and paper tape. They think double clicking is a hardship nowadays.

That’s ringing some bells. I remember using Norton Utilities back in the early-mid '80s with DOS, and there was a utility or option to re-order directories and, IIRC, move all directories to the “front” of the disk for faster access.