I'm working on a OS portable program that would benefit from detecting if a physical storage device is a SSD or a plain old spin-disk.
On Linux there is:
/sys/block/sdX/queue/rotational
which return 0 or 1 if SSD, but I'm not sure if this is the best way.
On Windows and UNIX I have not found any way of detecting it, perhaps I should use ioctl DEVICE_SEEK_PENALTY_DESCRIPTOR
and check the seek penelty (which should be very low on a SSD storage device), or perhaps use DeviceIoControl
to check the nominal media rotation rate (which also should be very low on a SSD storage device).
Any recommendations for me on how to proceed with detecting SSD disks on POSIX compatible OS'es?