Hi,
I'm working on a tool (in perl) that show some informations about availables disks.
For this tool, i use under the hood theses commands :
with theses commands, i have a lot of informations, but i'm not able to determine:
For the disk type, i tried to use "smartctl" using "Rotational Rate" attribute.
But smartctl didn't work for USB device and i'm not sure that smartctl report theses attributes the same way for all disks (since it may depends to the disk firmware ?)
For the connection type, i had some options (but theses ones did'nt cover all fields)
I'm not able to determine a SATA drive if it is connected on a SAS controller (i want the disk connection type, not the current controller used in this case)
For USB key, i haven't any idea for detect this type.
Thanks for any advice,
Sébastien.
I'm working on a tool (in perl) that show some informations about availables disks.
For this tool, i use under the hood theses commands :
Code:
- sas2ircu / sas3ircu
- geom
- gmultipath
- glabel
- zpool
- diskinfo
with theses commands, i have a lot of informations, but i'm not able to determine:
Code:
- Disk type (SSD, HDD)
- Disk Connection type (SAS, SATA, NVME, USB)
For the disk type, i tried to use "smartctl" using "Rotational Rate" attribute.
But smartctl didn't work for USB device and i'm not sure that smartctl report theses attributes the same way for all disks (since it may depends to the disk firmware ?)
For the connection type, i had some options (but theses ones did'nt cover all fields)
Code:
- camcontrol identify : if no error, it's a SATA drive
- camcontrol inquiry : if no error, it's a SAS drive or a SATA drive on a SAS controller.
- nvmecontrol list : for detect nvme drives
I'm not able to determine a SATA drive if it is connected on a SAS controller (i want the disk connection type, not the current controller used in this case)
For USB key, i haven't any idea for detect this type.
Thanks for any advice,
Sébastien.