How to determine storage type (SSD drive or HHD .mechanical drive), using C language

最后都变了- 提交于 2019-12-06 10:29:26

SSD are supposed to identify themselves as non-rotative. For linux, as example, you can get the info via sysfs:

cat /sys/block/sda/queue/rotational

If it returns 0, you have SSD...

Have you considered doing a read/write test to try to determine capabilities ?

Jeremy Morgan

You can use the GetDriveType Method from the win32 library, and you might be able to differentiate that way, or you use GetVolumeInformation to try and determine it from the label.

This guess is a long shot but I can't find anything better. In the device's identification structure, see if it supports acoustic management. Old disk drives didn't, but maybe most modern disk drives do. Obviously SSDs don't need acoustic management but let's hope they'll say they don't, instead of pretending to be disk drives.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!