Bad Sector and MySQL innodb

MySQL

StdErr

Thats shown on screen

1
2
3
4
WARNING: Your hard drive is failing
Device: /dev/sda [SAT], 8 Currently unreadable (pending) sectors
WARNING: Your hard drive is failing
Device: /dev/sda [SAT], 8 Offline uncorrectable sectors

SMART Log

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
# sudo smartctl -a /dev/sda
...
...
SMART Error Log Version: 1
ATA Error Count: 25 (device log contains only the most recent five errors)
...
...
Error 25 occurred at disk power-on lifetime: 6502 hours (270 days + 22 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 08 ff ff ff ef 00 14d+16:54:04.035 READ DMA EXT
27 00 00 00 00 00 e0 00 14d+16:54:04.031 READ NATIVE MAX ADDRESS EXT [OBS-ACS-3]
ec 00 00 00 00 00 a0 00 14d+16:54:03.993 IDENTIFY DEVICE
ef 03 45 00 00 00 a0 00 14d+16:54:03.990 SET FEATURES [Set transfer mode]
27 00 00 00 00 00 e0 00 14d+16:54:03.990 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: read failure 10% 6410 1468496680
...
...

MySQL Log

1
2
3
4
5
6
7
8
9
10
2018-01-08  9:38:25 140666168350528 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2018-01-08 9:38:25 140666168350528 [Note] InnoDB: Completed initialization of buffer pool
2018-01-08 9:38:32 140666168350528 [ERROR] InnoDB: Tried to read 1048576 bytes at offset 2097152. Was only able to read 163840.
2018-01-08 09:38:32 7fef64ff1740 InnoDB: Operating system error number 5 in a file operation.
InnoDB: Error number 5 means 'Input/output error'.
InnoDB: Some operating system error numbers are described at
InnoDB: http://dev.mysql.com/doc/refman/5.6/en/operating-system-error-codes.html
InnoDB: Operation read to file /tmp/mariadb-10.1.14/storage/xtradb/os/os0file.cc and at line 3160
2018-01-08 9:38:32 140666168350528 [ERROR] InnoDB: File (unknown): 'read' returned OS error 205. Cannot continue operation
180108 09:38:32 mysqld_safe mysqld from pid file /usr/local/data/mysql/data/mysqld.pid ended

Conclusion

‘Input/output error’ most likely means harddisk error!
Please backup ASAP!