Fragmentation within the NTFS filesystem

Fragmentation within the NTFS filesystem

Summary: Recently while troubleshooting an issue on a Windows 7 PC, I noticed a number of events in the Application Log labelled "Defrag". Sparking my curiosity, I looked further and discovered that there was approximately one entry per day in the log.

SHARE:
TOPICS: Open Source
5

Recently while troubleshooting an issue on a Windows 7 PC, I noticed a number of events in the Application Log labelled "Defrag". Sparking my curiosity, I looked further and discovered that there was approximately one entry per day in the log. I looked around some more at other Windows 7 PCs and found that they too have "Defrag" entries scattered about. It turns out that Windows 7 now automatically runs a defrag on its NTFS filesystem, compared to Windows XP which never did this. This is a great idea on Microsoft's part, rather than letting things stockpile up and forcing the user to defrag while waiting for minutes or even hours while it churns away.

This got me thinking back to when I read more about other filesystems, most notably ext3 and ext4 filesystems on GNU/Linux (which are standardly used now), which never need defragmenting. Yes that's correct, they do not need to be defragmented. In fact, I've never heard of anybody regularly defragmenting ext3 or ext4 filesystems, and there are no tools to do so that I know of. The Linux System Administrator Guide states:

"Modern Linux filesystem(s) keep fragmentation at a minimum by keeping all blocks in a file close together, even if they can't be 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 not necessary to worry about fragmentation in a Linux system."

I've mentioned this before, but it makes me wonder why Microsoft doesn't make NTFS work the same way, by allocating blocks close together in the first place, therefore eliminating the need to defragment, like ext3 and ext4 do. It's a mystery, but at least Microsoft has put on a band-aid to the fragmentation issue of NTFS. Now, if we can only get Microsoft to implement a built-in solution to cleaning up the mess of temp files that Windows and applications leave all over the place ....

Topic: Open Source

Chris Clay

About Chris Clay

After administering Linux and Windows for over 17 years in multiple environments, my focus of this blog is to document my adventures in both operating systems to compare the two against each other. Past and present experiences have shown me that Linux can replace Windows and succeed in a vast variety of environments. Linux has proven itself many times over in the datacentre and is more than capable for the desktop.

Kick off your day with ZDNet's daily email newsletter. It's the freshest tech news and opinion, served hot. Get it.

Talkback

5 comments
Log in or register to join the discussion
  • Some people reckon defragging is a waste of time anyone.
    Personally, I'm not sure that any savings in read/write times are worth the time it takes to defrag a large hard drive.
    47674
  • 47674 - For the average home/small business users it probably doesn't make a noticeable difference, however in high transaction volume real time databases for example excessive latency from a fragged volume can be significant.

    apexwm - I guess Microsofts' problem with NTFS is that they risk breaking something else if they radically change the way NTFS works.
    AndyPagin-3879e
  • Some people reckon defragging is a waste of time anyone.
    Personally, I'm not sure that any savings in read/write times are worth the time it takes to defrag a large hard drive.
    yahoo
    Bermard
  • AndyPagin : I would guess you are partially correct. But, NTFS has been revised with several versions, and while some improvements have been made, no attempt has been made to make it better at housekeeping. Maybe that's low on Microsoft's priority list. While the ext filesystem on GNU/Linux allows users to upgrade the filesystem, and get direct benefits. I did find it amusing that one of the "features" added around the time of Windows Vista, for NTFS, was symbolic links. Unix/Linux has been doing this for decades, so it's almost as if Microsoft is playing catch-up with NTFS.
    Chris_Clay
  • Below links are very easy to understand,


    http://www.redhatlinux.info/2011/11/file-system-on-linux.html

    http://www.redhatlinux.info/2011/11/advance-file-system-on-linux.html
    anonymous