Есть два разных HDD диска Toshiba и WD, оба подключены через (как оказалось позже) одинаковые USB контроллеры:
174c:55aa ASMedia Technology Inc. ASM1051E SATA 6Gb/s bridge, ASM1053E SATA 6Gb/s bridge, ASM1153 SATA 3Gb/s bridge, ASM1153E SATA 6Gb/s bridge
Проблема в том, что примерно каждые 4 секунды оба диска «кликают», т.е. чтото заставляет головки прыгнуть и вернуться, но вот что именно заставляет, непонятно, может есть у кого опыт более плотного ковыряния сего контроллера, потому как со стороны ОС и «Видимой» прошивки дисков ничего подозрительного аля APM/Spindown… нет
История с этими «клацаниями» в целом более интересная, чем кажется и началась полтора года назад
Приобрёл я себе значит чудо инженерной мысли от компании Тошиба, объёмом 6Тб под всякий хлам, спустя год службы верой и правдой, чудо начало сбоить, данные были в спешки скопированны, а сам диск отправился до лучших времен в ящик стола. Однажды наткнувшись на него решил помучать ещё чутка, в процессе мучений, познакомился поближе со SMART, G-Table, P-Table, LBA ремап и тд, и решил что если уж упарываться то по полной, значит чтобы подопытный максимально страдал, надо ремап то убрать и тут началась цепочка очень интересных событий, во первых так просто сбросить её нельзя*, SMART он типа Read Only, да и таблица ремапа не в SMART’е, заморачиваться с TTL переходником не хотелось и поэтому просто искал что есть интересного по ATA командам, и тут внезапно наткнулся на DRevitalize, в описание которого явно указывалось что он умеет сбрасывать G-Table и SMART прям так, через Vendor Specific Commands, знатно помучавшись в поисках крякнутой версии, убедился что реально умеет, самое интересное, что винт после сброса, внезапно перестал видеть беды и работает как часы.
Теперь добавим простыню ошибок из SMART до сброса и после (не буду, потому как просто нулёвый смарт, ничего интересного там нет)
[root@bastet ~]# smartctl -a /dev/sda
smartctl 7.2 2020-12-30 r5155 [x86_64-linux-5.13.16-200.fc34.x86_64] (local build)
Copyright (C) 2002-20, Bruce Allen, Christian Franke, www.smartmontools.org
=== START OF INFORMATION SECTION ===
Model Family: Toshiba X300
Device Model: TOSHIBA HDWE160
Serial Number: 10OSK1DIFBPG
LU WWN Device Id: 5 000039 9cc481a65
Firmware Version: FS2A
User Capacity: 6,001,175,126,016 bytes [6.00 TB]
Sector Sizes: 512 bytes logical, 4096 bytes physical
Rotation Rate: 7200 rpm
Form Factor: 3.5 inches
Device is: In smartctl database [for details use: -P show]
ATA Version is: ATA8-ACS (minor revision not indicated)
SATA Version is: SATA 3.0, 6.0 Gb/s (current: 6.0 Gb/s)
Local Time is: Mon Sep 20 23:00:48 2021 CEST
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
General SMART Values:
Offline data collection status: (0x84) Offline data collection activity
was suspended by an interrupting command from host.
Auto Offline Data Collection: Enabled.
Self-test execution status: ( 41) The self-test routine was interrupted
by the host with a hard or soft reset.
Total time to complete Offline
data collection: ( 120) seconds.
Offline data collection
capabilities: (0x5b) SMART execute Offline immediate.
Auto Offline data collection on/off support.
Suspend Offline collection upon new
command.
Offline surface scan supported.
Self-test supported.
No 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: ( 2) minutes.
Extended self-test routine
recommended polling time: ( 632) minutes.
SCT capabilities: (0x003d) SCT Status supported.
SCT Error Recovery Control supported.
SCT Feature Control supported.
SCT Data Table supported.
SMART Attributes Data Structure revision number: 16
Vendor Specific SMART Attributes with Thresholds:
ID# ATTRIBUTE_NAME FLAG VALUE WORST THRESH TYPE UPDATED WHEN_FAILED RAW_VALUE
1 Raw_Read_Error_Rate 0x000b 100 091 050 Pre-fail Always - 0
2 Throughput_Performance 0x0005 100 100 050 Pre-fail Offline - 0
3 Spin_Up_Time 0x0027 100 100 001 Pre-fail Always - 589
4 Start_Stop_Count 0x0032 100 100 000 Old_age Always - 846
5 Reallocated_Sector_Ct 0x0033 100 100 050 Pre-fail Always - 47184
7 Seek_Error_Rate 0x000b 100 100 050 Pre-fail Always - 0
8 Seek_Time_Performance 0x0005 100 100 050 Pre-fail Offline - 0
9 Power_On_Hours 0x0032 081 081 000 Old_age Always - 7809
10 Spin_Retry_Count 0x0033 116 100 030 Pre-fail Always - 0
12 Power_Cycle_Count 0x0032 100 100 000 Old_age Always - 238
191 G-Sense_Error_Rate 0x0032 100 100 000 Old_age Always - 10
192 Power-Off_Retract_Count 0x0032 100 100 000 Old_age Always - 229
193 Load_Cycle_Count 0x0032 100 100 000 Old_age Always - 859
194 Temperature_Celsius 0x0022 100 100 000 Old_age Always - 48 (Min/Max 9/55)
196 Reallocated_Event_Count 0x0032 100 100 000 Old_age Always - 3077
197 Current_Pending_Sector 0x0032 100 100 000 Old_age Always - 0
198 Offline_Uncorrectable 0x0030 100 100 000 Old_age Offline - 21
199 UDMA_CRC_Error_Count 0x0032 200 253 000 Old_age Always - 0
220 Disk_Shift 0x0002 100 100 000 Old_age Always - 0
222 Loaded_Hours 0x0032 088 088 000 Old_age Always - 5000
223 Load_Retry_Count 0x0032 100 100 000 Old_age Always - 0
224 Load_Friction 0x0022 100 100 000 Old_age Always - 0
226 Load-in_Time 0x0026 100 100 000 Old_age Always - 548
240 Head_Flying_Hours 0x0001 100 100 001 Pre-fail Offline - 0
SMART Error Log Version: 1
ATA Error Count: 24245 (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 24245 occurred at disk power-on lifetime: 7801 hours (325 days + 1 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 41 08 d0 65 43 40 Error: UNC at LBA = 0x004365d0 = 4416976
Commands leading to the command that caused the error were:
CR FR SC SN CL CH DH DC Powered_Up_Time Command/Feature_Name
-- -- -- -- -- -- -- -- ---------------- --------------------
60 00 08 00 64 43 40 00 02:07:12.781 READ FPDMA QUEUED
60 00 00 00 60 43 40 00 02:07:12.780 READ FPDMA QUEUED
60 00 08 00 5c 43 40 00 02:07:12.766 READ FPDMA QUEUED
60 00 00 00 58 43 40 00 02:07:11.631 READ FPDMA QUEUED
60 00 08 00 54 43 40 00 02:07:11.628 READ FPDMA QUEUED
Error 24244 occurred at disk power-on lifetime: 7801 hours (325 days + 1 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 41 00 58 5a 79 40 Error: UNC at LBA = 0x00795a58 = 7952984
Commands leading to the command that caused the error were:
CR FR SC SN CL CH DH DC Powered_Up_Time Command/Feature_Name
-- -- -- -- -- -- -- -- ---------------- --------------------
60 00 08 00 5c 79 40 00 02:06:19.030 READ FPDMA QUEUED
60 00 00 00 58 79 40 00 02:06:19.030 READ FPDMA QUEUED
60 00 08 00 54 79 40 00 02:06:19.027 READ FPDMA QUEUED
60 00 00 00 50 79 40 00 02:06:19.026 READ FPDMA QUEUED
60 00 08 00 4c 79 40 00 02:06:17.973 READ FPDMA QUEUED
Error 24243 occurred at disk power-on lifetime: 7799 hours (324 days + 23 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 41 00 38 fa 14 40 Error: UNC at LBA = 0x0014fa38 = 1374776
Commands leading to the command that caused the error were:
CR FR SC SN CL CH DH DC Powered_Up_Time Command/Feature_Name
-- -- -- -- -- -- -- -- ---------------- --------------------
60 08 00 38 fa 14 40 00 1d+00:19:09.248 READ FPDMA QUEUED
60 08 00 30 fa 14 40 00 1d+00:19:09.239 READ FPDMA QUEUED
60 08 00 28 fa 14 40 00 1d+00:19:09.059 READ FPDMA QUEUED
60 08 00 20 fa 14 40 00 1d+00:19:08.090 READ FPDMA QUEUED
60 08 00 18 fa 14 40 00 1d+00:19:08.089 READ FPDMA QUEUED
Error 24242 occurred at disk power-on lifetime: 7799 hours (324 days + 23 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 41 00 20 fa 14 40 Error: UNC at LBA = 0x0014fa20 = 1374752
Commands leading to the command that caused the error were:
CR FR SC SN CL CH DH DC Powered_Up_Time Command/Feature_Name
-- -- -- -- -- -- -- -- ---------------- --------------------
60 00 00 00 fa 14 40 00 1d+00:19:03.906 READ FPDMA QUEUED
60 00 00 00 f8 14 40 00 1d+00:19:03.838 READ FPDMA QUEUED
60 00 00 00 f6 14 40 00 1d+00:19:03.837 READ FPDMA QUEUED
60 00 00 00 f4 14 40 00 1d+00:19:03.835 READ FPDMA QUEUED
60 00 00 00 f2 14 40 00 1d+00:19:03.834 READ FPDMA QUEUED
Error 24241 occurred at disk power-on lifetime: 7799 hours (324 days + 23 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 08 d8 eb 14 41 Error: UNC 8 sectors at LBA = 0x0114ebd8 = 18148312
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 03 08 d8 eb 14 40 00 1d+00:18:55.213 READ DMA EXT
ef 03 45 d0 eb 14 00 00 1d+00:18:55.213 SET FEATURES [Set transfer mode]
ef 03 0c d0 eb 14 00 00 1d+00:18:55.213 SET FEATURES [Set transfer mode]
ec 08 00 d0 eb 14 00 00 1d+00:18:55.213 IDENTIFY DEVICE
ff ff ff ff ff ff ff 0c 1d+00:18:55.212 [VENDOR SPECIFIC]
SMART Self-test log structure revision number 1
Num Test_Description Status Remaining LifeTime(hours) LBA_of_first_error
# 1 Extended offline Interrupted (host reset) 90% 7802 -
# 2 Extended offline Interrupted (host reset) 10% 7799 -
# 3 Extended offline Interrupted (host reset) 90% 7789 -
# 4 Extended offline Aborted by host 80% 7766 -
# 5 Extended offline Aborted by host 90% 7763 -
# 6 Extended offline Aborted by host 90% 7647 -
# 7 Extended offline Aborted by host 80% 7646 -
# 8 Extended offline Interrupted (host reset) 70% 7630 -
# 9 Extended offline Interrupted (host reset) 90% 7547 -
#10 Extended offline Completed: read failure 00% 7516 1200008880
#11 Extended offline Completed: read failure 00% 7478 1199947040
#12 Extended offline Interrupted (host reset) 90% 7462 -
#13 Short offline Completed without error 00% 4628 -
#14 Short offline Aborted by host 90% 4615 -
#15 Short offline Aborted by host 60% 3298 -
#16 Short offline Aborted by host 60% 3121 -
#17 Short offline Completed without error 00% 3119 -
#18 Short offline Aborted by host 30% 3119 -
#19 Short offline Completed without error 00% 297 -
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.
После 3х дней непрерывных мучений диска badblocks
и пост сканирования рандомным доступом, диск функционирует идеально
Едем дальше, решим таки выяснить причину «клацаний» продолжил ковырять, версию с APM откинул сразу, поставив blktrace
нашел что как примерно раз в 5 секунд udisks2
читает smart, убрал, не помогло, слой за слоем убираю всё что можно со стороны ОС, наткнулся на интересную статью:
тут 1, тут 2 и тд, т.е. конкретные модели жёстких дисков могут не коректно работать с конкретными ASMedia мостами, по итогу решения так и не нашел, если кто поделиться буду оч благодарен
Итог: как оказалось это не баг, это фича новых HDD, называется оно Pre-emptive Wear Leveling (PWL)
, вот описание из документации
This Western Digital feature provides a solution for protecting the recording media against mechanical wear. In cases where the drive is so busy with incoming commands that it is forced to stay in a same cylinder position for a long time, the PWL control engine initiates forced seeks so that disk lubricant maintains an even distribution and does not become depleted. This feature ensures reliability for applications that perform a high incidence of read/write operations at the same physical location on the disk.
По итогу новые диски без нагрузки, просто «кликают» каждые 5 секунд и это должно продлить их срок жизни
Ещё одна цитата с сайта поддержки:
Normal drive sounds include:
- Whirring noise during drive spin-up when the computer is starting up, waking from sleep, or the drive is transitioning from idle to full speed to resume normal operation
- Occasional drive clicks occurring at 4 or 5 second intervals, and the drive is functioning normally and passes diagnostics
- Hard clicks during a head park operation during shutdown or entering sleep mode
Вот таки дела