[新手上路]批处理新手入门导读[视频教程]批处理基础视频教程[视频教程]VBS基础视频教程[批处理精品]批处理版照片整理器
[批处理精品]纯批处理备份&还原驱动[批处理精品]CMD命令50条不能说的秘密[在线下载]第三方命令行工具[在线帮助]VBScript / JScript 在线参考
返回列表 发帖

[硬件管理] 可以读取硬盘S.M.A.R.T信息的命令行工具smartctl

论坛上有人问程序中怎么判断C盘是不是SSD?
找到这个工具,需要在程序员读取S.M.A.R.T信息,估计会很有用。

SMART中有硬盘自检信息,错误计数,硬盘转数等等信息。HDTune显示的很多信息就是来自SMART信息。


这是一个开源跨平台的工具,Linux平台的用法我这里就不写了,只写Windows下smartctl命令用法。

作者:快银闪电侠 链接: http://my.oschina.net/ysj/blog/520976

Batch-CN收录了smartctl主程序,安装Batch-CN后,一句命令可以获取smartctl:

c:\>gt smartctl
下载成功


```
#windows下显示C盘信息.
c:\>smartctl -a c:
smartctl 6.4 2015-06-04 r4109 [i686-w64-mingw32-win7(64)-sp1] (sf-6.4-1)
Copyright (C) 2002-15, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF INFORMATION SECTION ===
Model Family:     SandForce Driven SSDs
Device Model:     KINGSTON SV300S37A120G

User Capacity:    120,034,123,776 bytes [120 GB]
Sector Size:      512 bytes logical/physical
Rotation Rate:    Solid State Device

```

我有一个二手闪迪U盘,一块SSD,一块机械硬盘,sda 表示第一个硬盘,sdb第二,U盘估计是sdc:
```
#这个U盘系列好像是也用了固态盘的芯片,所以会经常被识别成硬盘。
c:\>smartctl -i sdc
smartctl 6.4 2015-06-04 r4109 [i686-w64-mingw32-win7(64)-sp1] (sf-6.4-1)
Copyright (C) 2002-15, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF INFORMATION SECTION ===
Model Family:     SanDisk based SSDs
Device Model:     SanDisk SSD U100 16GB
Serial Number:    0ba4e8360
User Capacity:    16,013,942,784 bytes [16.0 GB]
Sector Size:      512 bytes logical/physical
Rotation Rate:    Solid State Device
Form Factor:      1.8 inches
Device is:        In smartctl database [for details use: -P show]
ATA Version is:   ACS-2 T13/2015-D revision 3
SATA Version is:  SATA 3.0, 6.0 Gb/s (current: 3.0 Gb/s)
Local Time is:    Fri Oct 23 02:37:12 2015
SMART support is: Available - device has SMART capability.
SMART support is: Enabled
```
smartctl -a f: 一下就真相了。

```
c:\>smartctl -a f:
smartctl 6.4 2015-06-04 r4109 [i686-w64-mingw32-win7(64)-sp1] (sf-6.4-1)
Copyright (C) 2002-15, Bruce Allen, Christian Franke, www.smartmontools.org

f:: Unable to read USB device ID
Please specify device type with the -d option.

```

>[Batch-CN](http://bbs.bathome.net/thread-32322-1-1.html)

>[linux smartctl ](http://www.live-in.org/archives/1047.html)
>[smartctl 官方网站](http://www.smartmontools.org/)  
>[smartctl 完整下载] http://sourceforge.net/projects/smartmontools/

>[python S.M.A.R.T库pySMART](https://pypi.python.org/pypi/pySMART/0.2)

返回列表