Preface
This guide provides general guidance and is based on my Unraid setup. Specific commands for tools, time frame and final settings depend on your setup. Following this guide will require a low level format of your hard drive. You will need a 4K compatible SAS controller. Once formatted the drive will only be compatible with other 4K sector drives in traditional RAID (TrueNAS, Unraid cache), but will mix fine with other 512 formatted drives in Unraid parity pools. Proceed with caution with any low level format as you there is a (low) risk of bricking the drive. Always backup your data before proceeding with any maintenance.
Introduction
Recently 8TB drives have hit a sweet spot in pricing, touching the magical $10/TB. Many are are 8TB HGST SAS drives from Sun/Oracle Setups.
I recently purchased five 8TB drives when they were on sale for $80 each. I threw them in my test Unraid box and they work fine, but only reported 7.86TB full capacity BEFORE any format. My “new” 8TB Drives were really 7.86TB drives.
As they were, the drives worked fine, Unraid was happy to use them as 7.86TB hard drives and I could have been on my way, but I had a problem. I wanted to use the two of the HGST drives as parity, and then blend in the remainder of the HGST drives along with some 8TB SATA drives I have. Unraid did not like this. As the SATA drives reported a full 8TB RAW capacity, the HGST drives could not be used a parity. Well, poop.
Identifying the Challenge
In Unraid, drives should report their RAW storage size(3TB, 300GB, etc), as shown across the interface anywhere SIZE is displayed. Right away, I noticed my HGST 8TB drives showed 7.9TB (rounded to two digits).
When I looked at the attributes of the drive, I saw this:
User Capacity: 7,865,536,647,168 bytes [7.86 TB]
This is not correct for a full 8TB drive as it should report the following:
User capacity: 8,001,563,222,016 bytes [8.00 TB]
Something was going on.
What Causes the Challenge
After reading the Interwebs, I found this is a common challenge with some (not all) Sun/Oracle HGST drives of 8TB flavor. As received from eBay seller, the HGST drives were all formatted at 512e drives. Good, I should have a full 8TB RAW space. No, not the case. Seems these drives have special firmware. When a 512e format is applied, they work just fine, but have some sort of parity bits applied. This accounts for the missing 140GB of space.
Hope for a Full 8TB
As the parity built into the drives firmware was taking 140GB, I first thought I may just be able to remove that parity protections. The HGST drives I received did have protection enabled, but removing it did not change space. No amount of formatting with 512e restored the full drive space.
After more reading, found this special parity feature of the drives firmware does not seem to apply when the drive is formatted as 4K. This ultimately worked.
How to Get back those Missing GBs
To format a drive from 512 to 4096 (4K) sectors, you will need a few things:
- 4K compatible drive.
- 4K compatible SAS controller (LSI 9207-8i)
- sg3-utils drive utilities (See JDMs video here: https://www.youtube.com/watch?v=zewLAih46Ec)
General Procedure
- Confirm SG3 Utils is is installed on your formatting server.
- Identify a drives current size reporting with command: sg_readcap /dev/sXX (whre sXX is the targeted device on your system)
- Confirm the misreported drive space on the 8TB drive and the drive is formatted ad 512. Will look something like this:
User Capacity: 7,865,536,647,168 bytes [7.86 TB]
Logical block size: 512 bytes
Physical block size: 4096 bytes
- Run command: sg_format --format --size=4096 /dev/sXX
- Wait many, many hours (12+)
- When format is complete, shutdown then power up server.
- Check capacity again: sg_readcap /dev/sXX
- Check UnRaid reporting of drive space:
Vendor: HGST
Product: H7280A520SUN8.0T
User capacity: 8,001,563,222,016 bytes [8.00 TB]
Logical block size: 4096 bytes
Considerations and Wrap Up
I was able to restore a full 8TB RAW data to my five drives with a 4K format and my Unraid is happy.
Note, this will not apply to all HGST 8TB drives, so make sure to check capacities when testing your eBay purchases.
Also, I only recommend you do this if you really, really want your full 8TB of space (I did). As received, my 8TB drives would have been happy working at 7.86TB drives in Unraid. There is a chance you could goof up your drive on a bad format, so proceed with caution.
I you do decide to try this, please consult the Internet and feel free to message me in this forum or on Discord.
And, as always, check your backups.