By Gilbert Baca, Contributor
Defragmenting a hard drive is a very important task in a Windows environment. If you run any version of Microsoft Windows, defragmentation is an important part of computer maintenance. Microsoft has always included a defragmentation tool within its operating systems from Windows Millennium on up to XP. Very limited in early versions the newer defragmentation tools featured in Microsoft latest operating systems including Windows 7 and Windows 8 now offer such features as scheduling a defragmentation on specific hard drives if you have multiple drives. Defrag can also be conducted on external hard drives as long as they are not solid state hard drives or flash drives.
Scheduling of defragmentation (or defrags) and selection of drives to defrag are nice features to have in a Windows operating system. The way Windows operating systems work they tend to fragment fairly quickly. Some of the things that can lead to fragmentation quickly are user who create and use a large amount of files.
If you surf the web extensively, you are creating many temporary files which lead to large amounts of cache and data file fragmentation. Windows by design will pick up a file from a physical location on a hard drive, move it to the random access memory (RAM), allow you to manipulate it, and then put it back in a different physical location on the hard drive. While you are working a file, Windows will make many different copies of a file as you work with it. Windows does this so it can take you back to a certain point within the file in case you decide you did need those three paragraphs you deleted in your Word document. All of these are housed in memory while you work, yes, but are moved over to hard drive when you save. The document that you were working on an hour ago and the document that you saved now are essentially two different documents and stored in a couple of different locations on the hard drive. Confused yet?
On top of that, every time Windows saves a file to the hard drive it has to write a line to an allocation table which keeps track of all files. So, a single Word document may be responsible for many lines in an allocation table. The allocation table being the ‘spreadsheet’ that keeps track of where everything is on your hard drive. After a while, you can imagine what that allocation table looks like? It’s a mess! With Windows picking up and putting files back down in different places on the hard drive. Windows doesn’t put a file back in the same physical space it was stored when you opened it up. Well, you can just imagine how quickly this becomes messy. Really not the most efficient way to keep track of files but hey, if you have a better idea, please contact Microsoft, they might take your advice. (giggles)
If you don’t have the stomach to read more about how Windows handles files skip down a few paragraphs as the next few paragraphs will probably require Maalox or at least a good generic antacid. File deletion by the user and by the Windows operating system also create much fragmentation in a hard drive just by how they work. I like to call it the ‘pointer’ system and it still seems to be in play with Windows 8.
Just imagine you have three folders lined up in a row like good little duckies on a hard drive. They are sitting right next to each other physically at a hard drive location. File neighbors on a hard drive in abutting physical locations. Say that three times real fast! See the graphic below.
We’ll keep it simple, won’t go into a lot of detail but here we go, hang on! These folders are physically sitting next to each other on hard drive real estate. In the file allocation table there is a line somewhere that says Folder 1 is at X location, folder2 is at Y location and folder3 is at Z. Folder1 is told its neighbor is Folder2 and Folder2 is told it neighbor Folder3 in the allocation scheme. They are basically ‘pointed’ at each other in a row, holding hands like kids at an amusement park so they don’t get lost.
So let’s say I’ve decided that Folder2 is no longer needed. So, I highlight Folder2, right-click and select delete. Click and Folder2 is sent to the Recycle Bin. Has Folder2 disappeared and abandoned its sister folders on the hard drive?
Well no, it hasn’t. Folder2 is still there. You just don’t see it anymore because in the allocation table, it has been given the designation of ‘associated with Recycle Bin’. It’s now in the Recycle Bin. We visit the Recycle Bin and delete Folder2 from the Recycle Bin and you can’t see it in Recycle Bin anymore. Folder2 is still there between Folder1 and Folder3.
The way an operating system handles a file may vary depending on the file size and type also. This is just a very general explanation of why deleting a file causes t considered a fragment but by Windows operating system. The allocation table is also modified with a line that tells Folder1 and Folder3 that they are now neighbors and to ignore Folder2. Next, we go to the defragmentation program that comes with Windows.
The defragmentation program now runs as scheduled and it takes a look at this physical location on the drive. It notices that Folder2 has the designation of deleted on the allocation table and is not pointing at anything. The defragmentation program also notices that Folder2 has nothing pointing at it. Hmmm …. decisions … decisions. The defragmentation program now takes Folder3 and slides it over to the physical location on the hard drive where Folder2 once lived. Tada!
Duckies all in a row now! The defrag will then modify the allocation table, deleting the appropriate lines in the allocation table associated with Folder2. The defrag program will also modify Folder 1 and Folder3 data and introduce them as new neighbors!
Please keep the following in mind! Anything that is in your Recycle Bin is NOT deleted. It is only deleted fully when you flush out your Recycle Bin or annually delete a single file from within the Recycle Bin. So many people use the Recycle Bin as a storage bin for older files that they were using but are currently not using. However, if you want to keep your computer from having to keep track of all those additional files at some point you empty the Recycle Bin. If you use software like CCleaner to flush caches or Microsoft’s own Disk Cleanup Tool, you will have to decide whether to empty the contents of the Recycle Bin.
Best thing to do before defragmentation is a deep cache flush using CCleaner. Flush caches and clean registry, then run defragment. Deep cache clean and defragment will fix most computer ailments except for hardware issues, malware, spyware and viruses. See the Tex.org article on how to do a deep cache flush with CCleaner at this link: http://www.tex.org/using-ccleaner-to-speed-up-your-computers-performance/
Although Microsoft may not take your advice on how to handle the database that is your Windows operating system, they finally inserted a pretty cool defragmentation tool into the latest operating systems, like Windows 7 and Windows 8 plus Microsoft Server 2008, and Microsoft Server 2012. Thank you Bill Gates! See image below.
To get to Microsoft’s Disk Defragmenter tool, you simply click the Start shield at the bottom left hand corner of the screen, type in Disk Defragmenter and select it from the menu. Schedule a good defrag time for your C: drive and you are off to a better performing Windows computer.