MZ7WD960HMHP detects wrong size

iliak

Member
Oct 2, 2018
65
20
8
update: only size incorrect issue remain

for some reason wrong size is shown for the drive 880GB instead of 960GB

i am running with ubunu 20.04 live cd.

i successfully formatted and erased using hdparm









i tired format with Samsung DC toolkit but it fails:

here is some reports\logs:

sg_format --format --size=512 /dev/sda -v
Code:
    ATA       SAMSUNG MZ7WD960  C03Q   peripheral_type: disk [0x0]
      PROTECT=0
      Unit serial number: S1E4NYAG335494
      LU name: 500253850027d80c
    mode sense(10) cdb: 5a 00 01 00 00 00 00 00 fc 00
Mode Sense (block descriptor) data, prior to changes:
  Number of blocks=0 [0x0]
  Block size=512 [0x200]

A FORMAT UNIT will commence in 15 seconds
    ALL data on /dev/sda will be DESTROYED
        Press control-C to abort

A FORMAT UNIT will commence in 10 seconds
    ALL data on /dev/sda will be DESTROYED
        Press control-C to abort

A FORMAT UNIT will commence in 5 seconds
    ALL data on /dev/sda will be DESTROYED
        Press control-C to abort
    Format unit cdb: 04 18 00 00 00 00
Format unit:
Fixed format, current; Sense key: Illegal Request
Additional sense: Invalid command operation code
Format unit command: Illegal request, Invalid opcode, type: sense key + asc,ascq
FORMAT UNIT failed

./Samsung_SSD_DC_Toolkit_for_Linux_V2.1 -d 0 -E --force
Code:
================================================================================================
Samsung DC Toolkit Version 2.1.L.Q.0
Copyright (C) 2017 SAMSUNG Electronics Co. Ltd. All rights reserved.
================================================================================================
------------------------------------------------------------------------------------------------
Disk Number: 0 | Model Name: SAMSUNG MZ7WD960HMHP-00003 | Firmware Version: DXV8C03Q
------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------
[ERROR] Secure Erase Operation Failed, Please power cycle and retry
------------------------------------------------------------------------------------------------

dmesg output:
Code:
[ 2771.558962] ata9.00: status: { DRDY ERR }
[ 2771.558965] ata9.00: error: { ABRT }
[ 2771.559173] ata9.00: NCQ Send/Recv Log not supported
[ 2771.559449] ata9.00: NCQ Send/Recv Log not supported
[ 2771.559503] ata9.00: configured for UDMA/133
[ 2771.559513] Buffer I/O error on dev sda, logical block 214887840, async page read
[ 2771.559530] ata9: EH complete

smartctl -a /dev/sda
Bash:
smartctl 7.1 2019-12-30 r5022 [x86_64-linux-5.4.0-42-generic] (local build)
Copyright (C) 2002-19, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF INFORMATION SECTION ===
Device Model:     SAMSUNG MZ7WD960HMHP-00003
Serial Number:    S1E4NYAG335494
LU WWN Device Id: 5 002538 50027d80c
Firmware Version: DXV8C03Q
User Capacity:    880,180,674,560 bytes [880 GB]
Sector Size:      512 bytes logical/physical
Rotation Rate:    Solid State Device
Device is:        Not in smartctl database [for details use: -P showall]
ATA Version is:   ACS-2, ATA8-ACS T13/1699-D revision 4c
SATA Version is:  SATA 3.1, 6.0 Gb/s (current: 6.0 Gb/s)
Local Time is:    Thu Mar  4 08:19:15 2021 UTC
SMART support is: Available - device has SMART capability.
SMART support is: Enabled

=== START OF READ SMART DATA SECTION ===
SMART overall-health self-assessment test result: PASSED

General SMART Values:
Offline data collection status:  (0x00)    Offline data collection activity
                    was never started.
                    Auto Offline Data Collection: Disabled.
Self-test execution status:      (   0)    The previous self-test routine completed
                    without error or no self-test has ever
                    been run.
Total time to complete Offline
data collection:         ( 4200) seconds.
Offline data collection
capabilities:              (0x53) SMART execute Offline immediate.
                    Auto Offline data collection on/off support.
                    Suspend Offline collection upon new
                    command.
                    No Offline surface scan supported.
                    Self-test supported.
                    No Conveyance Self-test supported.
                    Selective Self-test supported.
SMART capabilities:            (0x0003)    Saves SMART data before entering
                    power-saving mode.
                    Supports SMART auto save timer.
Error logging capability:        (0x01)    Error logging supported.
                    General Purpose Logging supported.
Short self-test routine
recommended polling time:      (   2) minutes.
Extended self-test routine
recommended polling time:      (  70) minutes.
SCT capabilities:            (0x003d)    SCT Status supported.
                    SCT Error Recovery Control supported.
                    SCT Feature Control supported.
                    SCT Data Table supported.

SMART Attributes Data Structure revision number: 1
Vendor Specific SMART Attributes with Thresholds:
ID# ATTRIBUTE_NAME          FLAG     VALUE WORST THRESH TYPE      UPDATED  WHEN_FAILED RAW_VALUE
  5 Reallocated_Sector_Ct   0x0033   099   099   010    Pre-fail  Always       -       3
  9 Power_On_Hours          0x0032   094   094   000    Old_age   Always       -       29757
12 Power_Cycle_Count       0x0032   099   099   000    Old_age   Always       -       15
177 Wear_Leveling_Count     0x0013   097   097   005    Pre-fail  Always       -       738
179 Used_Rsvd_Blk_Cnt_Tot   0x0013   099   099   010    Pre-fail  Always       -       3
180 Unused_Rsvd_Blk_Cnt_Tot 0x0013   099   099   010    Pre-fail  Always       -       6151
181 Program_Fail_Cnt_Total  0x0032   099   099   000    Old_age   Always       -       2
182 Erase_Fail_Count_Total  0x0032   099   099   000    Old_age   Always       -       1
183 Runtime_Bad_Block       0x0013   099   099   010    Pre-fail  Always       -       3
184 End-to-End_Error        0x0033   100   100   097    Pre-fail  Always       -       0
187 Reported_Uncorrect      0x0032   099   099   000    Old_age   Always       -       28
190 Airflow_Temperature_Cel 0x0032   071   060   000    Old_age   Always       -       29
195 Hardware_ECC_Recovered  0x001a   199   199   000    Old_age   Always       -       28
199 UDMA_CRC_Error_Count    0x003e   100   100   000    Old_age   Always       -       0
202 Unknown_SSD_Attribute   0x0033   100   100   010    Pre-fail  Always       -       0
235 Unknown_Attribute       0x0012   099   099   000    Old_age   Always       -       10
241 Total_LBAs_Written      0x0032   099   099   000    Old_age   Always       -       466151344736

SMART Error Log Version: 1
No Errors Logged

SMART Self-test log structure revision number 1
Num  Test_Description    Status                  Remaining  LifeTime(hours)  LBA_of_first_error
# 1  Short offline       Completed without error       00%     29757         -

SMART Selective self-test log data structure revision number 1
SPAN  MIN_LBA  MAX_LBA  CURRENT_TEST_STATUS
    1        0        0  Not_testing
    2        0        0  Not_testing
    3        0        0  Not_testing
    4        0        0  Not_testing
    5        0        0  Not_testing
  255        0    65535  Read_scanning was never started
Selective self-test flags (0x0):
  After scanning selected spans, do NOT read-scan remainder of disk.
If Selective self-test is pending on power-up, resume after 0 minute delay.
hdparm -I /dev/sda
Code:
/dev/sda:

ATA device, with non-removable media
    Model Number:       SAMSUNG MZ7WD960HMHP-00003           
    Serial Number:      S1E4NYAG335494   
    Firmware Revision:  DXV8C03Q
    Transport:          Serial, ATA8-AST, SATA 1.0a, SATA II Extensions, SATA Rev 2.5, SATA Rev 2.6, SATA Rev 3.0
Standards:
    Used: unknown (minor revision code 0x0039)
    Supported: 9 8 7 6 5
    Likely used: 9
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:  1719102880
    Logical  Sector size:                   512 bytes
    Physical Sector size:                   512 bytes
    Logical Sector-0 offset:                  0 bytes
    device size with M = 1024*1024:      839405 MBytes
    device size with M = 1000*1000:      880180 MBytes (880 GB)
    cache/buffer size  = unknown
    Nominal Media Rotation Rate: Solid State Device
Capabilities:
    LBA, IORDY(can be disabled)
    Queue depth: 32
    Standby timer values: spec'd by Standard, no device specific minimum
    R/W multiple sector transfer: Max = 16    Current = 16
    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
            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
       *    WRITE_{DMA|MULTIPLE}_FUA_EXT
       *    64-bit World wide name
            Write-Read-Verify feature set
       *    WRITE_UNCORRECTABLE_EXT command
       *    {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)
       *    Phy event counters
       *    READ_LOG_DMA_EXT equivalent to READ_LOG_EXT
       *    DMA Setup Auto-Activate optimization
       *    Asynchronous notification (eg. media change)
       *    Software settings preservation
            Device Sleep (DEVSLP)
       *    SMART Command Transport (SCT) feature set
       *    SCT Write Same (AC2)
       *    SCT Error Recovery Control (AC3)
       *    SCT Features Control (AC4)
       *    SCT Data Tables (AC5)
       *    SANITIZE feature set
       *    CRYPTO_SCRAMBLE_EXT command
       *    BLOCK_ERASE_EXT command
       *    reserved 69[4]
       *    SET MAX SETPASSWORD/UNLOCK DMA commands
       *    WRITE BUFFER DMA command
       *    READ BUFFER DMA command
       *    Data Set Management TRIM supported (limit 8 blocks)
       *    Deterministic read ZEROs after TRIM
Security:
    Master password revision code = 57069
        supported
        enabled
        locked
    not    frozen
    not    expired: security count
        supported: enhanced erase
    Security level maximum
    2min for SECURITY ERASE UNIT. 2min for ENHANCED SECURITY ERASE UNIT.
Logical Unit WWN Device Identifier: 500253850027d80c
    NAA        : 5
    IEEE OUI    : 002538
    Unique ID    : 50027d80c
Checksum: correct
 
Last edited:

iliak

Member
Oct 2, 2018
65
20
8
i think i have the reason:
hdparam marks this dirive as locked (last log on first post)

Try this sg_format --resize --count=-1 /dev/sda , also try format with --six
Code:
sg_format --resize --count=-1 /dev/sda
    ATA       SAMSUNG MZ7WD960  C03Q   peripheral_type: disk [0x0]
      Unit serial number: S1E4NYAG335494     
      LU name: 500253850027d80c
Mode Sense (block descriptor) data, prior to changes:
  Number of blocks=0 [0x0]
  Block size=512 [0x200]
Try MODE SELECT again with SP=0 this time
MODE SELECT command: Illegal request
    try '-v' for more information
sg_format failed: Illegal request
root@ubuntu:/media/ubuntu/usb32# sg_format --resize --count=-1 /dev/sda --six
    ATA       SAMSUNG MZ7WD960  C03Q   peripheral_type: disk [0x0]
      Unit serial number: S1E4NYAG335494     
      LU name: 500253850027d80c
Mode Sense (block descriptor) data, prior to changes:
  Number of blocks=0 [0x0]
  Block size=512 [0x200]
Try MODE SELECT again with SP=0 this time
MODE SELECT command: Illegal request
    try '-v' for more information
sg_format failed: Illegal request
root@ubuntu:/media/ubuntu/usb32# ^C
root@ubuntu:/media/ubuntu/usb32# sg_format --resize --six --count=-1 /dev/sda
    ATA       SAMSUNG MZ7WD960  C03Q   peripheral_type: disk [0x0]
      Unit serial number: S1E4NYAG335494     
      LU name: 500253850027d80c
Mode Sense (block descriptor) data, prior to changes:
  Number of blocks=0 [0x0]
  Block size=512 [0x200]
Try MODE SELECT again with SP=0 this time
MODE SELECT command: Illegal request
    try '-v' for more information
sg_format failed: Illegal request
not working
 

iliak

Member
Oct 2, 2018
65
20
8
Yep, unlock first then resize
trying .. no luck so far

hdparm --user-master m --security-unlock tttttttttttttttttttttttttttttttt /dev/sda hdparm -I /dev/sda
security_password: "tttttttttttttttttttttttttttttttt"

Code:
/dev/sda:
Issuing SECURITY_UNLOCK command, password="tttttttttttttttttttttttttttttttt", user=master
SG_IO: bad/missing sense data, sb[]:  70 00 05 00 00 00 00 0a 04 51 40 00 21 04 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
hdparm: No such file or directory
update
hdparm --user-master m --security-erase "" /dev/sda hdparm -I /dev/sda

worked, it is not locked ,
but it is still not enabled

Code:
Security:
    Master password revision code = 57069
        supported
    not    enabled
    not    locked
    not    frozen
    not    expired: security count
        supported: enhanced erase

still fail to resize to correct size:

sg_format --format --six --size=512 /dev/sda -v

Code:
   ATA       SAMSUNG MZ7WD960  C03Q   peripheral_type: disk [0x0]

      PROTECT=0

      Unit serial number: S1E4NYAG335494     

      LU name: 500253850027d80c

    mode sense(6) cdb: 1a 00 01 00 fc 00

Mode Sense (block descriptor) data, prior to changes:

  Number of blocks=0 [0x0]

  Block size=512 [0x200]


A FORMAT UNIT will commence in 15 seconds

    ALL data on /dev/sda will be DESTROYED

        Press control-C to abort


A FORMAT UNIT will commence in 10 seconds

    ALL data on /dev/sda will be DESTROYED

        Press control-C to abort


A FORMAT UNIT will commence in 5 seconds

    ALL data on /dev/sda will be DESTROYED

        Press control-C to abort

    Format unit cdb: 04 18 00 00 00 00

Format unit:

Fixed format, current; Sense key: Illegal Request

Additional sense: Invalid command operation code
Format unit command: Illegal request, Invalid opcode, type: sense key + asc,ascq
FORMAT UNIT failed

also when running gprated it says
/dev/sda: unrecognised disk label
 
Last edited:

iliak

Member
Oct 2, 2018
65
20
8
update:
the drive is usable after security-erase and security-unlock, but wrong size is detected 880 instead of 960 gb

cant make sg_format --resize to work
 
Last edited: