SSD defragmentation: what is it and when to do it?

Índice de conteúdos

In recent years, SSDs have become the standard storage devices for enthusiasts and gamers: they are smaller, faster and have become much more reliable over the years.

But do you need to defragment them?

That’s the question we willanswer today, as well as explaining exactly what happens when you defragment your SSD and whether you really need to defragment it before installing Windows 11.

In the end, you’ll learn 4 unbeatable methods for optimizing your SSD and ensuring that it always performs at its best.

Let’s go?

Desfragmentação SSD

What is SSD defragmentation?

Fragmentation” is something that happens to disk drives as a natural result of writing data to the device.

When you format a drive, you are dividing up its storage space into a well-organized system. A map of the drive that lets the computer know exactly where each byte of information can be found.

On a new or recently formatted disk, new data is written in an uninterrupted sequence.

But when you delete a file, you leave a space in that sequence – and the computer marks that space as available to be overwritten.

The problem is that your new data probably won’t fit perfectly in that space.

So the operating system will fill the space with the first part of the file it writes and then look for the next open space – leading to data fragments scattered all over the disk area.

As you can imagine, this complicates reading a complete file or set of related files, as you need to jump from one place to another. It can also be a recipe for performance problems.

When you defragment your disk, the computer reorganizes all your data, using the free space on the drive as sorting space.

This process is only useful for disks (which have moving mechanical parts). But for SSDs (which record data electronically), it’s a massive and time-consuming process that only serves to affect their integrity and reduce their lifespan.

What happens when you defragment the SSD?

One of two things: an error informing you that this should not be done, or it turns out to be no different than it was, just wearing out the drive. This depends on the system and/or program you use.

Assuming it is the latter, since the former simply does nothing:

  1. The blocks contained in the files are “moved” according to the file system address. However, the controller still maps them in seemingly random positions physically, a feature called wear leveling. So even though the file system now shows that the file is in nearby blocks, they are not physically close to each other
  2. Each time a block is “moved”, it is actually just copied and then the original is deleted. This means that for each move, two write instructions are sent: one to place the data in the new position and the other to clear the previous position. SSDs cannot write directly to previously used blocks; they must first be removed (TRIM instruction). As defragmentation tends to happen in its own way, it is often necessary to move the same block several times – like trying to fit the pieces of a jigsaw puzzle together, arranging them in some pattern, only to discover that this pattern now means that another piece doesn’t fit. So defragmentation usually causes several blocks to be moved dozens or even hundreds of times – depending on how full the drive is and how defragmentation chooses to move the blocks.

Should I defragment the SSD?

The whole fragmented database depends on the fact that your storage device uses moving parts to access the data.

Since SSDs have no moving parts, therefore “Solid State”, there is no seek time or rotational latency.

Instead, SSDs access flash memory (NAND) at much higher speeds, typically less than 50 us – that’s 50 microseconds, or compared to a typical hard disk with an average access time of 15 ms, around 300 times faster.

Futhermore, from what we’ve seen, defragmenting the SSD doesn’t result in anything different from what it was at the start and it even wears out the drive faster than it would with normal use.

What’s more, defragmenting the SSD does nothing to speed up the drive, since it doesn’t slow down when a file is spread over several different positions. Therefore, defragmentation wouldn’t make it run any faster.

The only possible reason to defragment an SSD is to reduce its partition, even though most partition editing tools can move files around so that you don’t need to defragment them.

In other words, they perform the “move” so that the file system now “thinks” that the file is closer to the beginning of the partition instead of the end.

Do not defragment if the SSD is new

New PCs are stable, have good performance and reliability, but they wear out over time due to the deterioration of the SSD cells.

But this doesn’t hinder routine daily use, as the SSD deteriorates after a long time.

It’s not something that would happen quickly – a 500 GB Samsung 850 Evo, for example, is rated for 150 TB of total writes, or the equivalent of writing to each block of the drive at least 300 times.

With typical users recording less than 20 GB a day on average, it would take more than 20 years to burn through 150 TB of recordings.

But defragmentation could easily write hundreds of GB of data, which would wear out an SSD much faster, compromising its performance.

Avoid frequent defragmentation to increase service life

Defragmentation, as we’ve seen, can move all the data and files from the SSD and write them back, reading them all and writing them as necessary, which damages the life of the SSD.

So if you want to extend the life of your SSD and maintain its performance, avoid defragmenting it regularly.

Should I defragment the SSD before installing Windows 11?

If your SSD is new, your drive is not fragmented. So instead of defragmenting it, optimize it.

SSD optimization in Windows 11

In Windows 7/8/10/11, optimization is done automatically – in the last two versions, you can use Optimize Drives for this. In Vista and XP, you need to manually enable the TRIM command.

Method 1: SSD TRIM feature

SSD tuning enhances performance and improves the efficiency of the device by clearing data from unused blocks. Eliminating these blocks ensures optimum performance throughout the SSD’s lifetime.

This setting is activated by default, but although TRIM guarantees high performance for the SSD, it also makes it impossible to recover data on the device, since it deletes the data blocks every time you delete a file.

This is why TRIM is usually disabled: to ensure that the data is recoverable.

To find out if TRIM is active, follow the steps below:

  • Type “cmd” in the Start menu
  • Right-click on Command Prompt and select “Run as Administrator”
  • Type the command “fsutil behavior query DisableDeleteNotify”
  • If you find a command “DisableDeleteNotify = 0”, the feature is active.

To disable TRIM in Windows 10:

  • Press the Windows key + letter x at the same time to open the “Advanced User” menu. Then select Command Prompt (as administrator)
    Type the command “fsutil behavior set DisableDeleteNotify 1” to disable TRIM.

Method 2: Set the SATA controller to AHCI mode

By default, most of the time, the SATA controller is set to AHCI (Advanced Host Controller Interface) mode – because it works best with SSDs.

Therefore, to optimize your SSD’s performance, you should set the SATA controller mode to AHCI in your system’s BIOS.

To do this, follow the steps below:

  • At the same time, press Windows + letter R and type “msconfig” and press “Enter”.
  • Under “Boot”, check “Safe boot”, apply the changes and restart your device in safe mode
  • Press F2 or Del to initialize the BIOS settings and change the SATA mode from IDE to AHCI (if you can’t, disable Quick Start and try again)
  • Save the settings to exit and reboot.
  • When Windows starts, it will enter Safe Mode. Then run “msconfig” again and uncheck the “Startup” tab of the secure boot tab and restart your PC.

Method 3: Disable disk indexing

Indexing is ideal for speeding up access to files or folders on the hard disk, but on the SSD it’s better to disable it to reduce writes and improve performance in the long term.

For that:

  • Right-click on your drive, then “This computer” and select “Properties”
  • In the “General” tab, uncheck “Allow files on this drive to have their contents indexed in addition to the file properties”.

This disables disk indexing.

Method 4: Adjust paging files

This method is only recommended if your operating system has little RAM. After all, by adjusting the configuration of the paging file, you can balance the performance of the SSD.

To adjust the paging file:

  • Right-click on “This computer” and select “Properties”
  • Select “Advanced System Settings” and then “Settings on the “Performance” tab”.
  • In the pop-out, uncheck the “Automatically manage paging files” option and select the C: drive from the list
  • Choose “Custom size” and set a number with a starting size and another for the maximum size. Then click “Apply”, before clicking “Ok” to save the changes.

Conclusion

Unlike disks, SSDs don’t need to be defragmented. Instead, a good practice is to optimize their performance by setting the SATA controller to AHCI mode, disabling disk indexing and adjusting the paging files.

Another important point is to disable the SSD TRIM feature – which prevents your files from being recoverable in the event of accidental deletion of documents or other unforeseen events involving data loss.

If you haven’t disabled SSD TRIM on your PC and have lost your files, don’t worry: we at Bot have been experts in data recovery for over 10 years and can assess the possibilities of recovering your data.

What’s more, we work with the “Clean Room” concept, which guarantees the integrity of your device.

And we can collect your device free of charge from any address in Portugal and deliver your quote within 48 hours – or less.

Start your recovery with us now and become one of our 100,000 solved cases!

Compartilhar:

Posts relacionados