Announcement

Collapse
No announcement yet.

e2fsck and badblocks on failing (?) hard drive: what to do?

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    e2fsck and badblocks on failing (?) hard drive: what to do?

    I have a hard drive that is starting to fail (see here for details and links: http://linux.overshoot.tv/ticket/64 )

    I have a specific question about e2fsck:

    Code:
    # e2fsck /dev/sdc1
    /dev/sdc1 contains a file system with errors, check forced.
    Pass 1: Checking inodes, blocks, and sizes
    Error reading block 162824194 (Attempt to read block from filesystem resulted in short read) while getting next inode from scan. Ignore error<y>?
    What am I supposed to reply to this question? Ignore error <y>?
    I searched and many people seem to reply yes to all such question (they even use the -y flag to automatically reply yes).

    But what does it do? What are the consequences of replying either way? What is safe? What difference does it make?
    As I said in the above ticket, man e2fsck didn't help much.

    Other people seem to recommend using badblocks(8).
    How are those two tools related? Should I run one then the other?

    Also, be aware that I am documenting everything I find here, as I go along:
    http://linux.overshoot.tv/wiki/hardw...ing_hard_drive
    so that we have a permanent record of the best practice (preparedness, troubleshooting and repair).

    If you know of other tutorials, HOWTOs, documentation and wikis addressing the same issue, let me know. Generally speaking, I do my best to link http://linux.overshoot.tv/ to the best available documentation (no need to reinvent the wheel). For example: http://linux.overshoot.tv/wiki/external_documentation


    #2
    Re: e2fsck and badblocks on failing (?) hard drive: what to do?

    from: man:badblocks(8)
    Code:
    Important note: If the output of badblocks is going to be fed to the e2fsck or mke2fs programs, it is important that the block size is properly specified, since the block numbers which are generated are very dependent on the block size in use by the filesystem. For this reason, [b]it is strongly recommended that users not run badblocks directly, but rather use the -c option of the e2fsck and mke2fs programs[/b].
    If I understand properly, I shouldn't ever need to run badblocks.
    Or should I?
    And I should have run e2fsck -c instead of simply e2fsck ...

    Comment


      #3
      Re: e2fsck and badblocks on failing (?) hard drive: what to do?

      I am not there yet (in my case, the failing disk is a backup disk, so it's not critical), but I thought I'd link to the best, relevant threads:

      HOWTO: Rescue data from hard disk
      http://kubuntuforums.net/forums/index.php?topic=11236.0

      Comment


        #4
        Re: e2fsck and badblocks on failing (?) hard drive: what to do?

        If you're getting those messages, you literally have hours before your drive fails.

        Since it's a backup drive only - try whatever you want to on it, just know it's headed for the trash...

        Please Read Me

        Comment


          #5
          Re: e2fsck and badblocks on failing (?) hard drive: what to do?

          Thanks, oshunluvr.

          Well, replying yes to those question simply deleted the bad inodes (i.e. it actually got the files deleted), one of which was a top level directory, under which there was 400G (!!) of backups.

          The use and pitfalls of e2fsck is badly documented. Since all my backups are on disks, I really desire to get to understand everything about it, to prevent, predict, repair (in that order) failure.

          The drive in question here is barely one year old, i.e. still under warranty. I'll probably get a replacement one.

          I'm putting the best resources on e2fsck here:
          http://linux.overshoot.tv/wiki/hardw...e_system_check
          More info is welcome.

          Comment


            #6
            Re: e2fsck and badblocks on failing (?) hard drive: what to do?

            An observation on the thread:

            - e2fsck is a filesystem utility

            - SMART is the self-diagnostic firmware in modern hard disk drives

            - smartmontools is the utility to run SMART diagnostics and report out the status


            There's nothing about e2fsck that is designed to discover or mitigate the effects of a failing hard drive. :P

            Comment

            Working...
            X