Showing posts with label badblock. Show all posts
Showing posts with label badblock. Show all posts

Wednesday, March 30, 2016

check bad sector on linux


ก่อนอื่นต้องเช็ค Disk drive บนเครื่องก่อน มีอะไรบ้าง สำหรับเครื่องที่ใช้รูปแบบดิสก์เป็น LVM ใช้คำสั่งตรวจเช็คดังนี้ check-disk-lvm-on-centos

แล้วใช้คำสั่งต่อไปนี้ ตรวจสอบฮาร์ดดิสก์

badblocks -v /dev/sda2 > bad-block


หลังจากรันคำสั่งเสร็จ ก็รายงานผลออกมาดังภาพด้านล่าง


badblocks -svn /dev/sdd
to have the hard disk controller replace bad blocks by spare blocks.

fsck /dev/sdd  > fix all drive
fsck /dev/sdd1  > fix special drivebadbl
repair disk

e2fsck -cfpv /dev/sda1
The parameters have the following meanings: “c” searches for bad blocks and adds them to the list, “f” forces a check on the file system, “p” repairs anything that can be safely repaired and “v” is verbose mode so you can see the command progress.

Ref: fix haddisk bad sector