Friday, November 12, 2010


Defragmentation is a useful thing to have on traditional style hard drives. It moves around your data so that it's contiguous, which makes it read and write faster. Fragmented data has been broken into little chunks around your hard drive (because that's all the room there was available at the time), and to operate it, your computer has to play a "choose your own adventure" game from hell, hopping to various sectors to get every little bit.
However, a badly fragmented drive takes hours to fix up. While one can, on more recent OSes, schedule the defrag to run overnight, and leave your computer on, more likely people ignore this until the computer is slow as hell, and then wonder why. When the resulting defrag takes more than 24 hours, they're kind of upset.
More recent filesystems note that one does not constantly write data to the disk, and spends spare moments passing a file around the disk to defragment it. This is called online defragmentation, and it's so efficient that you don't notice it. (Unless you're constantly downloading huge files via your impossibly fast optical fiber connection, but people who do that probably have their own ways of dealing with it.) With online defragmentation, fragmentation never gets a chance to get seriously started, because ignoring it for a few seconds tends to schedule it for defragmentation. A few microseconds later, and it is defragmented.
However, there is one kind of drive that fragmentation is not a bad thing. SSD drives are not a magnetic platter like traditional drives. They are a large connection of Flash EEPROM chips. The drive can get any part of the data on it equally fast, no matter how many pieces it's in. The main downside is that the information can only be changed so many times before that particular chip just plain breaks down. Defragging an SSD drive only prematurely ages the disk for no apparent gain. Other technologies, like load balancing and TRIM, keep the disk lasting longer, and the user will want to use a filesystem that uses these technologies. SSDs tend to be smaller and more expensive, so are primarily useful for things you want to load often and change little, like the operating system and executable files. Your main data would be stored on another, more traditional, disk.


KaiWen said...

Aren't there certain disk formats (like Mac OS Extended) that are designed not to fragment at all?

Mad Engineering said...

I'm quite sure they do this by live defragmentation. You write the file, it's defragmented while you're not looking, so fragmentation never builds up to the point where you'd notice it.

Anonymous said...

With todays large drives and the amount of stuff we keep downloading and removing off the drives, its no surprise if fragmentation builds up at a very fast rate. In such cases, the best way to defrag is going in for a competent (because the built in defragger doesnt do a great job on severely fragmented drives or system files)fully automatic tool that once installed will do the task fast and without any manual intervention.

Mad Engineering said...

That's what live, or online, defragmentation basically is, anonymous reader. A personal computer system is not writing to the drive perpetually, even under heavy downloads. Live defragmentation would, between receiving bytes from a download, keystrokes, or whatever other interruptions, toss a fragmented file to the end of the filesystem, which serves to defragment it, and when it's freed a lot of those, tosses them back into place in their defragmented state.
Even if you download 24/7 from a broadband connection, there's still enough idle time to fight fragmentation, which never gets the chance to build up to noticable amounts. The end user never has to manually call for defragmentation -- it's done automatically when the computer has nothing better to do. Which happens constantly, between keystrokes, internet I/O, or the like, and there's way more gaps for this then you'd imagine.

Related Posts Plugin for WordPress, Blogger...