Are you looking to understand what is Fragmentation and Defragmentation? Then you have come to the right place, as today we will understand what these terms exactly mean. And when fragmentation and defragmentation is required.
In the early days of computers, we had, now ancient storage media such as magnetic tapes, punch cards, punch tapes, magnetic floppy disks, and a couple of others. These were extremely low on storage and speed. In addition to that, they were unreliable as they would easily get corrupted. These issues plagued the computer industry to innovate newer storage technologies. As a result, came the legendary spinning disk drives that used magnets to store and retrieve data. A common thread among all of these types of storages was that in order to read a piece of specific information, the entire media had to to be read sequentially
They were significantly faster than the aforementioned ancient storage media but they came with their own kinks. One of the issues with magnetic hard disk drives was called fragmentation.
Table of Contents
What are Fragmentation and Defragmentation?
You might have heard the terms fragmentation and defragmentation. Have you ever wondered what they mean? Or how the system performs these operations? Let us learn everything about these terms.
What is Fragmentation?
It is important that we learn how a hard disk drive works before we explore the world of fragmentation. A hard disk drive is made up of several parts, but there are just two major parts we need to know the first one being the “platter”, this is exactly like what you might imagine a metal plate but small enough to fit the disk.
There are a couple of these metal discs that have a microscopic layer of magnetic material on them and these metal discs store all of our data. This platter spins at a very high speed but usually at a consistent speed of 5400 RPM (Revolutions Per Minute) or 7200 RPM.
The faster the RPM of the spinning disk the faster the data read/write times. The second one is a component called the Disk read/write head or just “spinner head” that are placed on these disks, this head picks up and makes changes to the magnetic signals that come from the platter. The data is stored in small batches called sectors.
So every time a new task or a file is processed new sectors of memory are created. However, to be more efficient with the disk space, the system tries to fill up the previously unused sector or sectors. This is where the major issue of fragmentation stems from. Since the data is stored in fragments all over the hard disk drive, every time we need to access a particular data the system has to go through all of those fragments, and this makes the entire process as well as the system as a whole extremely slow.
Outside the computing world, what is fragmentation? Fragments are small portions of something that when put together, form the whole entity. It is the same concept that is used here. A system stores several files. Each of these files is opened, appended, saved and stored again. When the size of the file is more than what it was before the system fetched the file for editing, there is a need for fragmentation. The file is broken down into parts and the parts are stored in different locations of the storage area. These parts are also referred to as ‘fragments.’ Tools such as the File Allocation Table (FAT) are used to track the location of different fragments in storage.
This is not visible to you, the user. Irrespective of how a file is stored, you will see the whole file in the place where you saved it on your system. But in the hard drive, things are quite different. The various fragments of the file are scattered across the storage device. When the user clicks on the file to open it again, the hard disk quickly assembles all the fragments, so it is presented to you as a whole.
Also Read: What are Administrative Tools in Windows 10?
An appropriate analogy to understand fragmentation would be a card game. Let us suppose that you need a whole deck of cards to play. If the cards are scattered across the place, you will have to collect them from different parts to get the whole deck. The scattered cards can be thought of as the fragments of a file. Collecting the cards is analogous to the hard disk assembling the fragments when the file is fetched.
The reason behind fragmentation
Now that we have some clarity on fragmentation, let us understand why fragmentation occurs. The structure of the file system is the primary reason behind fragmentation. Let us say, a file is deleted by a user. Now, the place it occupied is free. However, this space may not be large enough to accommodate a new file as a whole. If this is the case, the new file is fragmented, and the parts are stored in various locations where space is available. Sometimes, the file system reserves more space for a file than needed, leaving spaces in the storage.
There are operating systems that store files without implementing fragmentation. However, with Windows, fragmentation is how files are stored.
What are the potential problems resulting from fragmentation?
When files are stored in an organized manner, it would take less time for the hard drive to retrieve a file. If files are stored in fragments, the hard disk has to cover more area while retrieving a file. Eventually, as more and more files are stored as fragments, your system will slow down because of the time taken to pick & assemble the various fragments during retrieval.
An appropriate analogy to understand this – consider a library known for lousy service. The librarian does not replace the returned books on their respective shelves. They instead place the books on a shelf closest to their desk. Although it seems like a lot of time is saved while storing the books this way, the real problem arises when a customer wants to borrow one of these books. It will take a long time for the librarian to search among books stored in random order.
This is why fragmentation is called ‘a necessary evil.’ It is quicker to store files this way, but it eventually slows down the system.
How to detect a fragmented drive?
Too much fragmentation affects your system’s performance. So, it is easy to tell if your drive is fragmented if you observe a drop in performance. The time taken to open and save your files has risen evidently. Sometimes, other applications slow down as well. With time, your system will take forever to boot.
Apart from the obvious issues that fragmentation causes, there are other serious problems. One example is the degraded performance of your Antivirus application. An Antivirus application is built to scan all the files on your hard drive. If most of your files are stored as fragments, the application will take a long time to scan your files.
The backing up of data also suffers. It takes longer than expected time. When the problem reaches its peak, your system may freeze or crash without warnings. Sometimes, it is unable to boot.
To handle these issues, it is important to keep fragmentation in check. Otherwise, the efficiency of your system is seriously affected.
How to fix the issue?
Although fragmentation is unavoidable, it needs to be dealt with, to keep your system up and running. To fix this problem, another process called defragmentation has to be performed. What is defragmentation? How to perform defrag?
What is Defragmentation?
Essentially, the hard drive is like a filing cabinet of our computer and all of the required files in it are scattered and unorganized in this filing cabinet. So, every time a new project comes we will be spending a long time looking for the required files whereas if we had got an organizer to organize those files alphabetically, it would have been much easier for us to find the required files quickly and easily.
Defragmentation collects all the fragmented parts of a file and stores these in contiguous storage locations. Simply put, it is the reverse of fragmentation. It cannot be done manually. You need to use tools designed for the purpose. This is indeed a time-consuming process. But it is necessary to improve your system’s performance.
This is how the process of disk defragmentation takes place, the storage algorithm built within the operating system is supposed to do automatically. During defragmentation, the system consolidates all the scattered data into tight sectors by moving the data blocks around to bring all of the scattered parts together as one cohesive stream of data.
Post, the defragmentation a considerable amount of speed increase can be experienced such as faster PC performance, shorter boot time, and far less frequent freeze-ups. Do note that defragmentation is a very time-consuming process since the entire disk has to be read and organized sector by sector.
Most of the modern Operating Systems come with a defragmentation process built right into the system. However, in the previous Windows version, this was not the case or even if it did, the algorithm was not efficient enough to completely mitigate the underlying issues.
Hence, the defragmentation software came into existence. During copying or moving files we may see the read and write operation taking place due to the progress bar displaying the process clearly. However, most of the read/write processes that the Operating system runs are not visible. So, users cannot keep a track of this and systematically defragment their hard drives.
As a result, the Windows Operating system came pre-loaded with a default defragmentation tool however due to the lack of efficient technologies, various other third party software developers launched their own flavor of it to tackle the issue of fragmentation.
There are some third-party tools as well, which perform the job even better than the Windows’ built-in tool. Some of the best free tools for defragging are listed below:
- Smart Defrag
- Auslogics Disk Defrag
- Puran Defrag
- Disk SpeedUp
One of the best tools for this is ‘Defraggler’. You can set a schedule and the tool will automatically perform defragmentation according to the set schedule. You may choose specific files and folders to be included. Or you may exclude certain data too. It has a portable version. It performs useful operations such as moving the lesser-used fragments to the end of the disk for enhanced disk access and emptying the recycle bin before defragging.
Most of the tools have more or less a similar interface. The method to use the tool is quite self-explanatory. The user chooses which drive they want to defrag and click on the button to begin the process. Expect the process to take at least an hour or so. It is advised to do this yearly or at least once in 2-3 years, depending on usage. Since it is anyway simple and free to use these tools, why not make use of it, to keep your system’s efficiency stable?
Solid State Drive and Fragmentation
Solid-state drives(SSD) are the latest storage technology that has become common in most consumer-facing devices such as smartphones, tablets, laptops, computers, etc. Solid-state drives are made using flash-based memory, which is the exact memory technology used in our flash or thumb drives.
If you are using a system with a solid-state hard drive, should you perform defragmentation? An SSD is different from a hard drive in the sense that all of its parts are static. If there are no moving parts, not much time is lost in gathering the different fragments of a file. So, accessing a file is faster in this case.
However, since the file system is still the same, fragmentation occurs in systems with SSD too. But fortunately, the performance is hardly affected, so there is no need to perform defrag.
Performing defragmentation on an SSD can even be harmful. A solid-state hard drive allows a fixed finite number of writes. Repeatedly performing defrag would involve moving the files from their current location and writing them to a new location. This would cause the SSD to wear out early in its lifespan.
Thus, performing defrag on your SSDs will have damaging effects. In fact, many systems disable the defrag option if they have an SSD. Other systems would issue a warning so that you are aware of the consequences.
Recommended: Check If Your Drive is SSD or HDD in Windows 10
Well, we’re sure you’ve now understood the concept of fragmentation and defragmentation much better.
A couple of pointers to keep in mind:
1. Since defragmentation of disk drives is an expensive process in terms of the hard drive usage, it’s best to limit it to only performing as and when necessary
2. Not just limiting the defragmentation of drives, but when working with solid-state drives, it’s not necessary to perform defragmentation for two reasons,
- First, SSDs are built to have a very fast read-write speed by default so minor fragmentation doesn’t really make much difference to the speeds
- Second, SSDs also have limited read-write cycles so it’s best to avoid this defragmentation on SSDs to avoid the use of those cycles
3. Defragmentation is a simple process of organizing all the bits of files that have been orphaned due to adding and deleting files on hard disk drives.