Linux判断硬盘是SSD还是普通硬盘

不依赖外部软件的话

返回0是SSD硬盘,如果返回1 代表是普通硬盘
如果是虚拟化的,把sda改为vda或者其他盘符即可

Linux automatically detects SSD, and since kernel version 2.6.29, you may verify sda with:

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).

See this answer for more information…

One thought on “Linux判断硬盘是SSD还是普通硬盘

  1. 2

    你这也改改 模板

发表回复

您的电子邮箱地址不会被公开。 必填项已用*标注