【Linux】Linux下判断磁盘是SSD还是HDD的几种方法

#  cat /sys/block/*/queue/rotational

You should get 1 for hard disks and 0 for a SSD.

It will probably not work if your disk is a logical device emulated by hardware (like a RAID controller).


通过判断cat /sys/block/*/queue/rotational的返回值(其中*为你的硬盘设备名称,例如sda等等),如果返回1则表示磁盘可旋转,那么就是HDD了;反之,如果返回0,则表示磁盘不可以旋转,那么就有可能是SSD了。


#  lsblk -d -o name,rota 

使用lsblk命令进行判断,参数-d表示显示设备名称,参数-o表示仅显示特定的列。




参考


How to know if a disk is an SSD or an HDD

https://unix.stackexchange.com/questions/65595/how-to-know-if-a-disk-is-an-ssd-or-an-hdd


Linux下判断磁盘是SSD还是HDD的几种方法

https://blog.csdn.net/sch0120/article/details/77725658


Linux下如何查看硬盘是固态硬盘SSD还是机械硬盘HDD

https://blog.csdn.net/qq_40586364/article/details/103908967


Which linux filesystem works best with SSD

https://superuser.com/questions/228657/which-linux-filesystem-works-best-with-ssd

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

友情链接更多精彩内容