TRIM Support: Difference between revisions

From Playing with linux...
Jump to navigation Jump to search
(Created page with "=ext4= TRIM support is available on ext4. It is activated by adding discard to the list of mount options. So in /etc/fstab it says something like: <pre> /dev/sdx1 /some...")
 
No edit summary
 
(4 intermediate revisions by the same user not shown)
Line 3: Line 3:
<pre>
<pre>
/dev/sdx1        /somewhere              ext4        defaults,discard        1  1
/dev/sdx1        /somewhere              ext4        defaults,discard        1  1
</pre>
You can also discard the unused blocks manually by using:
<pre>
fstrim -v /somewhere
</pre>
The resulting amount of space trimmed may not be the same as the actual space freed on the disk. It is safe to repeat this, for example in a cronjob.
<pre>
/somewhere: 3 GiB (3267461120 bytes) trimmed
</pre>
=ntfs on windows=
TRIM support is available on ntfs and refs. You can check if it's active by using the following command:
<pre>
fsutil behavior query disabledeletenotify
</pre>
The response will be like this:
<pre>
NTFS DisableDeleteNotify = 0  (Disabled)
ReFS DisableDeleteNotify = 0  (Disabled)
</pre>
A value of 0 means that it's not disabled, so that TRIM support is active.
You can manually trim a drive from PowerShell with:
<pre>
Optimize-Volume -DriveLetter C -ReTrim -Verbose
</pre>
</pre>

Latest revision as of 16:20, 3 January 2024

ext4

TRIM support is available on ext4. It is activated by adding discard to the list of mount options. So in /etc/fstab it says something like:

/dev/sdx1        /somewhere               ext4        defaults,discard         1   1

You can also discard the unused blocks manually by using:

fstrim -v /somewhere

The resulting amount of space trimmed may not be the same as the actual space freed on the disk. It is safe to repeat this, for example in a cronjob.

/somewhere: 3 GiB (3267461120 bytes) trimmed

ntfs on windows

TRIM support is available on ntfs and refs. You can check if it's active by using the following command:

fsutil behavior query disabledeletenotify

The response will be like this:

NTFS DisableDeleteNotify = 0  (Disabled)
ReFS DisableDeleteNotify = 0  (Disabled)

A value of 0 means that it's not disabled, so that TRIM support is active.

You can manually trim a drive from PowerShell with:

Optimize-Volume -DriveLetter C -ReTrim -Verbose