Advertisement
Guest User

Untitled

a guest
May 29th, 2022
886
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.65 KB | None | 0 0
  1. Updating HGST HDD firmware aka microcode.
  2.  
  3. 
My HUS724030ALS640 drives originally had A124 firmware. With this firmware, SMART tests fail if the drive is under heavy I/O. i.e. short and long tests failed in "segment 2" if badblocks was running. For example:
  4.  
  5. SMART Self-test log
  6. Num Test Status segment LifeTime LBA_first_err [SK ASC ASQ]
  7. Description number (hours)
  8. # 1 Background short Completed - 29839 - [- - -]
  9. # 2 Background short Completed - 29829 - [- - -]
  10. # 3 Background long Completed - 29808 - [- - -]
  11. # 4 Background short Completed - 29802 - [- - -]
  12. # 5 Background short Failed in second segment 2 29756 - [0x4 0x3e 0x3]
  13. # 6 Background long Aborted (by user command) 7 29753 - [- - -]
  14. # 7 Background short Completed - 29748 - [- - -]
  15. # 8 Background short Failed in second segment 2 2 - [0x4 0x3e 0x3]
  16.  
  17. Per this post, I found new firmware online:
  18.  
  19. https://forums.servethehome.com/index.php?threads/updating-the-hgst-hdd-ssd-firmware.22381/
  20.  
  21. I updated to A3A0:
  22.  
  23. SHA1(MPGNA3A0.bin)= abc654bff165d53f04630ed5176ca37435f775ea
  24.  
  25. I found two sources of firmware, HP and Dell. Both HP and Dell has two new revisions. The HP firmware is here:
  26.  
  27. ⁃ A280(7 Oct 2015): https://support.hpe.com/hpsc/swd/public/detail?swItemId=MTX_fb658f41736c42ab9bb392979b
  28. ⁃ Drivers & software | HP MSA 1040/2040 and P2000 G3 2TB, 3TB and 4TB 6G SAS 7.2K rpm LFF Drive Models ( HUS724020ALS640, HUS724030ALS640 and HUS724040ALS640 ) Hard Drive Firmware
  29. ⁃ Specifically the download named "HP_HUS724030ALS640_A280.fla (1.1 MB)"
  30. ⁃ A3A0(7 Jul 2016): https://support.hpe.com/hpsc/swd/public/detail?swItemId=MTX_12b7069e99b746e4a8502548fc
  31. ⁃ Drivers & software | HP MSA 1040/2040 and P2000 G3 2TB, 3TB and 4TB 6G SAS 7.2K rpm LFF Drive Models ( HUS724020ALS640, HUS724030ALS640 and HUS724040ALS640 ) Hard Drive Firmware
  32. ⁃ Specifically the download named "HP_HUS724040ALS640_A3A0.fla (1.1 MB)"
  33.  
  34. Dumping the "*.fla" files via xxd, they are similar but not identical to the output mentioned in the post I found online:
  35.  
  36. # sg_write_buffer -vvvvv -m 5 --in SRGNA1D0.bin /dev/sg15
  37. found bsg_major=248
  38. open /dev/sg15 with flags=0x802
  39. tried to read 8388608 bytes from SRGNA1D0.bin, got 1114112 bytes
  40. will write 1114112 bytes
  41. Write buffer cmd: 3b 05 00 00 00 00 11 00 00 00
  42. Write buffer parameter list (first 256 bytes):
  43. 11 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  44. 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  45. 48 69 74 61 63 68 69 20 47 6c 6f 62 61 6c 20 53
  46. 74 6f 72 61 67 65 20 54 65 63 68 6e 6f 6c 6f 67
  47. 79 20 49 43 33 35 4c 78 78 78 55 78 44 33 32 31
  48. 30 2d 30 20 4d 69 63 72 6f 63 6f 64 65 20 28 43
  49. 29 20 43 6f 70 79 72 69 67 68 74 20 48 69 74 61
  50. 63 68 69 20 43 6f 72 70 2e 20 32 30 30 33 2c 20
  51. 32 30 30 34 2e 20 41 6c 6c 20 72 69 67 68 74 73
  52. 20 72 65 73 65 72 76 65 64 2e 20 20 55 53 20 47
  53. 6f 76 65 72 6e 6d 65 6e 74 20 55 73 65 72 73 20
  54. 52 65 73 74 72 69 63 74 65 64 20 52 69 67 68 74
  55. 73 20 2d 20 55 73 65 20 64 75 70 6c 69 63 61 74
  56. 69 6f 6e 20 66 6f 72 20 64 69 73 63 6c 6f 73 75
  57. 72 65 20 72 65 73 74 72 69 63 74 65 64 20 62 79
  58. 20 47 43 41 20 41 44 50 20 53 63 68 65 64 75 6c
  59. duration=6747 ms
  60.  
  61. The fla files had a header of a few dozen bytes before the 256 bytes shown above as well as a trailer (which I knew existing due to the size difference).
  62.  
  63. I also find these exact bin files online here:
  64.  
  65. ⁃ http://files.hddguru.com/download/Firmware%20updates/Hitachi/
  66. ⁃ Specifically http://files.hddguru.com/download/Firmware%20updates/Hitachi/HUS724020ALS640_HUS724030ALS640_HUS724040ALS640_A3A0.zip
  67.  
  68. I was confident applying this update because it matched the output above (dumped via xxd) and was identical to the fla files downloaded directly from HP less the header/trailer in the fla files.
  69.  
  70. To apply the firmware, I had to use:
  71.  
  72. sg_write_buffer -b 4k -m dmc_offs_save -I firmware.bin /dev/da0
  73.  
  74. In retrospect, I probably could have also used "camcontrol fwdownload".
  75.  
  76. (The HP fla files may be in "dfu" format and may need to be converted first? The header contains references to "dfudrivefw". See https://github.com/fwupd/fwupd. Or who knows, maybe the drive knows how to deal with the header/footer. The Dell files similarly have a header of 208 bytes and possibly a trailer.)
  77.  
  78. I also used "sg_modes -aa /dev/da0" before updating and then again after to see if there were any mode changes. The only significant change was:
  79.  
  80. >> Informational exceptions control, page_control: current
  81. 00 9c 0a 10 06 00 00 00 00 00 00 00 01
  82. 00 9c 0a 10 03 00 00 00 00 00 00 00 00
  83.  
  84. (This can be decoded in the HGST drive reference manual. The latter is the HGST default, so my drives had a non-default configuration.)
  85.  
  86. After updating, I'm no longer getting spurious SMART test failures even when the drives are active.
  87.  
  88. I avoided the Dell firmware though it can easily be found via Google. Dell similarly has two firmware updates available around the same time as the HP updates. The Dell update (Drive_Firmware_W21D1_LN_W350_A04.BIN) is a shell script which can be unpacked on a Linux box (--extract). Extracting the files results in a firmware file (W350.fwh with sha1sum 251a6f0b8cbabaaeaadc9858ec77c9c27b5a6619 under the "payload" directory). I was not confident using this firmware.
  89.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement