Mixing 4K and 512e drives

Hi,

I’ve come to the point where I’ve had a drive fail and I need to get a replacement so that I can have a hot spare again.

I did some initial research and it seems ti indicate that I can mix 4K native and 512e drives in the same pool. That is with the caveat that the “ashift” for the pool is set to 12 (and mine is)

That research also indicated that I might be able to reformat a 512e drive to be a 4K native drive.

Any and all help is appreciated!

AFAIK, yes, you can. But you can’t mix them within the same VDEV.

That’s usually true.


  1. What is your pool layout at the moment?
  2. Which drives do you have?
  3. What do you plan to accomplish?
  4. Which drives would you like to add?

Thanks for the info!

    1. What is your pool layout at the moment?
    2. Which drives do you have?
    3. What do you plan to accomplish?
    4. Which drives would you like to add?
  1. My pool layout is all HDDs in one VDEV.

  2. I have HUS726060AL4210 drives

  3. I have a failed drive that I need to replace

  4. Looking at this drive: Seagate V5 ST8000NM0074

512e and 4Kn can be mixed in the same vdev, since the ashift value of “12” (4K writes) is set at pool creation. Both drives will receive and handle 4K writes transparently.

3 Likes

<…> at VDEV creation. Nevertheless, you’re probably right (and I’m wrong).

Post the output of sudo zpool get ashift <pool-name> all-vdevs, please.

Take it with a grain of salt.

AFAIK then it should not be a problem. ashift 12 == 4k.
AFAIK a 512 drive has no problem handling 4k.
Most likely, it isn’t even a real 512 drive but like you wrote, a 512e drive.

The other way would obviously not be possible. Would your 512e drive perform slightly faster for a 4k pool, when changed into 4k? Probably slightly.

NAME       PROPERTY  VALUE   SOURCE
root-0     ashift    0       -
6a0ab68d-68e0-45fa-8cf3-90c2e6148755  ashift    12      -
raidz2-0   ashift    12      -
ae983e3f-e3c8-4978-ba96-c33219e10e09  ashift    12      -
cacea778-8e19-4b72-ac69-0e6f2a0fa658  ashift    12      -
a9b84d5e-1e6c-433e-9d27-35aeab6f0162  ashift    12      -
5f120ead-79d5-4d73-bbf6-dff913978904  ashift    12      -
0131b224-6128-43af-9b11-38283772efc9  ashift    12      -
b528a750-a698-4130-85fe-0acf1cb9b796  ashift    12      -
ef6e7064-94be-4c89-ba34-7b3bdd98ee60  ashift    12      -
cannot get vdev property name from spare-7 in data_pool: invalid argument for this pool operation
cannot get vdev property ashift from spare-7 in data_pool: invalid argument for this pool operation
e4650fed-0079-4565-8bd5-157a1605ef93  ashift    12      -
6a0ab68d-68e0-45fa-8cf3-90c2e6148755  ashift    12      -

I was referring to FreeNAS/TrueNAS, which does this at pool creation. The user has no choice.

I believe it was originally hardcoded to set ashift to “9”, but that was early in the FreeNAS days before my time. They justified the hardcoded default of 12 because it is compatible with 512e and is “4Kn ready”. Basically, it doesn’t matter what drives you’re using.

You are good with any 4Kn drive. Also, quick googling showed that both models are 4Kn. So there shouldn’t be issues.

1 Like

Welp, my VDEVs have ashift=12, and the drives – 9. I even thought of making a test with adding formatted 4Kn drive to the existing VDEV. But now it is not needed.

Same for me. From my dusty knowledge about this topic, this is fine and actually to be expected. But I might be very outdated and/or horrendously wrong here.

I might be wrong, but the “ashift” reported for individual drives is irrelevant. All that matters is the vdev. If the drive reports 512-byte sector size (logical), you will see ashift=9 when querying it with the zpool command. If you’re using 4Kn drives, formatted to a 4-KB sector size, it will report them as ashift=12.

I think you are right. I looked it up and found an old forum thread which is taking about exactly that. You were right then too, I think.

Does anyone of you really format/flash 512e drives to 4K before giving them to TrueNAS? Just curious.

I’m so glad we didn’t reach stage 3 or 4.

:partying_face:


All mine are, but that’s only because I had the opportunity to format them (Seagate Exos) with SeaChest. Since there was no data on them, I went ahead and formatted them as 4Kn just because “why not”.

It’s for the same reason I flash a laptop’s BIOS to the latest version, even if I don’t need to.

1 Like

:hand_with_fingers_splayed: but thats just my OCD

3 Likes

4Kn gave me 5-10% higher sequential speed. Maybe it depends on the model, though. So it’s not just OCD.

2 Likes

Interesting. I underestimated the community. I never optimised that far outside of work. I buy 4Kn drives but most of them are 512e and I never bothered to flash them. Might try one that is still in warranty to test

Not that long ago I would have had to decide at purchase if I wanted a 512e or 4Kn drives so if you went 4Kn thats how they came formatted. More recently pretty much all HDDs are 4Kn but often come formatted 512e for cross-compatibility in some legacy systems. I just make the decision that my systems are not legacy and therefore use the 4Kn format.

It’s also nice to see in SMART it’s fully provisioned.

1 Like