[vox-tech] Linux Block Layer is Lame (it retries too much)

Mike Simons vox-tech@lists.lugod.org
Thu, 12 Jun 2003 13:24:03 -0400


--6Vw0j8UKbyX0bfpA
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Wed, May 28, 2003 at 03:09:21PM -0400, Mike Simons wrote:
> On Wed, May 28, 2003 at 11:31:56AM -0700, Jeff Newmiller wrote:
> > On Tue, 27 May 2003, Mike Simons wrote:
> > >   Last week I was having problems with the ide layer... it retries
> > > way too many times.  I was trying to read 512 byte blocks from a dying
> > > /dev/hda (using dd_rescue which calls pread), for each bad sector the
> > > kernel would try 8 times,=20
[...]
> > > - Any other ideas on how to pull the disk blocks?
> >=20
> > Not easy ones. (Build your own device driver that doesn't use mmap.)
>=20
>   Michael Wenk suggested using O_DIRECT on the open call, which is
> an excellent idea.  This was what the Oracle people at their Clustering=
=20
> Filesystem talk.  I have one more failing hard drive around which I'm=20
> going to try that on...=20

On Wed, May 28, 2003 at 02:58:30PM -0700, Michael Wenk wrote:
> The other thing I was looking at was an ioctl call for BLKRASET,
> or BLKFRASET.
[...]
> Maybe this or the ioctl will help(or possibly O_DIRECT) =20

  I changed dd_rescue to use O_DIRECT, and that required a minor change
to the malloc to posix_memalign for the buffer since O_DIRECT requires
that the memory buffer be aligned.  It seems to work very nicely, only
one retry per block... transfer from bad drive was happening near the
normal drive transfer rate (which isn't much on a laptop drive).

  Unfortunately the failure mode of the second drive was slightly
different from the previous one, so there weren't hundreds of bad=20
sectors, and even the bad regions were readable after a number of=20
retries.  I'll wait for the next failed disk to confirm things work
great with that option.  :)

--=20
GPG key: http://simons-clan.com/~msimons/gpg/msimons.asc
Fingerprint: 524D A726 77CB 62C9 4D56  8109 E10C 249F B7FA ACBE

--6Vw0j8UKbyX0bfpA
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE+6Lcz4Qwkn7f6rL4RArvaAJ9/kH27ws+9at+ESNBiKkU0+D9nvQCdFjFM
P08+yISGVyQoi0Ol999w3lQ=
=dMI4
-----END PGP SIGNATURE-----

--6Vw0j8UKbyX0bfpA--