Fixing Sun Oracle (HGST) 8TB drives reporting 7.86TB

Just had to use this on some 10TB HGST SAS3 drives received from Super handy.

Did this natively in Unraid.

To reiterate:
sdX < Change this to whatever the device is labeled

sg_readcap /dev/sdX
sg_format --format --size=4096 /dev/sdX
sg_readcap /dev/sdX

Afterwards the second readcap command displays the correct drive size.

Without being super specific to the timing, it takes me <8h to reformat a 10TB drive.

Edit : Yes you do in fact have to keep the session open while it does the long slow format. Either use tmux, screen, or don’t reboot your computer.