Linux - jak zjistit stav disku ze SMART přes terminál

Linux - jak zjistit stav disku ze SMART přes terminál

Dobrý den, marně pátrám, jak vyčíst data o stavu disku ze S.M.A.R.T. (smart) přes linux terminál. Je na to nějaký příkaz? Lze tak provést i nejaké diagnostické testy disku, abych zjistil skutečný stav?

ODPOVĚĎ


smartctl -a $device pro vycteni vseho.
smartctl -t {short,long} $device pro spousteni testu.
Zbytek je v manualu ;)

ODPOVĚĎ


Dobrý den,

díky za nakopnutí, pomohlo mi to.

Jen doplním, že je nutné nainstalovat balíček smartmontools
- apt-get install smartmontools

A kdo radši grafickou nadstavbu, tak může použít GSmartControl
- apt-get install gsmartcontrol smart-notifier




[root@server ~]# smartctl -a /dev/sdc
smartctl 6.2 2017-02-27 r4394 [x86_64-linux-3.10.0-693.5.2.el7.x86_64] (local build)
Copyright (C) 2002-13, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF INFORMATION SECTION ===
Model Family: Seagate Barracuda 7200.12
Device Model: ST31000528AS
Serial Number: 9VP3LCYW
LU WWN Device Id: 5 000c50 01a403e1b
Firmware Version: CC38
User Capacity: 1,000,204,886,016 bytes [1.00 TB]
Sector Size: 512 bytes logical/physical
Rotation Rate: 7200 rpm
Device is: In smartctl database [for details use: -P show]
ATA Version is: ATA8-ACS T13/1699-D revision 4
SATA Version is: SATA 2.6, 3.0 Gb/s
Local Time is: Tue Nov 28 11:09:33 2017 EST

==> WARNING: A firmware update for this drive may be available,
see the following Seagate web pages:
http://knowledge.seagate.com/articles/en_US/FAQ/207931en
http://knowledge.seagate.com/articles/en_US/FAQ/213891en

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
See vendor-specific Attribute list for marginal Attributes.

General SMART Values:
Offline data collection status: (0x82) Offline data collection activity
was completed without error.
Auto Offline Data Collection: Enabled.
Self-test execution status: ( 0) The previous self-test routine completed
without error or no self-test has ever
been run.
Total time to complete Offline
data collection: ( 609) seconds.
Offline data collection
capabilities: (0x7b) SMART execute Offline immediate.
Auto Offline data collection on/off support.
Suspend Offline collection upon new
command.
Offline surface scan supported.
Self-test supported.
Conveyance Self-test supported.
Selective Self-test supported.
SMART capabilities: (0x0003) Saves SMART data before entering
power-saving mode.
Supports SMART auto save timer.
Error logging capability: (0x01) Error logging supported.
General Purpose Logging supported.
Short self-test routine
recommended polling time: ( 1) minutes.
Extended self-test routine
recommended polling time: ( 184) minutes.
Conveyance self-test routine
recommended polling time: ( 2) minutes.
SCT capabilities: (0x103f) SCT Status supported.
SCT Error Recovery Control supported.
SCT Feature Control supported.
SCT Data Table supported.

SMART Attributes Data Structure revision number: 10
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 116 096 006 Pre-fail Always - 107169172
3 Spin_Up_Time 0x0003 093 093 000 Pre-fail Always - 0
4 Start_Stop_Count 0x0032 099 099 020 Old_age Always - 1936
5 Reallocated_Sector_Ct 0x0033 100 100 036 Pre-fail Always - 0
7 Seek_Error_Rate 0x000f 073 069 030 Pre-fail Always - 81964960571
9 Power_On_Hours 0x0032 080 080 000 Old_age Always - 17862
10 Spin_Retry_Count 0x0013 100 100 097 Pre-fail Always - 0
12 Power_Cycle_Count 0x0032 100 100 020 Old_age Always - 120
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 031 031 000 Old_age Always - 69
188 Command_Timeout 0x0032 100 100 000 Old_age Always - 0
189 High_Fly_Writes 0x003a 099 099 000 Old_age Always - 1
190 Airflow_Temperature_Cel 0x0022 068 045 045 Old_age Always In_the_past 32 (Min/Max 22/32)
194 Temperature_Celsius 0x0022 032 055 000 Old_age Always - 32 (0 18 0 0 0)
195 Hardware_ECC_Recovered 0x001a 038 024 000 Old_age Always - 107169172
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 - 253802502425332
241 Total_LBAs_Written 0x0000 100 253 000 Old_age Offline - 2296239477
242 Total_LBAs_Read 0x0000 100 253 000 Old_age Offline - 3152154261

SMART Error Log Version: 1
ATA Error Count: 60 (device log contains only the most recent five errors)
CR = Command Register [HEX]
FR = Features Register [HEX]
SC = Sector Count Register [HEX]
SN = Sector Number Register [HEX]
CL = Cylinder Low Register [HEX]
CH = Cylinder High Register [HEX]
DH = Device/Head Register [HEX]
DC = Device Command Register [HEX]
ER = Error register [HEX]
ST = Status register [HEX]
Powered_Up_Time is measured from power on, and printed as
DDd+hh:mm:SS.sss where DD=days, hh=hours, mm=minutes,
SS=sec, and sss=millisec. It "wraps" after 49.710 days.

Error 60 occurred at disk power-on lifetime: 17109 hours (712 days + 21 hours)
When the command that caused the error occurred, the device was active or idle.

After command completion occurred, registers were:
ER ST SC SN CL CH DH
-- -- -- -- -- -- --
40 51 00 ff ff ff 0f Error: UNC at LBA = 0x0fffffff = 268435455

Commands leading to the command that caused the error were:
CR FR SC SN CL CH DH DC Powered_Up_Time Command/Feature_Name
-- -- -- -- -- -- -- -- ---------------- --------------------
25 00 00 ff ff ff ef 00 14d+08:48:06.844 READ DMA EXT
27 00 00 00 00 00 e0 00 14d+08:48:06.839 READ NATIVE MAX ADDRESS EXT [OBS-ACS-3]
ec 00 00 00 00 00 a0 00 14d+08:48:06.838 IDENTIFY DEVICE
ef 03 46 00 00 00 a0 00 14d+08:48:06.838 SET FEATURES [Set transfer mode]
27 00 00 00 00 00 e0 00 14d+08:48:06.838 READ NATIVE MAX ADDRESS EXT [OBS-ACS-3]

Error 59 occurred at disk power-on lifetime: 17109 hours (712 days + 21 hours)
When the command that caused the error occurred, the device was active or idle.

After command completion occurred, registers were:
ER ST SC SN CL CH DH
-- -- -- -- -- -- --
40 51 00 ff ff ff 0f Error: UNC at LBA = 0x0fffffff = 268435455

Commands leading to the command that caused the error were:
CR FR SC SN CL CH DH DC Powered_Up_Time Command/Feature_Name
-- -- -- -- -- -- -- -- ---------------- --------------------
25 00 00 ff ff ff ef 00 14d+08:48:03.713 READ DMA EXT
27 00 00 00 00 00 e0 00 14d+08:48:03.708 READ NATIVE MAX ADDRESS EXT [OBS-ACS-3]
ec 00 00 00 00 00 a0 00 14d+08:48:03.707 IDENTIFY DEVICE
ef 03 46 00 00 00 a0 00 14d+08:48:03.707 SET FEATURES [Set transfer mode]
27 00 00 00 00 00 e0 00 14d+08:48:03.706 READ NATIVE MAX ADDRESS EXT [OBS-ACS-3]

Error 58 occurred at disk power-on lifetime: 17109 hours (712 days + 21 hours)
When the command that caused the error occurred, the device was active or idle.

After command completion occurred, registers were:
ER ST SC SN CL CH DH
-- -- -- -- -- -- --
40 51 00 ff ff ff 0f Error: UNC at LBA = 0x0fffffff = 268435455

Commands leading to the command that caused the error were:
CR FR SC SN CL CH DH DC Powered_Up_Time Command/Feature_Name
-- -- -- -- -- -- -- -- ---------------- --------------------
25 00 00 ff ff ff ef 00 14d+08:48:00.574 READ DMA EXT
27 00 00 00 00 00 e0 00 14d+08:48:00.569 READ NATIVE MAX ADDRESS EXT [OBS-ACS-3]
ec 00 00 00 00 00 a0 00 14d+08:48:00.568 IDENTIFY DEVICE
ef 03 46 00 00 00 a0 00 14d+08:48:00.568 SET FEATURES [Set transfer mode]
27 00 00 00 00 00 e0 00 14d+08:48:00.568 READ NATIVE MAX ADDRESS EXT [OBS-ACS-3]

Error 57 occurred at disk power-on lifetime: 17109 hours (712 days + 21 hours)
When the command that caused the error occurred, the device was active or idle.

After command completion occurred, registers were:
ER ST SC SN CL CH DH
-- -- -- -- -- -- --
40 51 00 ff ff ff 0f Error: UNC at LBA = 0x0fffffff = 268435455

Commands leading to the command that caused the error were:
CR FR SC SN CL CH DH DC Powered_Up_Time Command/Feature_Name
-- -- -- -- -- -- -- -- ---------------- --------------------
25 00 00 ff ff ff ef 00 14d+08:47:57.435 READ DMA EXT
27 00 00 00 00 00 e0 00 14d+08:47:57.430 READ NATIVE MAX ADDRESS EXT [OBS-ACS-3]
ec 00 00 00 00 00 a0 00 14d+08:47:57.429 IDENTIFY DEVICE
ef 03 46 00 00 00 a0 00 14d+08:47:57.429 SET FEATURES [Set transfer mode]
27 00 00 00 00 00 e0 00 14d+08:47:57.429 READ NATIVE MAX ADDRESS EXT [OBS-ACS-3]

Error 56 occurred at disk power-on lifetime: 17109 hours (712 days + 21 hours)
When the command that caused the error occurred, the device was active or idle.

After command completion occurred, registers were:
ER ST SC SN CL CH DH
-- -- -- -- -- -- --
40 51 00 ff ff ff 0f Error: UNC at LBA = 0x0fffffff = 268435455

Commands leading to the command that caused the error were:
CR FR SC SN CL CH DH DC Powered_Up_Time Command/Feature_Name
-- -- -- -- -- -- -- -- ---------------- --------------------
25 00 00 ff ff ff ef 00 14d+08:47:54.292 READ DMA EXT
27 00 00 00 00 00 e0 00 14d+08:47:54.287 READ NATIVE MAX ADDRESS EXT [OBS-ACS-3]
ec 00 00 00 00 00 a0 00 14d+08:47:54.286 IDENTIFY DEVICE
ef 03 46 00 00 00 a0 00 14d+08:47:54.286 SET FEATURES [Set transfer mode]
27 00 00 00 00 00 e0 00 14d+08:47:54.286 READ NATIVE MAX ADDRESS EXT [OBS-ACS-3]

SMART Self-test log structure revision number 1
Num Test_Description Status Remaining LifeTime(hours) LBA_of_first_error
# 1 Short offline Completed without error 00% 17507 -

SMART Selective self-test log data structure revision number 1
SPAN MIN_LBA MAX_LBA CURRENT_TEST_STATUS
1 0 0 Not_testing
2 0 0 Not_testing
3 0 0 Not_testing
4 0 0 Not_testing
5 0 0 Not_testing
Selective self-test flags (0x0):
After scanning selected spans, do NOT read-scan remainder of disk.
If Selective self-test is pending on power-up, resume after 0 minute delay.


Test disku se spustí příkazem smartctl -t long /dev/sda

Komentáře

Vaše reakce na Linux - jak zjistit stav disku ze SMART přes terminál

Reference

Podívejte se na naše reference

Prohlédnout

Aplikace

Podívejte se na naše aplikace

Prohlédnout

Co umíme?

Podívejte se co umíme

Prohlédnout

Co umíme?

Vytváříme sofistikované aplikace pro náročné

Od webových aplikací přes android až po převodové můstky či složité informační systémy.

Podívejte se k nám

Máte ještě čas? Podívejte se na další rubriky

Tento web používá soubory cookie. Dalším procházením tohoto webu vyjadřujete souhlas s jejich používáním.. Více informací zde.