Page 1 of 2 12 LastLast
Results 1 to 10 of 12

Thread: Presumed bad sectors; need to make drive usable

  1. #1
    Join Date
    May 2008
    Location
    United Kingdom
    Beans
    5,263
    Distro
    Ubuntu

    Question Presumed bad sectors; need to make drive usable

    I have an external USB Seagate 1Tb hard drive with five partitions. One of the partitions holds Ubuntu.

    Recently, I had a problem with the Ubuntu partition, so I deleted the partition, recreated it, reformatted it and reinstalled Ubuntu. But today, I cannot mount that partition, and even fsck on that partition hangs; I had to kill fsck.

    I suspect that the partition has bad sectors that the SMART utility is not picking up.

    How can I check the partition for bad sectors in such a way that they are marked unusable (so that the rest of the partition can be used)? Or, have I misdiagnosed and should I do something else?

    There is no important data on that partition that I need, so I am happy to delete the partition if required. I also have a full backup of data on the rest of the drive, so if I have to reformat the entire drive, that too is OK.

    TIA
    Always make regular backups of your data (and test them).
    Visit Full Circle Magazine for beginners and seasoned Linux enthusiasts.

  2. #2
    Join Date
    Mar 2007
    Location
    Portsmouth, UK
    Beans
    Hidden!
    Distro
    Ubuntu 11.10 Oneiric Ocelot

    Re: Presumed bad sectors; need to make drive usable

    To be honest I thought that all modern drives automatically locked out bad sectors, and continued to do so once their backup supply was exhausted. The only time I've had ongoing issues, are when new bad sectors are created (bad sectors are rarely a one-off, and just get worse) - in such cases I've always ditched the drive.

  3. #3
    Join Date
    May 2008
    Location
    United Kingdom
    Beans
    5,263
    Distro
    Ubuntu

    Re: Presumed bad sectors; need to make drive usable

    Quote Originally Posted by Grenage View Post
    … I thought that all modern drives automatically locked out bad sectors…
    Yes, I though so too. However, I am no expert when it comes to hardware, so I was hoping that there was something to fix this.
    Always make regular backups of your data (and test them).
    Visit Full Circle Magazine for beginners and seasoned Linux enthusiasts.

  4. #4
    Join Date
    Mar 2007
    Location
    Portsmouth, UK
    Beans
    Hidden!
    Distro
    Ubuntu 11.10 Oneiric Ocelot

    Re: Presumed bad sectors; need to make drive usable

    I believe that a full format would flag and block bad sectors, but it obviously wont be able to tell you about any that occur after the fact. fsck should be able to, with regular scans.

  5. #5
    Join Date
    May 2008
    Location
    United Kingdom
    Beans
    5,263
    Distro
    Ubuntu

    Re: Presumed bad sectors; need to make drive usable

    Quote Originally Posted by Grenage View Post
    I believe that a full format would flag and block bad sectors, but it obviously wont be able to tell you about any that occur after the fact. fsck should be able to, with regular scans.
    I have just deleted and recreated the partition, and formatted. The format takes mere seconds, so it cannot be scanning the disk.

    Likewise, fsck seems to check only the allocation of files rather than the files themselves. It took mere seconds on the reformatted (empty) partition.

    You mention a "full format". Is that something that writes to every sector on the partition? If so, how do I do it?

    Alternatively, perhaps I need to use some program that just writes a random string to every sector. That may alert SMART to some problem and prompt it to fix it.

    I have seen the following warnings on the SMART report:

    • 8,160 reallocated sectors
    • 197 current pending sectors
    Always make regular backups of your data (and test them).
    Visit Full Circle Magazine for beginners and seasoned Linux enthusiasts.

  6. #6
    Join Date
    Mar 2007
    Location
    Portsmouth, UK
    Beans
    Hidden!
    Distro
    Ubuntu 11.10 Oneiric Ocelot

    Re: Presumed bad sectors; need to make drive usable

    That's right; most formats done are usually 'quick' formats. You know them when you do them - because they take bloody ages.

    mkfs.ext4 has a flag for checking bad blocks during the format:

    -c Check the device for bad blocks before creating the file system. If this option is specified twice, then a slower read-write test is used instead of a fast read-only test.
    So, -c is what you want!

  7. #7
    Join Date
    May 2008
    Location
    United Kingdom
    Beans
    5,263
    Distro
    Ubuntu

    Re: Presumed bad sectors; need to make drive usable

    I think that I have discovered what to do.

    fsck.ext4 has two options: -c, which if doubled performs a non-destructive read-write test, and -k, which does not destroy old information about bad sectors. (It uses the badblocks application.)

    I have been running the following command for 35 minutes (it is only 35% complete), but it has found four bad sectors.

    Code:
    sudo fsck -CMfcck /dev/sdb8
    Well, I presume it is four bad sectors, because the display shows "(4/0/0 errors)". I do not know quite what that means, but the scan did at one stage appear to hang before it showed the first error.

    (Do you know where to find a description of the output? It's not in the badblocks manual.)

    I think that I can mark this as solved, now.

    EDIT: Sorry, I missed your last post!
    Last edited by Paddy Landau; December 14th, 2012 at 03:22 PM.
    Always make regular backups of your data (and test them).
    Visit Full Circle Magazine for beginners and seasoned Linux enthusiasts.

  8. #8
    Join Date
    Mar 2007
    Location
    Portsmouth, UK
    Beans
    Hidden!
    Distro
    Ubuntu 11.10 Oneiric Ocelot

    Re: Presumed bad sectors; need to make drive usable

    Alas, I do not, but I'm willing to bet that the verbose (-v) flag will give you what you want.

  9. #9
    Join Date
    May 2006
    Location
    Milwaukee,WI
    Beans
    6,280
    Distro
    Xubuntu 14.04 Trusty Tahr

    Re: Presumed bad sectors; need to make drive usable

    i'd just get rid of the drive, playing with fire trying to use a dieing drive

  10. #10
    Join Date
    May 2008
    Location
    United Kingdom
    Beans
    5,263
    Distro
    Ubuntu

    Re: Presumed bad sectors; need to make drive usable

    Quote Originally Posted by dannyboy79 View Post
    i'd just get rid of the drive, playing with fire trying to use a dieing drive
    Well, it seems to be with isolated areas, and fortunately it is only a backup drive. I take your point, but if it does fail, I can order a new one quickly. As I don't have plenty of money, I'd like to wait until it actually does die!

    The scan is still running (it's slow, which I expected). I'll let you know the results once it has finished.

    Thank you Grenage and dannyboy79 for your help.
    Always make regular backups of your data (and test them).
    Visit Full Circle Magazine for beginners and seasoned Linux enthusiasts.

Page 1 of 2 12 LastLast

Tags for this Thread

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
  •