- Windows File Systems
- Windows NTFS
- Windows ReFS
- Windows DFS
- Storage Spaces Direct
- Storage Replica
- Storage QoS
- Volume Shadowcopy Services
- Windows Volume Mgmt.
- Windows System state
- Removable Storage System
The first thing to note is that you cannot defragment file system volumes that are not NTFS, Fat or Fat32.
When a Windows operating system is first installed on a disk and then applications are added, all the files are contiguous and arranged in the optimal place on the disk for performance. This means that the read-write heads do not need to move much to read a single file. A file is fragmented when it is not contiguous, but is split up into pieces in various parts of the disk. Now the read-write heads have to move back and forward over the disk to read the whole file. This takes time, and causes 'seek delay' performance problems.
When a file is updated, it usually needs space to grow. The NTFS file system leaves space before and after a file, to allow it a bit of room to grow without causing fragmentation. Microsoft initially thought that this meant that the NTFS was fragmentation proof, and were so confident that they did not supply a defragmentation tool. However, this is not quite correct. The 'guard space' which NTFS leaves on either side of files is about 30% of the space used by the file, so once an NTFS partition hits the 70% full mark, the data has actually hit the end of the disk. When more new files are added, they will be allocated into the 'guard bands', and may well be fragmented.
Over time, as files are deleted and new files added, the free space becomes fragmented, so it is impossible to allocate a new file into a single space. Fragmentation and performance will get worse with time.
In the real world, performance does not die when partitions are loaded beyond 70%. This is probably due to a combination of the other NTFS performance features, and also that the big cache in RAID disks mask sequential access and seek problems (because the files are no longer allocated in nice contiguous chunks, but are split up and striped over several disks).
A defragmentation tool basically works by moving files around on the disk, so each file becomes consolidated into one contiguous extent, and to consolidate the freespace into a single contiguous extent for new allocations. This ideal cannot be achieved in practice, as some files cannot be moved.
Commercially available Disk defragmenter software is evolving so that instead of fixing fragmentation issues, it tries to prevent them from happening in the first place, using 'intelligent write' processes.
Files which cannot be moved with Windows active are
and any other files open for exclusive use.
It is impossible to defragment any of the three files above using normal Windows defragmentation tools, you need a third party tool which works at boot time
Directories can also become fragmented; adding to the time it takes to access files. Windows 2000 directories on an NTFS disk can be defragmented while the operating system is running. However, FAT directories can only be defragmented at boot time.
Microsoft provided a system defragmenter tool from Windows 2000 onwards. It is based on the Diskeeper product described below. It has two functions, an analyze function to determine if a disk needs defragging, and the defragmentation function itself. Windows 7, 8 and 10 will run a scheduled weekly defrag automatically so there is no need to run one yourself. To run a defrag manually -
On Windows 7 and earlier, click Start - Programs - Accessories - System Tools - Disk Defragmenter; Select the volume that you want to check for fragmentation; Click Analyze and the message box will tell you if a defragment is necessary. If so, click Defragment.
On Windows 8, open a Search window by typing Windows+Q or swiping in from the right and opening the Search Charm and then search for 'Defragment'. Select the result 'Defragment and optimize your drives'.
On Windows 10, from the good old Start button, select 'Windows Administrative Tools', then 'Defragment and Optimise Drives', This will oped up a window which will tell you the optimisation state of all your drives and give you a chance to defragment them.
A few pointers -
Diskeeper is supplied by Condusiv Technologies, and in fact, the Microsoft defrag tool used Diskeeper code. So why would you buy a third party tool when
Microsoft provide one with the operating system?
Diskeeper defrags your directories at boot time, outside of the Windows OS, so allowing access to files that are normally reserved. In theory, this might mean the boot takes longer, but it can actually improve performance as files used by the boot process are optimised.
One Diskkeeper feature is InvisiTasking technology which allow you to run normal work while defragmentation occurs in the background. This can be set up to run automatically, and almost invisibly.
The IntelliWrite defragmentation routines intelligently write files to the disk to avoid 85 percent of files from ever getting fragmented. This keeps most drives in a continual fragmentation free state. Diskeeper 15 extnds this functionality to SAN disks. It cannot defrag SAN drives directly, but it will perform intelligent writes so SAN disks are always optimised.
Diskeeper can defragment the paging file and the MFT at boot time. It is also possible to schedule this for remote servers using remote boot. Diskeeper supports Windows 2008 and 2012 versions.
O&O Defrag has the usual defrag facilities, it can defrag systems files at boot time, and it will run in 'screen saver' mode to automatically defragment disks when a computer is not is use, with no negative performance impact on your systems. It integrates with Windows explorer to present a simple user interface. It will defragment an unlimited number of drives or partitions, and can defragment almost any type of disk including USB sticks, memory cards and RAID devices, with only about 5% free space needed for operation (the Windows defragmenter needs 15% free space).
O&O Defrag 19 supports Windows 10 and has the ability to optimise data access on SSD disks by telling the SSD to reuse space left by data that has been deleted.