520 Sector Size Compatibility

Hey all!

Hoping this is the right spot for this, but if not I apologize…

TL/DR: Does TrueNAS support 520 sector drives currently? If not, are there any plans to support it in the future? If it doesn’t support it, and there is no plan to support is, why?

I basically have a curiosity that I’m hoping to figure out, or at worst case, hopefully be taken as a feature request of some sort if its not already implemented.

Basically, is there currently support for drives with a sector size of 520? And if not, are there any plans for it to be implemented? I only ask because it seems as if this is some sorta ‘taboo’ of the storage world, where no one will touch 520 sectors with a 520 foot pole lol. This always seemed odd to me, as so many drives out there are 520 sectored…

I personally have like, 100+ Dell branded Intel SSDs that have 520 sector sizes. I got them from work when we decommissioned an EMC storage vault… and would love to be able to use them. However they’re SATA style, and thus you cannot simply use sg_utils or the cam-something commands to simply resector them…

I have been rockin TrueNAS Scale for about a year or two now, and the thought to maybe be able to include these SSDs into my pools somehow just crossed my mind. I’ve had them for about 6 months to a year maybe, but just figured they were useless junk since they’re stuck at 520 sectors… I had thought about just selling them, but that seemed kind of like a dick move to whomever would buy them, as they’d also not be able to use them for legitimately anything… and then they’d turn around and just leave a bad review saying I sold them bad drives just because the sector size is wrong lol…

If 520 sectors are not supported currently, is there any real explanation as to ‘why’ that is? I understand 512 is ‘consumer’ spec, but at the same time, it doesn’t seem as if it would be too unreasonable to expect a storage solution that touts itself as being ‘enterprise grade’ to support an ‘enterprise’ spec. ProxMox supports several ‘enterprise’ specs even within its ‘free for consumer’ version. So it just seems kind of silly to me to not have support for 520 for those niche enterprise drives.

Oversimplifying here, but ZFS does larger/smarter checksums (256-bit by default, 512-bit optionally) and then stores that checksum away from the data, so we can tell when things have gone missing or awry that way.

And there should be a way to blast those drives back into 512B format, even if they’re SATA. :thinking: You’ve tried the usual sg_format I assume? Got a model number?

Some drives have 520 byte sectors in order to store an 8 byte checksum.

Certainly some of these drives can be reformatted back to 512 byte sectors.

So its basically because ZFS is just better at it than other typical file systems then?

And the problem with them is that sg_utils uses commands used by SAS connections (from what i’ve gathered anyway), and these drives straight up reject any SAS commands. Nothing I’ve found works at all with them.

Also, double checking the drives themselves, they appear to actually be Samsung, and not Intel. However here is what’s on the front of the drive:

If anyone can find out how these drives can be made to work with 512 you’ll get a massive high five, as I’ve tried everything I can find…

Yea, the normal SAS HDDs that were pulled from the arrays were easily converted to 512. Its only the SSDs that refuse any command i’ve found.

Oof, Samsung. I think I tried to play with these in a former life and they stubbornly refused to behave. What’s the error you get from trying to sg_format --format --size=512 -v /dev/sdX one of them?

My TrueNAS Scale box is entirely built with SAS SSDs reclaimed from a Netapp system (Samsung SM1633 disks). They were 520 byte sectors, but I reformatted them all to 512-bytes sectors and they work just fine in “normal” server hardware now.

The command I used was sg_format -v --format --size=512 /dev/<blah>

There’s a very good (and long!) thread on the STH forums that helped me get mine formatted: How to reformat HDD & SSD to 512B Sector Size | ServeTheHome Forums

1 Like

Ah, sorry, missed that they’re SATA disks

sg_format won’t work. It seems you need a recent version of hdparm, and this may work: hdparm --set-sector-size 512 --please-destroy-my-drive /dev/<blah>

A few things I found when trying to research this:

  1. Try smartctl -i /dev/sg0 and see if something similar to this appears in the smartcli output: “Formatted with type 2 protection”. Obviously you will want to work out which /dev/* to use - and in this example they are using the matching raw device rather than the block device so you may want to remember that for other commands you might want to try.

  2. The thread at How to reformat HDD & SSD to 512B Sector Size | ServeTheHome Forums has quite a lot of people asking the same thing about a variety of devices including these - but I didn’t find an answer there.

Also, these seem to be SATA II drives rather than SATA III drives - so although they are SSDs their speed might not be quite as fast as you might expect. There are a LOT of them on sale on eBay but none of the listings warn you about the 520 vs 512 byte issue.

sorry for not having replied in a bit. alot of ‘shit hit the fan’ instances happened at work and i’ve been basically living there for the past week… I’ll give the above suggestions a try once i can, however now I’m having severe TrueNAS Stability Issues that legit just started today, where the OS just reboots itself the moment any sort of large data transfers happen over NFS… its, getting kinda frustrating lol.

But like i said, I’ll def give this a shot once i have the ability! Thank you.