How to Fix Bad Sectors in Linux

Written by mark pool
  • Share
  • Tweet
  • Share
  • Pin
  • Email
How to Fix Bad Sectors in Linux
(Stockbyte/Stockbyte/Getty Images)

Bad sectors are a physical problem on the hard drive. Every operating system has it's own specific tools you can use to fix bad sectors. The best way to repair the hard drive is to boot another system and scan the hard drive while it's not in use. You can also boot the system in single user mode and run a scan if no other system is available. The "e2fsck" program is ideal to check the file system and use the "badblocks" program to check the hard drive. Don't run the "badblocks" program directly unless you know the exact block size.

Skill level:
Moderately Easy

Other People Are Reading

Instructions

  1. 1

    Download and burn Ubuntu to a DVD. If you have another Linux system or Live CD that can access the hard drive, you may skip this step.

  2. 2

    Restart the computer and boot from the DVD or alternate system.

  3. 3

    Open a terminal window.

  4. 4

    Type "fdisk -l" (without the quotation marks) to see the hard drive and partition device names. This displays the hard drives and partitions on your system. Make a note of the hard drive or partition you want to scan for the "e2fsck" command. Please note the parameter after the command is a lower-case "L."

  5. 5

    Type the following command: sudo e2fsck -cfpv /dev/sdb2. Replace "sdb2" with your actual device name, this can be an entire drive, such as "sda" or a partition, such as "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.

    The "e2fsck" command can take a long time to run, even several hours on a particularly large drive.

  6. 6

    Exit the terminal after the "e2fsck" command is finished.

  7. 7

    Remove the DVD/CD if any and reboot the system. Your file system is up to date with any bad sectors and will avoid them; any repairable issues have been fixed.

Don't Miss

Filter:
  • All types
  • Articles
  • Slideshows
  • Videos
Sort:
  • Most relevant
  • Most popular
  • Most recent

No articles available

No slideshows available

No videos available

By using the eHow.co.uk site, you consent to the use of cookies. For more information, please see our Cookie policy.