"Disk is OK, 113 bad sectors"

16,448

With bad sectors, you should always immediately backup all important information and get a new hard drive. You can theoretically mark these sectors as "bad" and tell the computer not to use them. However, this is not at all recommended as bad sectors like spreading like a fungus.

If you want to try this, instructions are below.

  1. Find your hard drive with lsblk. Find the EXT partition mounted at /.
  2. Remember the code. It should look something like /dev/sda1.
  3. Strip the number off the code you got earlier. If you had /dev/sda1, your code is now /dev/sda.
  4. Run this command: sudo badblocks /dev/sdc > /home/$USER/bad-blocks
  5. Run this command: sudo fsck -l bad-blocks /dev/sdc
  6. While running the above commands, go take a walk. Do not touch your computer.

Disclaimer: I am not responsible for any loss of data or system damage that has resulted from the above commands, both instant and in the future. I hold no responsibility for what you type into your terminal. You have been warned.

Share:
16,448

Related videos on Youtube

durango
Author by

durango

Updated on September 18, 2022

Comments

  • durango
    durango over 1 year

    So, lately I've been having issues booting up Ubuntu and having to go into grub and do a recovery boot and I'll have issues saying "i/o errors in dev/sda" or something along those lines and I noticed I have 113 have bad sectors in my HDD when I just recently started the Disks setting. Isn't there a way to block out those bad sectors or something? What should I do? Thank you!

    • ubfan1
      ubfan1 over 9 years
      Make a backup and ensure you can restore from it. Then you can start playing games with the disk.
    • durango
      durango over 9 years
      As funny as that is, I just bought this hard drive like 3 months ago and I just recently built this computer. So, it's sort of a bumber.
    • Kaz Wolfe
      Kaz Wolfe over 9 years
      I understand that. Same thing has happened to me before. It's not fun.
  • durango
    durango over 9 years
    This is exactly what I wanted to hear. Thank you very much! I have a backup already,so I should be good. Thank you!
  • Kaz Wolfe
    Kaz Wolfe over 9 years
    @durango If this solved your problem, please hit that green checkmark. It helps the community, you, and me. Everyone wins!
  • psusi
    psusi over 9 years
    You should not be using the bad blocks list on modern hard disks. These days the disk itself internally remaps bad sectors to a pool of spare good sectors.
  • Kaz Wolfe
    Kaz Wolfe over 9 years
    @psusi That forces the process to take place. I recommend not even working with a bad HDD in the first place.
  • psusi
    psusi over 9 years
    What forces what process to take place?
  • Kaz Wolfe
    Kaz Wolfe over 9 years
    @psusi IIRC, this command tells the disk that these sectors are bad and to mark them as unusable.
  • psusi
    psusi over 9 years
    No... badblocks just tries to read each sector and writes a list of which ones failed to stdout. fsck -l creates an invisible "bad blocks" file uses those bad blocks so that no other file will use them.
  • Kaz Wolfe
    Kaz Wolfe over 9 years
    Really? I have no idea where I read that....
  • FriendFX
    FriendFX about 8 years
    Reading the documentation of fsck.ext3, the -c option runs badblocks internally while at the same time avoiding inconsistent block sizes... I'm not expert on this, but it makes me wonder whether that would be the better option?
  • user87317
    user87317 over 5 years
    @KazWolfe do you mean "sda" instead of "sdc"? If it's supposed to be "sdc" then why do we need to note the code?