Sata

有沒有辦法在沒有 ECC 校正的情況下從 SATA 驅動器讀取扇區?

  • June 9, 2013

我知道,在舊的 ATA 標準中有這樣的可能性:“READ LONG”命令產生 LBA 扇區 + ECC 有效負載。sg_read_long在 linux 中支持 in,但是該命令已經過時了很長時間,所以我並不感到驚訝,我的 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 Read/Write Long命令在 IDNITFY DEVICE 數據字 106 位 12根據清零時起作用T13/1699-D Revision 6a, Working Draft AT Attachment 8 - ATA/ATAPI Command Set (ATA8-ACS)如果設備邏輯扇區長於 256 個字,則該位設置為 1 。

OTOH,它只適用於 512 字節的扇區,所以我不明白當 ECC/CRC 應用於 4k 扇區時它是否有效。

簡短的回答:不。

SCT Read/Write Long已被T13/e08153r1 ACS-2 Obsolete SCT Read and Write Long 淘汰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轉儲中:)

引用自:https://serverfault.com/questions/417948