SysBlockDeviceRotational returns the rotational value for the block device from /sys/block/ /queue/rotational. A value of 1 indicates a rotational device (HDD), 0 indicates a non-rotational device (SSD, NVMe). An error is returned if the file cannot be read or does not contain a valid integer
(device string)
| 498 | // non-rotational device (SSD, NVMe). An error is returned if the file |
| 499 | // cannot be read or does not contain a valid integer. |
| 500 | func (fs FS) SysBlockDeviceRotational(device string) (uint64, error) { |
| 501 | return parsers.ReadUintFromFile(fs.sys.Path(sysBlockPath, device, sysBlockQueue, "rotational")) |
| 502 | } |
| 503 | |
| 504 | // SysBlockDeviceIO returns stats for the block device io counters |
| 505 | // IO done count: /sys/block/<disk>/device/iodone_cnt |