HP 3PAR arrays format their drives with 520 byte sectors, which are incompatible with standard operating systems. There are many guides online for reformatting 520 byte drives to 512 using sg_format, but HP 3PAR HGST drives with FIPS encryption (model HSCP0920S5xnFMRI) are particularly stubborn. The custom 3PAR firmware (3P02) blocks FORMAT UNIT and SANITIZE commands, and the FIPS TCG Enterprise encryption adds another layer of write protection on top of that.

After a lot of research and failed attempts, I found the solution. The key is sedutil-cli --PSIDrevertAdminSP which reverts only the Admin Security Provider. The commonly referenced --yesIreallywanttoERASEALLmydatausingthePSID attempts a full TPer revert which these drives reject.

Examples of errors I came across before finding a solution

sg_format with Data Protect:

# sg_format -v --format --size=512 /dev/sdi
Format unit: Fixed format, current; Sense key: Data Protect
Additional sense: Access denied - no access rights
FORMAT UNIT failed

sg_sanitize --crypto with Data Protect:

# sg_sanitize --crypto /dev/sdi
Sanitize failed: Data protect
sg_sanitize failed: Data protect

HUGO sanitize failing:

# hugo sanitize --simple-progress -c -s <SERIAL>
Failed: Sanitize command Failed on device <SERIAL>.
Please check the product spec to ensure this device supports Cryptographic Erase.

sedutil --PSIDrevert with INVALID_FUNCTION (full TPer revert rejected by 3PAR firmware):

# sedutil-cli --PSIDrevert <PSID> /dev/sdi
method status code INVALID_FUNCTION

sedutil --yesIreallywanttoERASEALLmydatausingthePSID with INVALID_FUNCTION (same as above, these two commands are aliases):

# sedutil-cli --yesIreallywanttoERASEALLmydatausingthePSID <PSID> /dev/sdi
method status code INVALID_FUNCTION

sedutil with SP_BUSY (caused by retrying without cold power cycling the drive):

# sedutil-cli --PSIDrevert <PSID> /dev/sdi
method status code SP_BUSY
Session start failed rc = 3

Hardware

  • Drives: HPE HSCP0920S5xnFMRI (HGST Ultrastar SSD1600MR, 920GB, FIPS encrypted, SAS 12Gb/s)
  • Controller: Broadcom/LSI SAS2008 flashed to IT mode (P20 firmware)
  • Cabling: SFF-8087 to 4x SFF-8482 forward breakout cables
  • OS: Arch Linux

The SAS2008 must be in IT mode. IR mode will reject 520 byte sector drives entirely.

Install required packages

sudo pacman -S sg3_utils lsscsi smartmontools
yay -S sedutil

Identify drives

# sg_scan -i
/dev/sg8: scsi2 channel=0 id=2 lun=0
    HGST      HSCP0920S5xnFMRI  3P02   [rmb=0 cmdq=1 pqual=0 pdev=0x0]

You can confirm the 520 byte sector size and the drive's serial with smartctl:

# smartctl -i /dev/sdi
Vendor:               HGST
Product:              HSCP0920S5xnFMRI
Revision:             3P02
User Capacity:        930,266,746,240 bytes [930 GB]
Logical block size:   520 bytes
Serial number:        <SERIAL>

The fix: PSIDrevertAdminSP

The PSID is a 32-character alphanumeric string printed on the physical label of the drive. It is case sensitive. Use the exact case as printed on the label.

# sedutil-cli --PSIDrevertAdminSP <PSID_FROM_DRIVE_LABEL> /dev/sdi

This command authenticates with the PSID and reverts only the Admin Security Provider, rather than attempting a full TPer revert. On these 3PAR drives, that is sufficient to clear the write protection that blocks sg_format. It runs silently and returns to the prompt on success. If you see Session Authenticate failed, double check the PSID characters. Cold power cycle the drive between attempts if you get SP_BUSY.

Format to 4096 byte sectors

Once the PSID revert completes, sg_format works immediately:

# sg_format -v --format --size=4096 /dev/sdi
    HGST      HSCP0920S5xnFMRI  3P02   peripheral_type: disk [0x0]
Mode Sense (block descriptor) data, prior to changes:
  Number of blocks=1788974512 [0x6aa195b0]
  Block size=520 [0x208]

A FORMAT UNIT command will commence in 15 seconds
    ALL data on /dev/sdi will be DESTROYED
        Press control-C to abort
Format unit command launched without error
Format unit seems to be successful and finished quickly
FORMAT UNIT Complete

Confirm the result:

# smartctl -i /dev/sdi
Vendor:               HGST
Product:              HSCP0920S5xnFMRI
Revision:             3P02
User Capacity:        915,954,950,144 bytes [915 GB]
Logical block size:   4096 bytes

The capacity drops slightly from 930 GB to 915 GB due to the sector size change and the loss of 3PAR's custom adaptive sparing.

You can also format to 512 byte sectors if your use case requires it by passing --size=512 instead. I used 4096 for my setup.

I found the solution in this ServeTheHome forum thread.

Previous Post Next Post