From mboxrd@z Thu Jan 1 00:00:00 1970 From: Wols Lists Subject: Re: Why not just return an error? Date: Tue, 11 Oct 2016 11:15:26 +0100 Message-ID: <57FCBBBE.2040206@youngman.org.uk> References: <57F6DF18.40703@yandex.ru> <20161007112151.GA4405@metamorpher.de> <57F7CC10.3050607@yandex.ru> <94b1a4f4-adec-90b7-e804-2d8d2c94a7af@turmel.org> <57F7DF05.8090605@yandex.ru> <20161010213726.GA3757@metamorpher.de> <57FC0E65.1050407@youngman.org.uk> <57FCAE74.7070100@youngman.org.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: Sender: linux-raid-owner@vger.kernel.org To: Brad Campbell , Andreas Klauer Cc: Dark Penguin , Phil Turmel , Rudy Zijlstra , keld@keldix.com, linux-raid@vger.kernel.org List-Id: linux-raid.ids On 11/10/16 11:01, Brad Campbell wrote: > On 11/10/16 17:18, Wols Lists wrote: >> On 11/10/16 05:00, Brad Campbell wrote: > >>>> The point is that the disk sector is not bad. So you don't want to mark >>>> it as bad on the disk. But you know that the *data* in that block is >>>> bad, so you want the disk access layer to fake a read error when you >>>> try >>>> to read it. The intent is to deliberately trigger a rewrite by md. >>> >>> I suggested this a while ago. Take the badblocks log, use hdparm to mark >>> each bad sector as bad and put the drive back in the array. I even >>> suggested potentially adding a feature to ddrescue to auto-mark the >>> blocks as bad on the target drive. >> >> But does that mean that the drive thinks those sectors are bad, and that >> they're then lost permanently at the hardware level? That's what I >> thought the badblocks list did with hdparm, and that's what I was trying >> to avoid. > > I've not used bad blocks list, but a cursory read would indicate it only > records a bad block if the writeback fails. That won't ever happen with > a bad sector created with hdparm. All hdparm does is corrupt the EEC on > the block so a read always returns dud. A write solves that issue nicely. > That's good to know. What happened with that suggestion for ddrescue? Did they not like it, or was it the usual "show us the code and we'll add it"? :-) So much to do, so little time :-) I'm trying to build a little list of projects, partly as a result of doing the wiki, that people wanting to get into raid programming (myself included!) can do. Cheers, Wol