Jump to content

Hello, today i checked my drives to see if they need to be defragged, because i haven't defragged them in a while. And i saw that my SSD was 35% fragmented. My natural instinct was to defrag it, but after giving it a quick Google search i found out that's not a good idea. My questions are, is it bad that it is 35% fragmented? if something needs to be done about it, how would i do that?

 

Thanks.

Link to comment
https://linustechtips.com/topic/183889-ssd-fragmentation/
Share on other sites

Link to post
Share on other sites

since SSDs don't have write heads like a HDD, it's not necessary to make all of the data as sequential as possible. In fact, SSDs fragment on purpose in some cases. 

Actually, they "fragment" data all the time, since thats how they gain such speeds.

+°´°+,¸¸,+°´°~ Glorious PC master gaming race :wub: ~°´°+,¸¸,+°´°+
BigBox: Asus P8Z77-V, 3570k, 8GB Ram, Intel 180GB & Sammy 750GB, HD4000, W7
PiBox: Rasberry Pi, BCM @ 1225Mhz ^_^ , 256MB Ram, 16GB Storage, pIO, Raspbian

Link to comment
https://linustechtips.com/topic/183889-ssd-fragmentation/#findComment-2471149
Share on other sites

Link to post
Share on other sites

what do you mean by trim? thanks for replying btw

Trim is a command, that tells the SSD, that you actually deleted something. You can also send that command manually from the degragging application.

+°´°+,¸¸,+°´°~ Glorious PC master gaming race :wub: ~°´°+,¸¸,+°´°+
BigBox: Asus P8Z77-V, 3570k, 8GB Ram, Intel 180GB & Sammy 750GB, HD4000, W7
PiBox: Rasberry Pi, BCM @ 1225Mhz ^_^ , 256MB Ram, 16GB Storage, pIO, Raspbian

Link to comment
https://linustechtips.com/topic/183889-ssd-fragmentation/#findComment-2471154
Share on other sites

Link to post
Share on other sites

what do you mean by trim? thanks for replying btw

 

Just set the SATA to AHCI mode in the BIOS. TRIM is automatic.

How to Post Topics, the Right Way / The Ultimate Build Parts List

 

"4 words. DON'T BE A DUMBASS" ~@Swndlr

Link to comment
https://linustechtips.com/topic/183889-ssd-fragmentation/#findComment-2471155
Share on other sites

Link to post
Share on other sites

well i copied everything from my hard drive over to my ssd so i could have win 7 on it. so i should use the command right? (I don't know the command)

How to enable TRIM Command in Windows 7 with a Solid State Drive

To enable or disable TRIM Command, you will need to open an Elevated Command Prompt window.

How To Open an Elevated Command Prompt window: Click on Start Orb > Type "CMD.exe" in Search box > Right click on "CMD" and select "Run as Administrator" (If you receive a prompt confirmation, click YES)

How to Enable TRIM Command

In the Elevated command Prompt windows, type the following:

fsutil behavior set disabledeletenotify 0

How to Disable TRIM Command

In the Elevated command Prompt windows, type the following:

fsutil behavior set disabledeletenotify 1

How do I know if TRIM is working in Windows 7?

In the Elevated command Prompt windows, type the following:

fsutil behavior query disabledeletenotify

Results explained below:

DisableDeleteNotify = 1 (Windows TRIM commands are disabled)

DisableDeleteNotify = 0 (Windows TRIM commands are enabled)

How to enable AHCI in Windows 7 after Instalation:

There is one way to fix this, although you need to have knowledge of registry editing. The detailed steps from Microsoft are as follows:

1.Exit all Windows-based programs.

2.Click Start, type regedit in the Start Search box, and then press ENTER.

3.If you receive the User Account Control dialog box, click Continue.

4.Locate and then click the following registry subkey:

HKEY_LOCAL_MACHINESystemCurrentControlSetServicesMsahci

5.In the right pane, right-click Start in the Name column, and then click Modify.

6.In the Value data box, type 0, and then click OK.

7.On the File menu, click Exit to close Registry Editor.

After this you’ll have to restart your computer, go to BIOS and enable AHCI. When you log in to Windows again, you’ll notice the installation of drivers for AHCI. Another restart will be required to finish the driver installation.

These steps are provided at your own risk and not suggested unless you know and understand the risks. You will want to make sure the controller driver and MB BIOS support this option before you enable it

.

Link to comment
https://linustechtips.com/topic/183889-ssd-fragmentation/#findComment-2471175
Share on other sites

Link to post
Share on other sites

well i copied everything from my hard drive over to my ssd so i could have win 7 on it. so i should use the command right? (I don't know the command)

 

-stolen from the tom's hardware forum-

 

To enable or disable TRIM Command, you will need to open an Elevated Command Prompt window. 

How To Open an Elevated Command Prompt window: Click on Start Orb > Type "CMD.exe" in Search box > Right click on "CMD" and select "Run as Administrator" (If you receive a prompt confirmation, click YES)

How to Enable TRIM Command

In the Elevated command Prompt windows, type the following:

fsutil behavior set disabledeletenotify 0

How to Disable TRIM Command

In the Elevated command Prompt windows, type the following:

fsutil behavior set disabledeletenotify 1

How do I know if TRIM is working in Windows 7?

In the Elevated command Prompt windows, type the following:

fsutil behavior query disabledeletenotify

Results explained below:

DisableDeleteNotify = 1 (Windows TRIM commands are disabled)

DisableDeleteNotify = 0 (Windows TRIM commands are enabled)

 

EDIT: Damn you ninja'd me hard, @Syntaxvgm  :ph34r: 

How to Post Topics, the Right Way / The Ultimate Build Parts List

 

"4 words. DON'T BE A DUMBASS" ~@Swndlr

Link to comment
https://linustechtips.com/topic/183889-ssd-fragmentation/#findComment-2471176
Share on other sites

Link to post
Share on other sites

-stolen from the tom's hardware forum-

 

To enable or disable TRIM Command, you will need to open an Elevated Command Prompt window. 

How To Open an Elevated Command Prompt window: Click on Start Orb > Type "CMD.exe" in Search box > Right click on "CMD" and select "Run as Administrator" (If you receive a prompt confirmation, click YES)

How to Enable TRIM Command

In the Elevated command Prompt windows, type the following:

fsutil behavior set disabledeletenotify 0

How to Disable TRIM Command

In the Elevated command Prompt windows, type the following:

fsutil behavior set disabledeletenotify 1

How do I know if TRIM is working in Windows 7?

In the Elevated command Prompt windows, type the following:

fsutil behavior query disabledeletenotify

Results explained below:

DisableDeleteNotify = 1 (Windows TRIM commands are disabled)

DisableDeleteNotify = 0 (Windows TRIM commands are enabled)

 

EDIT: Damn you ninja'd me hard, @Syntaxvgm  :ph34r: 

 

 

well i copied everything from my hard drive over to my ssd so i could have win 7 on it. so i should use the command right? (I don't know the command)

How to enable TRIM Command in Windows 7 with a Solid State Drive

To enable or disable TRIM Command, you will need to open an Elevated Command Prompt window.

How To Open an Elevated Command Prompt window: Click on Start Orb > Type "CMD.exe" in Search box > Right click on "CMD" and select "Run as Administrator" (If you receive a prompt confirmation, click YES)

How to Enable TRIM Command

In the Elevated command Prompt windows, type the following:

fsutil behavior set disabledeletenotify 0

How to Disable TRIM Command

In the Elevated command Prompt windows, type the following:

fsutil behavior set disabledeletenotify 1

How do I know if TRIM is working in Windows 7?

In the Elevated command Prompt windows, type the following:

fsutil behavior query disabledeletenotify

Results explained below:

DisableDeleteNotify = 1 (Windows TRIM commands are disabled)

DisableDeleteNotify = 0 (Windows TRIM commands are enabled)

How to enable AHCI in Windows 7 after Instalation:

There is one way to fix this, although you need to have knowledge of registry editing. The detailed steps from Microsoft are as follows:

1.Exit all Windows-based programs.

2.Click Start, type regedit in the Start Search box, and then press ENTER.

3.If you receive the User Account Control dialog box, click Continue.

4.Locate and then click the following registry subkey:

HKEY_LOCAL_MACHINESystemCurrentControlSetServicesMsahci

5.In the right pane, right-click Start in the Name column, and then click Modify.

6.In the Value data box, type 0, and then click OK.

7.On the File menu, click Exit to close Registry Editor.

After this you’ll have to restart your computer, go to BIOS and enable AHCI. When you log in to Windows again, you’ll notice the installation of drivers for AHCI. Another restart will be required to finish the driver installation.

These steps are provided at your own risk and not suggested unless you know and understand the risks. You will want to make sure the controller driver and MB BIOS support this option before you enable it

Ok I've done it and it seem like its working. thanks for the help!

Link to comment
https://linustechtips.com/topic/183889-ssd-fragmentation/#findComment-2471203
Share on other sites

Link to post
Share on other sites

I think it is a type of garbage collection. It can be enabled by cmd in windows 7 or up.

 

Its not. TRIM is completly seperate thing from Garbage collection. Trim is simply a command, that windows sends to ssd, while GC is an internal mechanisem to keep the ssd tidy. Apples and oranges.

+°´°+,¸¸,+°´°~ Glorious PC master gaming race :wub: ~°´°+,¸¸,+°´°+
BigBox: Asus P8Z77-V, 3570k, 8GB Ram, Intel 180GB & Sammy 750GB, HD4000, W7
PiBox: Rasberry Pi, BCM @ 1225Mhz ^_^ , 256MB Ram, 16GB Storage, pIO, Raspbian

Link to comment
https://linustechtips.com/topic/183889-ssd-fragmentation/#findComment-2471827
Share on other sites

Link to post
Share on other sites

And no need to manually enable trim in windows, since its already enabled by default.

 

And one thing about AHCI and trim: a little known fact is, that AHCI is not a requirement

for TRIM. Trim works just as fine in IDE mode. Although ssd will be slower in ide mode, since IDE doesn't support NCQ among other things.

+°´°+,¸¸,+°´°~ Glorious PC master gaming race :wub: ~°´°+,¸¸,+°´°+
BigBox: Asus P8Z77-V, 3570k, 8GB Ram, Intel 180GB & Sammy 750GB, HD4000, W7
PiBox: Rasberry Pi, BCM @ 1225Mhz ^_^ , 256MB Ram, 16GB Storage, pIO, Raspbian

Link to comment
https://linustechtips.com/topic/183889-ssd-fragmentation/#findComment-2471829
Share on other sites

Link to post
Share on other sites

Defragging an SSD will shorten its life span greatly.

|EVGA 850 P2| |1440p PG279Q| |X570 Aorus Extreme| |Ryzen 9 3950x WC| |FE 2080Ti WC|TridentZ Neo 64GB| |Samsung 970 EVO M.2 1TB x3

 |Logitech G900|K70 Cherry MX Speed|  |Logitech Z906 |  |HD650|  |CaseLabs SMA8 (one of the last ones made)

 

Link to comment
https://linustechtips.com/topic/183889-ssd-fragmentation/#findComment-2473473
Share on other sites

Link to post
Share on other sites

Its not. TRIM is completly seperate thing from Garbage collection. Trim is simply a command, that windows sends to ssd, while GC is an internal mechanisem to keep the ssd tidy. Apples and oranges.

well I've heard the trim vs garbage collection argument, but isn't trim another way of achieving the same thing? In fact, I hear a lot of people refer to trim as a method of garbage collection. By definition, that would be right. I understand tradition SSD garbage collection is different than trim, but trim IS garbage collection. 

.

Link to comment
https://linustechtips.com/topic/183889-ssd-fragmentation/#findComment-2474217
Share on other sites

Link to post
Share on other sites

If a particular block was programmed and erased repeatedly without writing to any other blocks, that block would wear out before all the other blocks — thereby prematurely ending the life of the SSD.

 

Wear Leveling

This is why they look fragmented.

http://en.wikipedia.org/wiki/Wear_leveling

http://en.wikipedia.org/wiki/Write_amplification

Maximums - Asus Z97-K /w i5 4690 Bclk @106.9Mhz * x39 = 4.17Ghz, 8GB of 2600Mhz DDR3,.. Gigabyte GTX970 G1-Gaming @ 1550Mhz

 

Link to comment
https://linustechtips.com/topic/183889-ssd-fragmentation/#findComment-2474275
Share on other sites

Link to post
Share on other sites

And no need to manually enable trim in windows, since its already enabled by default.

 

And one thing about AHCI and trim: a little known fact is, that AHCI is not a requirement

for TRIM. Trim works just as fine in IDE mode. Although ssd will be slower in ide mode, since IDE doesn't support NCQ among other things.

Glad you pointed that out. A lot of people think it only works in AHCI for some reason. But you are wrong about the auto trim in windows partly. A LOT of people image their drive when upgrading to an SSD, and in that case trim is not enabled. 

.

Link to comment
https://linustechtips.com/topic/183889-ssd-fragmentation/#findComment-2474281
Share on other sites

Link to post
Share on other sites

Glad you pointed that out. A lot of people think it only works in AHCI for some reason. But you are wrong about the auto trim in windows partly. A LOT of people image their drive when upgrading to an SSD, and in that case trim is not enabled. 

 

it should be enabled (windows doesnt care if you have ssd or hdd, it does the alignment to 4k and sends trim commands regradless).

+°´°+,¸¸,+°´°~ Glorious PC master gaming race :wub: ~°´°+,¸¸,+°´°+
BigBox: Asus P8Z77-V, 3570k, 8GB Ram, Intel 180GB & Sammy 750GB, HD4000, W7
PiBox: Rasberry Pi, BCM @ 1225Mhz ^_^ , 256MB Ram, 16GB Storage, pIO, Raspbian

Link to comment
https://linustechtips.com/topic/183889-ssd-fragmentation/#findComment-2474599
Share on other sites

Link to post
Share on other sites

it should be enabled (windows doesnt care if you have ssd or hdd, it does the alignment to 4k and sends trim commands regradless).

No it's not. In fact, a lot of the time, even a fresh install will not always detect SSDs that support it, depending on the ssd and the chipset.

I'd say out of all of the SSDs I've installed, that happens about a third of the time. If I imaged it,  it's 100% of the time disabled. In fact the only reason that trim is enabled sometimes after imaging is some imaging software does this in addition to properly aligning the partitions. 

Its always good to check.  

Of course it is only supported for sata devices in windows, so I'm not counting PCIe ssds in that. 

.

Link to comment
https://linustechtips.com/topic/183889-ssd-fragmentation/#findComment-2474639
Share on other sites

Link to post
Share on other sites

well I've heard the trim vs garbage collection argument, but isn't trim another way of achieving the same thing? In fact, I hear a lot of people refer to trim as a method of garbage collection. By definition, that would be right. I understand tradition SSD garbage collection is different than trim, but trim IS garbage collection. 

 

No, this is not correct. Trim and garbage collection are two completly separate things, but the DO work in conjunction.

 

Trim is a simple command, that windows sends to ssd when you delete something; because ssds are not filesystem aware, they dont really know when you delete something, unless some new data hits the same location as the deleted data. Here trim comes into play, as it tells the ssd immediatly, that you deleted something and can treat that data as invalid, thus using that space as free (this has several benefits, such as better write speeds over time, lower write amplification).

 

Garbage on the other hand is an internal mechanisem, that manages the data and keeps the ssd tidy.  Since flash works quite differently that harddrives (for example data cant be overwritten) a mechanisem like GC is required. It erases the blocks when needed (this can only happen at page level) and copies the data in the pages somewhere else if necessery. Here TRIM comes into play, since it decreases the number of blocks, that ssd needs to drag around, because it is only moving valid data (and no more user deleted data, that ssd isn't yet aware, that is invalid).

 

A more in depth read can be found here http://www.thessdreview.com/daily-news/latest-buzz/garbage-collection-and-trim-in-ssds-explained-an-ssd-primer/

+°´°+,¸¸,+°´°~ Glorious PC master gaming race :wub: ~°´°+,¸¸,+°´°+
BigBox: Asus P8Z77-V, 3570k, 8GB Ram, Intel 180GB & Sammy 750GB, HD4000, W7
PiBox: Rasberry Pi, BCM @ 1225Mhz ^_^ , 256MB Ram, 16GB Storage, pIO, Raspbian

Link to comment
https://linustechtips.com/topic/183889-ssd-fragmentation/#findComment-2474649
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×