Linux Btrfs filesystem development
 help / color / mirror / Atom feed
From: "Helmut Hullen" <Hullen@t-online.de>
To: linux-btrfs@vger.kernel.org
Subject: Re: read error: how to fix?
Date: 21 Oct 2011 11:40:00 +0200	[thread overview]
Message-ID: <BwGlMqfy1uB@helmut.hullen.de> (raw)
In-Reply-To: <1318793530.2588.28.camel@nayuki.kepstin.ca>

Hallo, Calvin,

Du meintest am 16.10.11:

[...]

> If you have pending sectors, causing the drive to reallocate them is
> very simple. Write data (any data) over the sector in question - the
> drive will then remap it onto the spare area to do the write. (The
> easiest way is to do something like dd if=/dev/zero of=/dev/sdX; but
> if you know the exact sector number, "hdparm --write-sector" can
> remap it quickly.)

(instead of a blog ... and please excuse my gerlish)

I've buyed another 2-TByte disk (Samsung - seems to be bullet proofed).

   dd if=/dev/baddisk of=/dev/gooddisk bs=8M conv=noerror

worked (about 30 hours for 2 TByte), it produced many error messages.

Unplugged /dev/baddisk, plugged /dev/gooddisk, mounted the 3-disk- 
cluster: worked.
Looking into the directories: showed no problem (with the bad disk even  
that produced error messages).
Trying to play an *.mpg: nothing. Shit.
Some error messages.

Next adventure:
Removed the good disk, plugged the bad disk.

Extracted the bad sectors (for baddisk = sdd) with

  grep 'I/O error' /var/log/warn | grep 'dev sdd' | \
    cut -d' ' -f11- | sort -u > /home/tmp/WDC-20111021.txt

"repaired" them with

#! /bin/bash
# Geruest: Joerg Sommer, de.comp.os.unix.linux.hardware 18.10.2011

Platte=/dev/sdd
# WD 20EARS

# bad sector 778550400

  for blk in $(seq 778550000 778551000)
  do
    hdparm --read-sector $blk $Platte > /dev/null
    test $? -eq 5 || continue
    hdparm --write-sector $blk --yes-i-know-what-i-am-doing $Platte
done
#

Seems to work as desired; it seems to be a good idea to "repair" not  
only the sectors shown in "/var/log/warn" but their probably environment  
too.

Ok - the file that uses this sector may be badly damaged. But people who  
have worked with LPs or MCs know such a behaviour ... no real problem.


Run btrfsck.
Many error messages.
When
        btrfs filesystem show

shows 3 disks in the cluster: have I to run btrfsck for each disk, or  
runs btrfsck over all disks of this cluster?

But now I can not only the the directories but can "open" the contents  
too - much better than nothing!

Possible next adventure:

        for Datei in /Path/to/*.mpg
          do
            cat "$Datei" > /dev/null
          done

produces (if necessary) not only the error messages in "/var/log/warn"  
but the names of the damaged files too.

Viele Gruesse!
Helmut

      parent reply	other threads:[~2011-10-21  9:40 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-07 16:51 read error: how to fix? Helmut Hullen
2011-10-10 11:48 ` David Sterba
2011-10-10 13:28   ` Helmut Hullen
2011-10-10 14:07     ` Jeff Mahoney
2011-10-10 15:58       ` Helmut Hullen
2011-10-14 19:47         ` Jeff Mahoney
2011-10-15 18:47         ` Martin Steigerwald
2011-10-15 19:59           ` Helmut Hullen
2011-10-16 19:32             ` Calvin Walton
2011-10-17  3:35               ` Helmut Hullen
2011-10-18 15:33               ` Helmut Hullen
2011-10-21  9:40               ` Helmut Hullen [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=BwGlMqfy1uB@helmut.hullen.de \
    --to=hullen@t-online.de \
    --cc=helmut@hullen.de \
    --cc=linux-btrfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox