Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

The file is stored in blocks by the file system. The block is the smallest amount of data the file system can assign to store a file. The classical definition of a fragmented file is that the file is stored in blocks that are 'scattered' (that are physically non-contiguous) around the hard drive.

What I want to ask about is this second type of fragmentation I've came up with. Lets suppose we install a program. This program has very many files. When the program starts, the program always loads the contents of those files sequentially. Now, even if the hard disk is defragmented, there is still a possibility that the files (but not the blocks building up to files) will be scattered on the disk and thus the program launch time will be longer. Actually, this time could be longer due to defragmentation of the disk, as the defragmentation process not only glues fragmented files but also moves some files to optimize free space chunks.

The questions:

  • is the type of fragmentation I mentioned relevant for the file system?
  • is it possible to remedy this kind of fragmentation and if yes, how would you do it?

Also, I'm not sure if this question should belong to superuser or to serverfault (as I guess the filesystem fragmentation is more important in the server environment).

share|improve this question

closed as not constructive by Nifle, Canadian Luke, 8088, Journeyman Geek, Diogo Jul 30 '12 at 15:02

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.If this question can be reworded to fit the rules in the help center, please edit the question.

2 Answers 2

up vote 1 down vote accepted

What I want to ask about is this second type of fragmentation I've came up with. Lets suppose we install a program. This program has very many files. When the program starts, the program always loads the contents of those files sequentially. Now, even if the hard disk is defragmented, there is still a possibility that the files (but not the blocks building up to files) will be scattered on the disk and thus the program launch time will be longer

It’s not a novel definition. Back tn the days of DOS, defragmenters (including the one that comes with DOS) actually would defragment directories in that way in addition to individual files. Even in the days of Windows, program like Norton SpeedDisk would strive to make sure that the files in a directory are stored contiguously. In fact, you can even watch it happen with the defragmenter that comes with Windows 9x: it moves data to the end of the disk to free up space to move other files back.


is the type of fragmentation I mentioned relevant for the file system?

NTFS has all but supplanted FAT* as the primary OS on Windows. On the one hand, it suffers from higher directory fragmentation which hurts it here, but on the other, it has a more efficient indexing which allows for faster seek to files. As a result, the file-system tends not to play too big a role in this matter.

What does play a big role is that drives have gotten much faster than in the past. In fact, SSDs make it completely irrelevant.


is it possible to remedy this kind of fragmentation

The problem is that since those heady DOS days, the size of disks has gotten much larger which makes defragmenting directories next to impossible because everything after it must be moved to make room. So with larger disks, moving massive amounts of data back and forth can be extremely cumbersome to the point that it is easier just to wait the extra second to launch a program than wait 20 hours to defragment like that.

(To be honest, I still don’t understand why FAT* directories cannot be defragmented like any other file. It’s certainly easy enough to do it manually, so I don’t know why a program cannot automate it. Maybe I’ll write a defragmenter one day…)


if yes, how would you do it?

These days, seek times are low enough that this level of fragmentation is not generally going to be too noticeable in practice unless a program has thousands of tiny files spread all of the disk *cough*winsxs*cough*.

(For the record, this would be a poor design. Games are the software that need the most performance, and they usually pack their innumerable small files into one large one that can be indexed, so applications have no excuse to litter the drive with more tiny, sub-cluster–sized files than there are stars in the sky.)

When this sort of scenario occurs, it is in effect, no different than a big file being heavily fragmented and would likely impact load time for a bit until the various caches throughout the system take effect. As kinokijuf mentioned, the Windows prefetcher attempts to help increase cache performance by learning what needs to be cached (in XP, make sure that the Task Scheduler service is enabled and running or else the prefetcher won’t work!)

There are various tools that purport to analyse your usage and optimize files to speed things up. Their efficacy is debatable (and for some reason usually subjective). If a program is affected by this, you can try using a defragmenter that specifically includes a move-files-around-to-increase-access-speed function, but they usually just move them to the end of the partition which if anything, actually slows down access by having them closer to the hub where disk throughput is lower than near the edge! You would be better off just contacting the developer and filing a bug report/feature request.

share|improve this answer

Windows XP and higher have the Prefetch technology, which strives to minimise this.

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.