public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Ross Biro <ross.biro@gmail.com>
To: Johan Groth <jgroth@dsl.pipex.com>
Cc: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>,
	linux-kernel@vger.kernel.org
Subject: Re: Dma problems with Promise IDE controller
Date: Tue, 19 Oct 2004 13:44:32 -0400	[thread overview]
Message-ID: <8783be6604101910443a76e223@mail.gmail.com> (raw)
In-Reply-To: <41754D7B.8090203@dsl.pipex.com>

On Tue, 19 Oct 2004 18:23:07 +0100, Johan Groth <jgroth@dsl.pipex.com> wrote:
> Ross Biro wrote:
> [snip]
> 
> >
> > The drive still has a bad sector.  You are having trouble because the
> > error recover in the Linux ide code is not the same as Windows and
> > most drive vendors care about Windows, not the ATA-Spec.  On top of
> > that Linux switches out of DMA mode once it hits a bad sector, so the
> > drive will be very slow from the on.
> >
> > The only way you are going to fix the problem is if your drive has
> > some spare sectors still available, and you do a write with out a read
> > to the bad sector.
> 
> Ok, I pretty sure it has spare sectors. How do I write to that sector
> without a read and how do I find which sector is bad?

That part is easy.  It's in your error message. 156064 is the bad
sector.  I would use dd if=/dev/zero of=/dev/hd???? bs=512 seek=?????
count=1 to write the sector, but before I did that, I would be very
sure of my sector number.  The best way I can think of to do that is
to turn off read aheda for that device and attempt to read one sector
at a time until you find the bad one.  Then reboot, double check,
reboot again, and finally write that sector out.  Then you'll need to
do an fsck to fix the file system.  You will have lost some data, but
it may not be clare what file(s) have been damaged.

If you are very confident in your backups, you could just dd
if=/dev/zero of=/dev/hd???? bs=something big and wipe the whole drive.
 That will remapp all of the bad sectors, then just mke2fs the device
and start over.

Becareful doing any of the above, if you do it wrong, you lose data. 
Even if you do it write, you lose some data, just not as much.

    Ross

      parent reply	other threads:[~2004-10-19 18:18 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-10-18 19:43 Dma problems with Promise IDE controller Johan Groth
2004-10-18 20:22 ` Bartlomiej Zolnierkiewicz
2004-10-18 21:20   ` Ross Biro
2004-10-19 16:17     ` Johan Groth
2004-10-19 17:13       ` Ross Biro
2004-10-19 17:23         ` Johan Groth
2004-10-19 17:43           ` Richard B. Johnson
2004-10-19 17:44           ` Ross Biro [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=8783be6604101910443a76e223@mail.gmail.com \
    --to=ross.biro@gmail.com \
    --cc=bzolnier@gmail.com \
    --cc=jgroth@dsl.pipex.com \
    --cc=linux-kernel@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