If you have been using windows from quite some time then you must have heard from your friends and colleagues that defragmenting your drive regularly helps to speed up your computer performance and also that accessing files are much easier.
Whereas you must have also heard that Linux OS which might be Ubuntu or any other version of Linux OS doesn’t need fragmenting on a regular basis why is that? So we have prepared a guide for you that will enable you to understand what fragmentation is and why the difference between Linux and Windows exists.
What Is Fragmentation?
Before we delve further let us explain what is fragmentation? Basically the hard disk that we use has a number of sectors in it which are used to store the pieces of files in it. If you have a file which is large in size it will be stored in multiple sectors.
Now let’s say that you have updated the original file the OS will try to store the updated version of the file next to the original file. Updating the file increases its size in the sector as a result sometimes there isn’t enough space next to the original file so the updated file will be split into multiple parts which are stored in multiple sectors.
As the parts of the file are stored in multiple sectors the hard disk must jump between the different sectors to access the different parts of the file thus slowing down the entire reading process and thus the performance of the hard disk is compromised.
So defragmenting is the process which puts the all the parts of the file together in one sector so the accessing the file becomes easy and quick.
How Windows File System Works
Previously in Windows the file system FAT32 was being used which wasn’t very good at arranging the files together as a result lot of fragmentation used to occur. FAT32 saves the first file close to the starting of the disk and the second file right next to the first file which doesn’t provide enough space for the first file to grow leading to fragmentation.
But with Windows XP and up to Windows 7 Microsoft is using NTFS file system creates a buffer space around each file which allows the file to grow. But still over time the fragmentation of file occurs. To get around this Microsoft has enabled defragmentation process to run in background in the latest version of Windows.
How Linux File System Works
Linux uses ext2, ext3 and ext4 file system with ext4 being used in the latest version of the Linux such as Ubuntu. Ext4 is more intelligent in how it allocates space to various files. What it does is when you save a file it scatters the file to different sectors of the hard disk which leaves plenty of space for the file to grow.
So as a result you won’t see the fragmentation of the files and even if fragmentation does occur then the OS will move around the files during normal use in an attempt to reduce fragmentation without the need for any defragmentation utility.
The only time you will see fragmentation occurring is when your hard disk if almost filled up to 85% or 90% and at that time you might need a bigger hard disk or back up your file and format the hard disk and restoring the backup.
We hope this guide has been helpful to you in understanding what fragmentation is and how it occurs. So do let us know if you have any question regarding Linux or Windows File system.