linux下磁盘检测(今天有个群友问的,顺便记录下来吧)

我的办公系统是ubuntu

安装

sudo apt-get install smartmontools


sam@sam:~$ sudo smartctl -i /dev/sda
smartctl 6.4 2014-10-07 r4002 [x86_64-linux-3.19.0-33-generic] (local build)
Copyright (C) 2002-14, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF INFORMATION SECTION ===
Model Family:     Western Digital Caviar Blue (SATA 6Gb/s)
Device Model:     WDC WD10EZEX-21M2NA0
Serial Number:    WMC3F0DCNPVC
LU WWN Device Id: 5 0014ee 05934c40f
Firmware Version: 01.01A01
User Capacity:    1,000,204,886,016 bytes [1.00 TB]
Sector Sizes:     512 bytes logical, 4096 bytes physical
Rotation Rate:    7200 rpm
Device is:        In smartctl database [for details use: -P show]
ATA Version is:   ACS-2, ACS-3 T13/2161-D revision 3b
SATA Version is:  SATA 3.1, 6.0 Gb/s (current: 6.0 Gb/s)
Local Time is:    Mon Nov 16 14:49:08 2015 CST
SMART support is: Available - device has SMART capability.
SMART support is: Enabled


"SMART support is: Enabled" 硬盘打开了SMART支持


如果是"Disabled",运行

smartctl --smart=on --offlineauto=on --saveauto=on /dev/sda


磁盘健康状态:

sam@sam:~$ sudo smartctl -H /dev/sda
smartctl 6.4 2014-10-07 r4002 [x86_64-linux-3.19.0-33-generic] (local build)
Copyright (C) 2002-14, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF READ SMART DATA SECTION ===
SMART overall-health self-assessment test result: PASSED


PASSED为健康.Failure的话,就要换磁盘了.


其他的可以看看这个命令的帮助


smartctl -h

你可能感兴趣的:(linux磁盘检查)