IOCTL for SSD read/write cycle

I’m prototyping a file system driver targeting some SSD like device. And heard that this kind of device will keep the read/write cycles in it. If so , my question is how to read these metrics from the device by means of IOCTL. Many thanks!!!

This isn’t really a file system question…

Is it an NVMe device? Does this help?

https://docs.microsoft.com/en-us/windows/win32/fileio/working-with-nvme-devices#example-nvme-identify-query

@“Scott_Noone_(OSR)” said:
This isn’t really a file system question…

Is it an NVMe device? Does this help?

https://docs.microsoft.com/en-us/windows/win32/fileio/working-with-nvme-devices#example-nvme-identify-query

Thanks. In my situation , it is an AHCI attached SSD and the miniport driver is the iaStorAC.sys. I want to know if this kind of miniport
driver support the metrics reading. Is it NVMe only feature ? Many thanks!!!

Do you know how the drive actually reports this data? My guess would be that it’s reported via S.M.A.R.T., though a) that’s a guess and b) I’ve never tried to programmatically read that data from a drive.

You might want to try starting with smartmontools and see if that gives you any clues. It’s open source and does read at least some SMART data from devices.

@“Scott_Noone_(OSR)” said:
Do you know how the drive actually reports this data? My guess would be that it’s reported via S.M.A.R.T., though a) that’s a guess and b) I’ve never tried to programmatically read that data from a drive.

You might want to try starting with smartmontools and see if that gives you any clues. It’s open source and does read at least some SMART data from devices.

Ok. I’ll check the S.M.A.R.T