有没有办法从 SATA 驱动器读取不经过 ECC 校正的扇区?

有没有办法从 SATA 驱动器读取不经过 ECC 校正的扇区?

我知道,在旧的 ATA 标准中存在这样的可能性:“READ LONG”命令产生 LBA 扇区 + ECC 有效负载。sg_read_long在 Linux 中支持,但是该命令已经过时很长一段时间了,所以我的 HDD 没有实现它并不让我感到惊讶。

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

以下hdparm也是转储:

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

我想读取几个没有 ECC 的扇区来更好地转储半死硬盘。

故事的另一部分是 ATAPI-8 命令集。它声明SCT 读/写 长何时起作用的命令当 IDENITFY DEVICE 数据字 106 位 12 被清除为零时根据T13/1699-D Revision 6a, Working Draft AT Attachment 8 - ATA/ATAPI Command Set (ATA8-ACS)。当且仅当设备逻辑扇区长度超过 256 个字

另一方面,它只适用于 512 字节扇区,所以我不明白当 ECC/CRC 应用于 4k 扇区时它是否有效。

答案1

简短的回答:不。

SCT 读/写 长已被淘汰T13/e08153r1 ACS-2 过时的 SCT 读写长. T13/2015-D Revision 4, Working Draft ATA/ATAPI Command Set - 2 (ACS-2)日期为 2010 年 12 月 7 日 已将此命令标记为过时。

各州T13/e08153r1的理由是删除读/写长整型命令:

记录技术的最新变化使得主机能够将其自己的错误校正/检测数据强制传输到设备的想法变得毫无意义。

http://www.t13.org/documents/UploadedDocuments/docs2009/e08153r1-Obsolete_SCT_Read_Long_and_SCT_Write_Long.pdfhttp://www.scribd.com/doc/88224835/Ataatapi-Command-Set-2-Acs-2-Rev4详细信息。

故事结局。

PSSCT LBA Segment Access (AC2)应该确实SCT Write Same (AC2)在 hdparm dump 中:)

相关内容