linux下硬盘状况查看

找到了两种方法

第一种是smart control法

现在的硬盘基本都有这个自带的功能,命令:
sudo smartctl -H /dev/sda5 -a
其中’-a’可以输出具体的信息,要不然只会输出是否pass。
硬盘的基本信息:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
=== START OF INFORMATION SECTION ===
Model Family: Seagate Barracuda 7200.14 (AF)
Device Model: ST500DM002-1BC142
Serial Number: 5VMYZABG
LU WWN Device Id: 5 000c50 03d511520
Firmware Version: JC4B
User Capacity: 500,107,862,016 bytes [500 GB]
Sector Size: 512 bytes logical/physical
Rotation Rate: 7200 rpm
Device is: In smartctl database 7.3/5319
ATA Version is: ATA8-ACS T13/1699-D revision 4
SATA Version is: SATA 3.0, 6.0 Gb/s (current: 3.0 Gb/s)
Local Time is: Tue Nov 28 15:15:30 2023 UTC
SMART support is: Available - device has SMART capability.
SMART support is: Enabled

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

...

Vendor Specific SMART Attributes with Thresholds:
ID# ATTRIBUTE_NAME FLAG VALUE WORST THRESH TYPE UPDATED WHEN_FAILED RAW_VALUE
1 Raw_Read_Error_Rate 0x000f 112 096 006 Pre-fail Always - 45226076
3 Spin_Up_Time 0x0003 100 100 000 Pre-fail Always - 0
4 Start_Stop_Count 0x0032 095 095 020 Old_age Always - 6110
5 Reallocated_Sector_Ct 0x0033 100 100 036 Pre-fail Always - 0
7 Seek_Error_Rate 0x000f 086 060 030 Pre-fail Always - 408482396
9 Power_On_Hours 0x0032 080 080 000 Old_age Always - 17715
10 Spin_Retry_Count 0x0013 100 100 097 Pre-fail Always - 0
12 Power_Cycle_Count 0x0032 095 095 020 Old_age Always - 5528
183 Runtime_Bad_Block 0x0032 100 100 000 Old_age Always - 0
184 End-to-End_Error 0x0032 100 100 099 Old_age Always - 0
187 Reported_Uncorrect 0x0032 001 001 000 Old_age Always - 259
188 Command_Timeout 0x0032 100 095 000 Old_age Always - 2 2 821
189 High_Fly_Writes 0x003a 100 100 000 Old_age Always - 0
190 Airflow_Temperature_Cel 0x0022 068 053 045 Old_age Always - 32 (Min/Max 24/37)
194 Temperature_Celsius 0x0022 032 047 000 Old_age Always - 32 (0 7 0 0 0)
195 Hardware_ECC_Recovered 0x001a 031 022 000 Old_age Always - 45226076
197 Current_Pending_Sector 0x0012 100 100 000 Old_age Always - 0
198 Offline_Uncorrectable 0x0010 100 100 000 Old_age Offline - 0
199 UDMA_CRC_Error_Count 0x003e 200 200 000 Old_age Always - 0
240 Head_Flying_Hours 0x0000 100 253 000 Old_age Offline - 32920h+36m+34.032s
241 Total_LBAs_Written 0x0000 100 253 000 Old_age Offline - 2741956613
242 Total_LBAs_Read 0x0000 100 253 000 Old_age Offline - 2978174219

看着倒是没什么问题。很老了,希望不会坏

查坏道

机械硬盘运行时不可避免会出现坏道,当坏道较多的时候就尽快更换硬盘吧。命令:
sudo badblocks -v /dev/sda5 > bad_5.txt
结果

1
2
3
4
Checking blocks 0 to 73408985
Checking for bad blocks (read-only test):
done
Pass completed, 0 bad blocks found. (0/0/0 errors)

还可以,好像没什么问题


linux下硬盘状况查看
http://blog.jiuge.host/post/20231128232255.html
作者
Pigeon.🕊
发布于
2023年11月28日
许可协议
CC BY-NC-SA 3.0