I’m currently trying to know if I have a SATA or an SSD disk installed on an HP ProDesk. Before opening it, I wonder if there’s a command that allows to get this kind of information. I’ve googled this, but only found some unreliable information.
I know you are using ansible, so jlehtone’s answer may be better, but for manual inspection if you have smartd enabled, and the drives support it, you can use journalctl | grep -i ssd to show any SSD drives, and journalctl | grep -i smart will show if smartd is running, and if it is what it is currently monitoring. Look for a line like this one:
Monitoring 3 ATA/SATA, 0 SCSI/SAS and 0 NVMe devices
You can track disks down to id’s and busses used vai cmds like: lshw -class disk -class storage lsblk -S <–show only SCSI lsblk -d -o MODEL,SIZE,STATE,TYPE,ROTA,KNAME,HCTL,TRAN,VENDOR lspci lsscsi
et.al. (too many to list)
You could of course use dmesg | grep <keyword> or journalctl -b | grep <keyword> to shrink the search space for speed, and systemctl status smartd.
I think NezSez’s answer is pretty good. I would like to make his answer a little bit easier to use.
From my own ThinPC, the commands I used are as belows:
# lspci | egrep "NVME|SCSI|SAS|SATA"
00:1f.2 SATA controller: Intel Corporation 8 Series/C220 Series Chipset Family 6-port SATA Controller 1 [AHCI mode] (rev 04)
# lsblk -d -o MODEL,SIZE,STATE,TYPE,ROTA,KNAME,HCTL,TRAN,VENDOR
MODEL SIZE STATE TYPE ROTA KNAME HCTL TRAN VENDOR
Hoodisk SSD 119.2G running disk 0 sda 0:0:0:0 sata ATA
4G disk 0 zram0
0B disk 0 zram1
0B disk 0 zram2
As you can see, the storage controller in my thinPC is an embeded SATA controller, while the disk in my thin pc is a 120G SATA SSD.
Hope this helps you.
Note that Solid State Disk (SSD) is a storage type, while Serial Advanced Technology Attachment (SATA) is a connection protocol. It’s very common to have an SSD connected by SATA. Perhaps you mean M.2/NVMe vs SATA, or HDD vs SSD?