Results 1 to 10 of 22

Thread: Bad sector on laptop

Hybrid View

  1. #1
    psusi is offline Ubuntu addict and loving it
    Join Date
    Sep 2005
    Location
    Orlando, FL
    Beans
    3,980
    Distro
    Ubuntu Development Release

    Re: Bad sector on laptop

    dd is a swiss army knife command line tool that you can use to move data from anywhere to anywhere. If you run the long smart test the results should give you the exact sector that has the problem. You can try to have dd read that sector with:

    Code:
    sudo dd if=/dev/sda of=/dev/null bs=512 count=1 skip=sector
    Assuming the drive in question is sda of course, and sector is the number of the bad sector. This should fail with an IO error. If it does, then you know you have the right place. To write that sector full of zeroes, you do:

    Code:
    sudo dd if=/dev/zero of=/dev/sda bs=512 count=1 seek=sector
    Make sure you type it exactly. Getting it wrong can have very bad results. Notice the skip becomes seek in the second version. Do not forget the count=1 option or it will keep keep going until the end of the disk.

    If it is successful you should be able to read the sector again and have it not fail this time. You should then see the smart numbers change. The pending sector count should go down by one, and depending on whether the drive had to remap because the sector was physically bad or not, the reallocated sector count should go up by one.
    Last edited by psusi; March 17th, 2010 at 02:55 PM.

  2. #2
    Join Date
    Feb 2010
    Location
    dundee scotland
    Beans
    31
    Distro
    Ubuntu Studio 9.10 Karmic Koala

    Re: Bad sector on laptop

    Quote Originally Posted by psusi View Post
    dd is a swiss army knife command line tool that you can use to move data from anywhere to anywhere. If you run the long smart test the results should give you the exact sector that has the problem. You can try to have dd read that sector with:

    Code:
    sudo dd if=/dev/sda of=/dev/null bs=512 count=1 skip=sector
    Assuming the drive in question is sda of course, and sector is the number of the bad sector. This should fail with an IO error. If it does, then you know you have the right place. To write that sector full of zeroes, you do:

    Code:
    sudo dd if=/dev/zero of=/dev/sda bs=512 count=1 seek=sector
    Make sure you type it exactly. Getting it wrong can have very bad results. Notice the skip becomes seek in the second version. Do not forget the count=1 option or it will keep keep going until the end of the disk.

    If it is successful you should be able to read the sector again and have it not fail this time. You should then see the smart numbers change. The pending sector count should go down by one, and depending on whether the drive had to remap because the sector was physically bad or not, the reallocated sector count should go up by one.

    thank you , psusi now i know what you mean , ive noted all that down , and will give it a try later on today when i get home from work . and get peace to do it frommy lovable but menacing 2 year old son

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •