Linux hard drive failure case sharing
This article mainly shares the specific logs and corresponding repair methods in/var/log/messages and/var/log/mcelog after the hard disk fault occurs on the Linux server, as the number of cases increases and the number of cases increases, I will finally generate an automated script.
Of course, there will be many hard disks with physical bad channels and need to be replaced. This requires replacement by the hard disk vendor, which is not covered in this article.
Server Model:
HP SE1170s
Hard Disk Model:
MB2000EAZNL
Fault 1:
Jul 17 00:46:34 xxxxxxxxxxxxxx kernel: [8384801.159283] EXT4-fs (sdl1): warning: mounting fs with errors, running e2fsck is recommended
Jul 17 00:50:00 xxxxxxxxxxxxxx kernel: [8385006.016500] sd 6: 0: 6: 0: [sdl] Sense Key: Medium Error [current]
Jul 17 00:50:00 xxxxxxxxxxxxxx kernel: [8385006.016508] sd 6: 0: 6: 0: [sdl] Add. Sense: Unrecovered read error
Jul 17 00:50:00 xxxxxxxxxxxxxx kernel: [8385006.016524] Buffer I/O error on device sdl1, logical block 1415594116
Jul 17 00:50:00 xxxxxxxxxxxxxx kernel: [8385006.095561] Buffer I/O error on device sdl1, logical block 1415594117
Troubleshooting:
# E2fsck/dev/sdl1
If the bad block cannot be repaired, use fdisk to format the hard disk:
# Fdisk/dev/sdl
# D
# N
# P
# Enter
# Enter
# W
Format the disk with the ext4 File System:
# Mkfs. ext4/dev/sdl1
Mount the formatted hard disk back:
# Mount-L/Hadoop07/hadoop/7-t ext4-o defaults, noatime, nodiratime, noauto
If the latest/dev/sdl error log is found in/var/log/messages a few days later, the hard disk needs to be replaced, in this case, you can disable the read/write function of the directory on this disk. Before that, you can copy the data in it:
# Chmod 0/hadoop07
This article permanently updates the link address: