9

I know, there was such possibility like that in old ATA standards: "READ LONG" command produced LBA sector + ECC payload. sg_read_long supports in in linux, but the command is obsolete for quite a long time, so I'm not surprised, that my HDD does not implement it.

root@ubuntu:~# sg_read_long --lba=2118229 /dev/sdc
sg_read_long: issue read long (10) to device /dev/sdc
    xfer_len=520 (0x208), lba=2118229 (0x205255), correct=0
  SCSI READ LONG (10) command not supported
root@ubuntu:~# sg_read_long -v --16 --lba=2118229 /dev/sdc
sg_read_long: issue read long (16) to device /dev/sdc
    xfer_len=520 (0x208), lba=2118229 (0x205255), correct=0
    Read Long (16) cmd: 9e 11 00 00 00 00 00 20 52 55 00 00 02 08 00 00 
read long (16):  Fixed format, current;  Sense key: Illegal Request
 Additional sense: Invalid field in cdb
  SCSI READ LONG (16) command, bad field in cdb

Here is hdparm dump too:

root@ubuntu:~# hdparm -I /dev/sdc

/dev/sdc:

ATA device, with non-removable media
    Model Number:       WDC WD30EZRX-00MMMB0                    
    Serial Number:      WD-WCAWZ1777146
    Firmware Revision:  80.00A80
    Transport:          Serial, SATA 1.0a, SATA II Extensions, SATA Rev 2.5, SATA Rev 2.6, SATA Rev 3.0
Standards:
    Supported: 8 7 6 5 
    Likely used: 8
Configuration:
    Logical     max current
    cylinders   16383   16383
    heads       16  16
    sectors/track   63  63
    --
    CHS current addressable sectors:   16514064
    LBA    user addressable sectors:  268435455
    LBA48  user addressable sectors: 5860533168
    Logical  Sector size:                   512 bytes
    Physical Sector size:                  4096 bytes
    Logical Sector-0 offset:                  0 bytes
    device size with M = 1024*1024:     2861588 MBytes
    device size with M = 1000*1000:     3000592 MBytes (3000 GB)
    cache/buffer size  = unknown
Capabilities:
    LBA, IORDY(can be disabled)
    Queue depth: 32
    Standby timer values: spec'd by Standard, with device specific minimum
    R/W multiple sector transfer: Max = 16  Current = 0
    DMA: mdma0 mdma1 mdma2 udma0 udma1 udma2 udma3 udma4 udma5 *udma6 
         Cycle time: min=120ns recommended=120ns
    PIO: pio0 pio1 pio2 pio3 pio4 
         Cycle time: no flow control=120ns  IORDY flow control=120ns
Commands/features:
    Enabled Supported:
       *    SMART feature set
            Security Mode feature set
       *    Power Management feature set
       *    Write cache
       *    Look-ahead
       *    Host Protected Area feature set
       *    WRITE_BUFFER command
       *    READ_BUFFER command
       *    NOP cmd
       *    DOWNLOAD_MICROCODE
            Power-Up In Standby feature set
       *    SET_FEATURES required to spinup after power up
            SET_MAX security extension
       *    48-bit Address feature set
       *    Device Configuration Overlay feature set
       *    Mandatory FLUSH_CACHE
       *    FLUSH_CACHE_EXT
       *    SMART error logging
       *    SMART self-test
       *    General Purpose Logging feature set
       *    64-bit World wide name
       *    {READ,WRITE}_DMA_EXT_GPL commands
       *    Segmented DOWNLOAD_MICROCODE
       *    Gen1 signaling speed (1.5Gb/s)
       *    Gen2 signaling speed (3.0Gb/s)
       *    Gen3 signaling speed (6.0Gb/s)
       *    Native Command Queueing (NCQ)
       *    Host-initiated interface power management
       *    Phy event counters
       *    NCQ priority information
            DMA Setup Auto-Activate optimization
       *    Software settings preservation
       *    SMART Command Transport (SCT) feature set
       *    SCT LBA Segment Access (AC2)
       *    SCT Features Control (AC4)
       *    SCT Data Tables (AC5)
            unknown 206[12] (vendor specific)
            unknown 206[13] (vendor specific)
Security: 
    Master password revision code = 65534
        supported
    not enabled
    not locked
    not frozen
    not expired: security count
        supported: enhanced erase
    508min for SECURITY ERASE UNIT. 508min for ENHANCED SECURITY ERASE UNIT.
Logical Unit WWN Device Identifier: 50014ee25bc950c2
    NAA     : 5
    IEEE OUI    : 0014ee
    Unique ID   : 25bc950c2
Checksum: correct

I want to read several sectors without ECC to create better dump of half-dead HDD.

Another part of story is ATAPI-8 command set. It declares SCT Read/Write Long command that works when when IDENITFY DEVICE data word 106 bit 12 is cleared to zero according to T13/1699-D Revision 6a, Working Draft AT Attachment 8 - ATA/ATAPI Command Set (ATA8-ACS). This bit is set to 1 iff Device Logical Sector longer than 256 Words.

OTOH, it works only with 512-byte sectors, so I don't understand if it works when ECC/CRC is applied to 4k sectors.

darkk
  • 333
  • 2
  • 10

1 Answers1

3

Short answer: NO.

SCT Read/Write Long is obsoleted by T13/e08153r1 ACS-2 Obsolete SCT Read and Write Long. T13/2015-D Revision 4, Working Draft ATA/ATAPI Command Set - 2 (ACS-2) dated December 7, 2010 already marks this command as obsolete.

The T13/e08153r1 states the reason being for removal of Read/Write Long commands:

Recent changes in recording technology have made the idea of a host being able to actually force its own error correction/detection data to the device meaningless.

See http://www.t13.org/documents/UploadedDocuments/docs2009/e08153r1-Obsolete_SCT_Read_Long_and_SCT_Write_Long.pdf and http://www.scribd.com/doc/88224835/Ataatapi-Command-Set-2-Acs-2-Rev4 fot details.

End of story.

P.S. SCT LBA Segment Access (AC2) should really be SCT Write Same (AC2) in hdparm dump :)

darkk
  • 333
  • 2
  • 10
  • 1
    To make sure I understand this correctly: `READ LONG` was used to force reading sectors that didn’t pass the ECC check. These documents make the command obsolete. Does this mean that there is no way to force the drive into returning sector data that fails ECC check? – Davor Josipovic Jun 08 '13 at 19:27
  • @davor I think so. – darkk Jun 09 '13 at 10:01
  • @davor at least there is no well-known and documented way to do so. – darkk Jun 09 '13 at 11:05
  • darkk is totally correct, but I thought I'd point out that the technical reference manual for similar products, like the WD10EZEX and WD30EURS assert that, despite obsoleted and removed from the standards, the drives still supports access. It may be a mistake, because despite being advanced format drives the WD document still refers to the sectors as 512 bytes. – etherfish Feb 20 '14 at 19:17