Anda berbicara Bahasa Indonesia? Baca artikel terjemahannya di sini!
Are you familiar with the term defragmentation? During the hard disk days, it has been the go-to process for optimizing your disk’s performance. Now, as SSDs have become more and more affordable, many people make the switch, but still using hard disk as their large file storage. Now, do you still need to defrag SSDs as you do with hard drives in the old times?
I’ve been doing a few research about this, and I’m going to share it with you.
Hard Disks, Fragmentation, and Defragmentation
Let’s start by understanding how hard disks work, and what fragmentation is.
Unlike SSDs, which only consist of non-moving memory chips, hard disks are made of a spinning platter which serves as data storage, and a head, for reading and writing data, very similar to how phonograph reads from a vinyl disc.
However, unlike phonograph which only reads data, your hard disk also stores data. Data is written in sections of your hard disk, which we will call “blocks”. Ideally, one data should be placed in adjacent blocks for fast reading. However, as your hard disk usage increases, those adjacent blocks are becoming rarer and rarer. As a result, your data may be separated in several chunks (or fragments) across your hard drive. Thus, the term fragmentation.
Of course, over time, this will impact your hard disk performance. In order to serve a single data, your hard drive will need to search for all the data fragments across its own blocks. The further the distance and the larger your data, the more time your hard drive will need to complete it.
Defragmentation fixes this problem. It will attempt to move your separated data into adjacent blocks, so it will be easier and faster for your hard drive to read. In case you don’t believe me, most, if not all, defragmentation software will give you a color-coded graph of your hard drive blocks before and after defragmentation. You should find the after graph tidier and much nicer to look at, especially the colors.
SSDs and Fragmentation
Now you know what fragmentation is and how it affects your hard drive’s performance. What about SSD?
As mentioned earlier, SSDs work very differently compared to hard drives. SSDs use electromagnetic currents to store and read data, similar to how RAM chips work. That’s why SSDs are much, much faster than conventional hard drives. Also, since there’s no moving parts inside SSDs, you can safely move it around when it’s performing read / write operations.
With this stark difference of speed, fragmentations do not cause noticeable decrease in performance. Therefore, defragmentation is not needed. In fact, defragmentation may even shorten the lifespan of your drive. Why?
SSD Write Durability
While SSDs are superior in every way compared to traditional hard drives, there is one disadvantage. Their chips have limited write durability. This is usually written in TBW (Terabytes Written). As its name suggests, this is only affected by data writes. Reading data does not affect your drive’s durability. Expired SSDs do not mean it will stop working immediately, it’s just that it is no longer reliable. You may experience unexpected data loss.
Fortunately, newer SSDs have TBW durability so high that you can expect it to work as long as your hard drives. For example, Samsung’s older EVO 860 250GB SSD has an estimated lifespan of 150TBW. If you do the math, it will take approximately 82GB of data write everyday to break it in 5 years.
If you’ve been paying attention, you should understand that defragmentation involves moving data chunks around, which means there is data write. Data write spends the precious SSD’s durability. Hence, the conclusion that defragmentation may actually shorten your SSD’s lifespan.
In addition to write usage, defragmentation may also cause some portion of your memory chips to expire faster. Before understanding why, let me tell you that an SSD contains multiple memory chips, which shares the same durability. Defragmentation moves relevant data to adjacent blocks, which means that only certain blocks will ever get used. Free space will always be left to the last sectors. In the long run, this will make the beginning sectors expire faster than the last ones, making your SSDs even more unreliable. This is the exact opposite of how SSDs are intended to run, by utilizing each sector equally to achieve optimum lifetime.
SSD Optimization: TRIM, Garbage Collection, and Wear Leveling
You don’t have to worry about optimizing your SSD. Modern OSes and SSDs are so smart that they optimize themselves in the background without you knowing.
How? Well, let me introduce you to TRIM. TRIM is an OS command which is used to flag when a data is no longer used. This is fired when you tell your OS to delete data. When your computer is idle, the SSD’s Garbage Collection program will wipe that data. This way, when a new data comes, your OS will immediately know where to store the data. Without TRIM, your OS will not know which data is unused, so it will need to move the existing data to another location, then write the new data. This will cause a delay, which obviously will affect write performance of the SSD.
Garbage Collection also has another responsibility. In addition to wiping unused sectors, they also re-organizes existing data to make sure that each sector is utilized equally. This is called Wear Leveling.
Together, they will make sure that your SSD stays in its optimum state and will extend the lifespan of your SSD as long as possible.
Conclusion: Is Defragmentation Still Relevant?
Well, in the past, defragmentation is like a saving grace for speeding up old hard drives. Now, with the rise of SSDs, defragmentation is no longer needed. But what if you’re still using hard drives?
Well, I’m inclined to say that it’s no longer necessary. Why, here are a few reasons:
- Many modern hard drives have internal high-speed cache to store frequently-used data.
- Nowadays, most computer users put their OS and important applications in SSD. Hard drives are mostly used to store files. Therefore, hard drive performance is no longer a top priority.
- Computers have more and more RAM available. A few years ago, 4GB is enough. Nowadays, 8GB is a standard, while 16GB is the recommended minimum for gamers and enthusiasts. As a computer has more RAM, it will have more space to store frequently-accessed data, and that results in less need to access the hard drive directly for loading data.
To top it all off, modern operating systems have set up automatic defragmentation / optimization in the background, so you won’t have to worry about a thing.
Well, I guess that’s all for now, Folks. I hope you learn something new. Of course, this is just a glimpse of how SSDs, hard drives, fragmentation, and defragmentation work. If you’d like to know more, I’ll put my sources in the end of the article.
Oh yes, if you like educational content like this, let me know in the comments, since it takes quite a while to compile all the resources into a single article. Finally, as usual, if you make it this far, thank you so much for reading, and see you in the next article!