From mboxrd@z Thu Jan 1 00:00:00 1970 From: Douglas Gilbert Subject: Re: how to "decode" SG_IO: bad/missing sense data? Date: Tue, 16 Jun 2015 13:24:23 +0200 Message-ID: <55800767.4080601@interlog.com> References: Reply-To: dgilbert@interlog.com Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Return-path: Received: from smtp.infotech.no ([82.134.31.41]:58235 "EHLO smtp.infotech.no" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752409AbbFPLYy (ORCPT ); Tue, 16 Jun 2015 07:24:54 -0400 In-Reply-To: Sender: linux-ide-owner@vger.kernel.org List-Id: linux-ide@vger.kernel.org To: Tom Yan , linux-scsi@vger.kernel.org, linux-ide@vger.kernel.org On 15-06-16 01:05 PM, Tom Yan wrote: > When I "ATA Secure Erase" a USB Flash Drive, I got: > > SG_IO: bad/missing sense data, sb[]: f0 00 01 00 50 40 00 0a 00 00 00 > 00 00 1d 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 > > While the erase seems to work without bricking the device (multiple > trials with shred and hexdump), this message still bothers me a bit. > So is there anyway I could "decode" it so that I can know what it > actually means? Hi, Install the sg3_utils package then copy that hex sequence and place it after the sg_decode_sense command. In this case: $ sg_decode_sense f0 00 01 00 50 40 00 0a 00 00 00 00 00 1d 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 Fixed format, current; Sense key: Recovered Error Additional sense: ATA pass through information available error=0x0, status=0x50, device=0x40, sector_count(7:0)=0x0 extend=0, log_index=0x0, lba_high,mid,low(7:0)=0x0,0x0,0x0 So that ATA Secure Erase command is sending a SCSI error back through the SAT mechanism. Check the SAT standard (at www.t10.org) for details. Doug Gilbert