From owner-freebsd-scsi@freebsd.org Thu Jun 13 13:34:51 2019 Return-Path: Delivered-To: freebsd-scsi@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7E38315B233F for ; Thu, 13 Jun 2019 13:34:51 +0000 (UTC) (envelope-from ken@kdm.org) Received: from mithlond.kdm.org (mithlond.kdm.org [96.89.93.250]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mithlond.kdm.org", Issuer "mithlond.kdm.org" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 0906184EEE for ; Thu, 13 Jun 2019 13:34:49 +0000 (UTC) (envelope-from ken@kdm.org) Received: from mithlond.kdm.org (localhost [127.0.0.1]) by mithlond.kdm.org (8.15.2/8.14.9) with ESMTPS id x5DDYe5Y014993 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 13 Jun 2019 09:34:40 -0400 (EDT) (envelope-from ken@mithlond.kdm.org) Received: (from ken@localhost) by mithlond.kdm.org (8.15.2/8.14.9/Submit) id x5DDYehw014992; Thu, 13 Jun 2019 09:34:40 -0400 (EDT) (envelope-from ken) Date: Thu, 13 Jun 2019 09:34:39 -0400 From: "Kenneth D. Merry" To: peter.blok@bsd4all.org Cc: freebsd-scsi@freebsd.org Subject: Re: Bad SSD drive - what happens with unreadable data Message-ID: <20190613133439.GE66314@mithlond.kdm.org> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.4.3 (mithlond.kdm.org [127.0.0.1]); Thu, 13 Jun 2019 09:34:40 -0400 (EDT) X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=ham autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on mithlond.kdm.org X-Rspamd-Queue-Id: 0906184EEE X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; spf=pass (mx1.freebsd.org: domain of ken@kdm.org designates 96.89.93.250 as permitted sender) smtp.mailfrom=ken@kdm.org X-Spamd-Result: default: False [-4.77 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_HAS_DN(0.00)[]; R_SPF_ALLOW(-0.20)[+a:mithlond.kdm.org]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; DMARC_NA(0.00)[kdm.org]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; MX_GOOD(-0.01)[mail.scsiguy.com,mithlond.kdm.org]; RCPT_COUNT_TWO(0.00)[2]; NEURAL_HAM_SHORT(-0.98)[-0.981,0]; IP_SCORE(-1.48)[ip: (-3.77), ipnet: 96.64.0.0/11(-3.64), asn: 7922(0.05), country: US(-0.06)]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:7922, ipnet:96.64.0.0/11, country:US]; RCVD_TLS_LAST(0.00)[] X-BeenThere: freebsd-scsi@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SCSI subsystem List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Jun 2019 13:34:51 -0000 On Thu, Jun 13, 2019 at 13:02:48 +0200, peter.blok@bsd4all.org wrote: > Hi, > > I have a bad SSD drive. If I read it with dd and conv=noerror, what happens with the unreadable areas? Does it fill with zeroes, or does the driver still copy what it was able to read? > > I???m getting ATA status 51 back, many blocks in a row. Followed by chunks of readable data, followed by unreadable data. > > Is there a modepage or something else to tell the drive to pass on the bad data? > > Any other ideas? You might try the recoverdisk(1) utility. It is designed for that sort of situation. One of the recommendations in the recoverdisk(1) man page is to lower the retry count for the disk driver you're using, so you don't wind up retrying a lot in situations where the drive itself has tried and failed to read the data. In looking at the source, it appears tht it will only write out the blocks it is able to read successfully. IMO, it would be good to have at least an option to write zeros in output file in the areas where the reads failed. Ken -- Kenneth Merry ken@kdm.org