Jump to content

TRIM on NVMe disk under WinXP


Recommended Posts

Posted

On SATA SSD disks you can do TRIM manually under WinXP using programs e.g. Intel SSD Toolbox, Solid State Doctor etc.

I have a NVMe disk and when I run these programs on WinXP, they see the disk but they do not support the TRIM because the disk is connected using the SCSI controller and not SATA, e.g. Solid State Doctor display this:

2731823500_1667647054_thumb.jpg

Quote from the program manufacturer:

Not compatible with RAID, drives that detect as SCSI, or with Serial Attached SCSI (SAS) SSDs

Does anyone know any program for making TRIM on a NVMe disk?


Posted (edited)

@reboot12

1) Did you sure about Intel SSD Toolbox, Solid State Doctor, etc ? On pre-Vista OSes these utils must traverse NTFS filesystem, find free clusters and send TRIM to disk for each found cluster number. Check with "trimcheck" for real results.

2) Try TxBENCH, it supposed do right way to calculate TRIM clusters on XP, may be it will works with SCSI too

Edited by Mov AX, 0xDEAD
Posted (edited)

@Mov AX, 0xDEAD

1) trimcheck - second run:

D:\soft>trimcheck-0.7-win64.exe
TRIM check v0.7 - Written by Vladimir Panteleev
https://github.com/CyberShadow/trimcheck

Loading continuation data from D:\soft\trimcheck-cont.json...
  Drive path   :  \\.\D:
  Offset       :  31755780096
  Random data  :  87 2C EF 4E B1 FA 98 42 BE 32 EC 9C B2 B5 B0 36...

Reading raw volume data...
  Opening \\.\D:...
  Seeking to position 31755780096...
  Reading 16384 bytes...
  First 16 bytes: 87 2C EF 4E B1 FA 98 42 BE 32 EC 9C B2 B5 B0 36...
Data unchanged.

CONCLUSION: TRIM appears to be NOT WORKING (or has not kicked in yet).

You can re-run this program to test again with the same data block,
or delete trimcheck-cont.json to create a new test file.

Press Enter to exit...

2) TxBENCH:

7893074600_1670265340_thumb.jpg

In disks SSD on SCSI - TRIM is basically UNMAP:

TRIM (UNMAP in SCSI terminology)

1508696200_1670266592_thumb.jpg

So maybe I need a program for UNMAP and not TRIM?

Edited by reboot12
Posted

Can a program stop Windows from writing to the disk while it is working? What if it finds free space, then the system puts some files there, and a moment later a trim is sent to delete the new files. Usually various low level disk utilities require the disk to be unmounted to work. On Win7 when trim is working, deleted files immediately appear as 00 00 and cannot be recovered. Maybe you could install NT6 in dual boot, and occcasionally run ForceTrim from there.

Posted (edited)
3 hours ago, j7n said:

Maybe you could install NT6 in dual boot, and occcasionally run ForceTrim from there.

What program is to make a TRIM under Win7 or newer? Samsung Magician only shows TRIM Status

P.S. I found it:

One consequence of the flash translation layer is that logical blocks do not necessarily correspond to physical locations on the NAND at all times. In fact, there is a command that clears the translation for a block. In NVMe, this command is called deallocate, in SCSI it is called unmap, and in SATA it is called trim.

SATA > TRIM

SCSI > UNMAP

NVMe > DEALLOCATE

Edited by reboot12
Posted

The program "ForceTrim" creates a file across the free space (as known by the operating system) and then deletes it. It expects Windows 7 to then send a trim for all sectors belonging to this file. This works if Windows 7 normally does it for your drive (with a different driver than you have now in XP). You could run it after a significant number of files have been changed, once a month or so.

I've tested it by writing some data onto an empty sector with WinHex, and it disappeared after a few seconds.

Posted

How long does the 20GB TRIM partition last? I launched the TRIM option in the Smart Defrag 4.2 program on WinXP, but if TRIM was actually done, I don't know because it lasted only about 2 seconds ? How to check if TRIM has been made?

7028702700_1670416936_thumb.jpg 8647783800_1670416936_thumb.jpg

Posted
3 hours ago, reboot12 said:

...it lasted only about 2 seconds ?

Seems about right for a fast-ish system. All TRIM does is send the drive a list of sectors to erase. Depending on how the program builds this list, the time may vary, and also you could have issues like i.e. trimming a sector that is marked as free (due to bad shutdown, etc.), but is actually used. 

3 hours ago, reboot12 said:

How to check if TRIM has been made?

Get some Hex editor, open the disk, and browse to a free sector with non-zero content in it. 

Perform trimming. 

Reload that sector in the editor and check if it is zero-filled now.

Posted

According to what is reported by TrimCheck, O&O Defrag v17.5.559 seems to perform the trim in XP also for the NVMe drives:

 

before trim:

1-before-trim.png

 

running trim:

2-running-trim.png

 

after trim:

3-after-trim.png

Posted
7 hours ago, Andalu said:

O&O Defrag v17.5.559 seems to perform the trim in XP also for the NVMe drives:

I have this message:

4248546200_1670526581_thumb.jpg

Posted (edited)

@reboot12 @George King

It also depends on the NVMe drivers and the drive model.

I have tried O&O Defrag for all my NVMe drives (Samsung, WD, Crucial, Sabrent) and the trim icon becomes available for all of them only with MS and Samsung drivers (note that the latter sometimes gives an error at system shutdown).

Only for the Samsung 970Evo the trim is enabled in O&O with all NVMe drivers.

Edited by Andalu
Posted
3 hours ago, George King said:

Maybe it depends on storport version?

I use storport.sys .4021 (WindowsServer2003.WindowsXP-KB932755-x64-ENU.exe) and Kai Schtrom 1.3 NVMe driver.

Posted (edited)

@George King

I tested your NVMe x64 drivers from the Ported_Drivers_for_XP2ESD.7z

  • Samsung_NVMe_3.3.0.2003 - error while installation in .inf file
  • Generic_NVMe_10.4.49.0 - after restart WinXP SP2 x64 not boot - probably BSOD
  • Generic_NVMe_6.1.7601.23403 - working :-)

With this driver, the O&O Defrag program no longer displays a warning and makes a TRIM - the progress bar goes as a percentage - unfortunately after making a TRIM in the sector in which the file was still no zero

but trimcheck-0.7-win64.exe (second run after TRIM by O&O Defrag) displays that TRIM works:

6934613000_1670659139_thumb.jpg

Maybe I check the sector in WinHex badly ???

EDITED

=====

My test text file is too small because it has only a few bytes.

I noticed that the trimcheck program creates a 64MB test file. So I copied to the desktop some other file, e.g. explorer.exe 1.30MB, checked the sector in WinHex, removed the file - also from the Recycle Bin, I made a TRIM in O&O Defrag and now I have zero in the sector where the file was :D

So I have a way to make a TRIM on the NVMe disk at WinXP SP2 64-bit - ported driver Generic_NVMe_6.1.7601.23403 + O&O Defrag v17.5.559 :cheerleader::thumbup

P.S. I wonder why Smart Defrag doesn't do TRIM ???

I am only thinking about one thing - why I can't use a small text file for the test - a few bytes ???

 

Edited by reboot12

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...