Use the Badblocks command to detect and repair hard drive bad lanes

Source: Internet
Author: User

Today, my new hard drive is here. I don't know how to use it for the time being. It can be loaded into the CD-ROM drive rack for G430, or it can be used as a removable hard drive.

Recall the previous record of a badblocks usage, used to check the bad road, here and then put the spare.

##################################################################

Badblocks is a common bad-word repair tool used under Linux. You can use Badblocks to check if you think there may be a bad path on your hard drive, or if the smart data shows a bad path.

Suppose we want to check the hard drive is/dev/sdb

$sudo badblocks -s -v -o sdbbadblocks.log /dev/sdb

This allows a read-only scan of the hard drive, automatically acquires the number of hard disk blocks and scans all blocks, outputting the scan log to the screen and recording it in the Sdbbadblocks.log file.

Because the scanning speed is relatively low, not necessarily can sweep, can be divided into several times.

sudo badblocks -s -v -o sdbbadblocks.log /dev/sdb END START

Replace end and start with the number of the end and start blocks.

If a bad path is found, a write scan can be performed to fix it. The write scan will automatically remap when it encounters a bad path. The write scan overwrites the original data, so please back it up first. The Write scan speed is very low, so you should only scan for read-only scans to find the wrong part.

$sudo badblocks -w -s /dev/sdb END START

If you want to know the meaning of each option and more usage, please man badblocks.

Use the Badblocks command to detect and repair hard drive bad lanes

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.