Fragmentation within the NTFS filesystem

By apexwm, 31 August, 2011 19:37

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 ....

 

Talkback

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 1 September, 2011 19:13
Report offensive content Reply


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 2 September, 2011 11:14
Report offensive content Reply


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 2 September, 2011 12:29
Report offensive content Reply


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.
apexwm 2 September, 2011 13:22
Edit Delete Report offensive content Reply