Extremely long time for an ext4 fsck

11,612

SMART doesn't remap sectors, it just detects and logs errors. Bad sectors are remapped automatically when written to. You can do this with dd or hdparm --write-sector.

If your drive cannot remap the sector because it has run out of reserve sectors then you should be one step before panic.

Remapping them in the file system does not make much sense.

If hdparm -t /dev/sdb gives you reasonable results then you may run badblocks on its own (with -s) in order to check whether its faster if run directly and run it through strace if it is not faster in order to get an impression where the performance problem results from.

Maybe there are certain areas on the disk which cause a lot of read retries.

Share:
11,612

Related videos on Youtube

fuzzyhair2
Author by

fuzzyhair2

Goodbye, Stack Exchange!

Updated on September 18, 2022

Comments

  • fuzzyhair2
    fuzzyhair2 over 1 year

    The problem that I am having is the extremely long time that fsck is taking. I have thoroughly made searches on Google, but I could not find anything that would resolve the problem.

    The command that I am running is sudo fsck.ext4 -vc /dev/sdb1.

    I have a 200GB SATA hard drive which has some bad sectors. It is SMART-compatible, however, SMART somehow is not capable of remapping the sectors. The command that I am running is going to check for bad sectors and add them to the bad block list. However, here is the output so far:

    e2fsck 1.42 (29-Nov-2011)
    Checking for bad blocks (read-only test): 1.95% done, 11:53:24 elapsed. (1657/0/0 errors)

    At this rate it will probably take around 1 month.

    Now don't tell me "Your hard drive is too old and it's gonna fail soon blah blah blah". I just want to add the bad blocks to the badblocks list. The hard drive is not developing any new bad sectors.

    My machine has an i3 quad-core with 8GB of RAM. My CPU usage is under 10%, and about 1.5GB of the RAM is used. Nothing is paged.

    The disk which I am checking has a newly created ext4 filesystem with nothing on it.

    I just don't understand why it will take 1 month to fsck a disk and list bad blocks. Something is definitely wrong here. Any advice?

    • fuzzyhair2
      fuzzyhair2 almost 11 years
      What do you mean by this? The HDD is currently unmounted at /dev/sdb
    • slm
      slm almost 11 years
      If you go into your BIOS you need to confirm the setup of the SATA port which the HDD is connected to. Most likely isn't setup correctly.
    • fuzzyhair2
      fuzzyhair2 almost 11 years
      Ok, I will go check. BTW how does the data setup affect speed?
    • slm
      slm almost 11 years
      This isn't data setup per say. It's like trying to drive your car in 2nd gear on the high way at 55 miles per hour and not understanding why it can't. The SATA ports can be configured in a couple of different modes, check to make sure it's in AHCI mode.
    • fuzzyhair2
      fuzzyhair2 almost 11 years
      There is no option to configure it in BIOS but I'm assuming that it is already in AHCI mode because it is sd* instead of hd*, right? EDIT: It is in AHCI mode.
    • slm
      slm almost 11 years
      I don't think that assumption is correct. Can you provide what motherboard make/model you have and also maybe a screenshot of the BIOS that would be helpful.
    • slm
      slm almost 11 years
      Also give this a try: hdparm -Tt /dev/sdb. See what the performance of the drive shows up with that. I'm still suspicious of whether the drives in the correct mode. Unless the drive is failing this is usually like 90% of the time why SATA drives are reported as being slow.
    • fuzzyhair2
      fuzzyhair2 almost 11 years
      The BIOS had no setting for AHCI mode. It is a Dell Inspiron 620, BIOS rev. A04. Unforunately the guys at Dell decided to oversimplify everything so I don't know the motherboard model, nor can I set the AHCI mode.
    • fuzzyhair2
      fuzzyhair2 almost 11 years
      What other issues besides AHCI could there be? Even if it was on IDE mode it still shouldn't take 30 days for a fsck.
  • fuzzyhair2
    fuzzyhair2 almost 11 years
    Thanks for the answer. dd gives an I/O error at specific sectors. I want to add those sectors to the do-not-use list. SMART does indicate multiple read errors though.
  • fuzzyhair2
    fuzzyhair2 almost 11 years
    Multiple retries seems to be the issue. I keep getting read DMA failed
  • Hauke Laging
    Hauke Laging almost 11 years
    Does dd give these errors when reading or when writing? If you get errors from sectors near each other then you may save time by simply creating a list of consecutive sectors for e2fsck.
  • slm
    slm almost 11 years
    If you have another SATA cable you might want to try swaping that out as well.
  • fuzzyhair2
    fuzzyhair2 almost 11 years
    Errors while both. I created a new partition skipping the first 30 GB and there were no more errors. Ended up with a smaller usable HDD but hey, at least it works! Thanks guys.