How to check if disk attached to Linux OS is SSD or SATA?
Linux - HardwareThis forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
1. If you mean 'NVMe' by SSD, they will show up as /dev/nvme as opposed to /dev/sd as block devices, unless they're all hidden behind a RAID controller or somesuch (won't apply to NVMe of course). SSDs can be SATA devices too, however, so there'd be no way (other than to observe its performance or physically check the device or dump its information and then google whatever you get) to verify mechanical drive vs SSD programatically.
... so there'd be no way (other than to observe its performance or physically check the device or dump its information and then google whatever you get) to verify mechanical drive vs SSD programatically.
It rarely pays to be so dogmatic with Linux.
Code:
cat /sys/block/sd?/queue/rotational
"1" means yes, "0" no. There are a few edge cases (USB flash e.g.) but there are also other solutions that might need some parsing - SMART e.g.
"1" means yes, "0" no. There are a few edge cases (USB flash e.g.) but there are also other solutions that might need some parsing - SMART e.g.
Yeah my reasoning is basically in-line with your answer here - 'other solutions that might need some parsing' - you can get linux (or whatever other OS, or the system BIOS/UEFI) to spit out a full model # on some level and that will be absolutely definitive once resolved back to the manufacturer specs. I wouldn't (personally) trust any system to make a 'guess' as to a drive being 'rotational' or 'not' (to my understanding this is based on a lookup of the device ID, right?) as the absolute final word (even if it works 99% of the time) specifically because of the aforesaid corner cases (including SSHDs and other hybrid solutions, as well as devices being potentially abstracted by controllers (e.g. as here: https://unix.stackexchange.com/quest...ational-should)). I don't see that as 'dogmatic' but whatever blows your hair back I guess...
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.