Linux hard drive failure case sharing

Source: Internet
Author: User

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:

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.