Ashift, FreeNAS 9.1.1 and FreeBSD 9.2

Status
Not open for further replies.

aufalien

Patron
Joined
Jul 25, 2013
Messages
374
Hi all,

Wondering how is it that FreeNAS sees my vdevs with an ashift of 12 but FreeBSD sees em as 9?

Kind of odd as I didn't do anything out of the ordinary.
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
Can you provide the commands you are running and their output. What you are claiming is pretty much impossible. So somewhere there is an error on your part. Just wondering what commands you used to come to this conclusion since I know the ashift didn't change between OSes.
 

aufalien

Patron
Joined
Jul 25, 2013
Messages
374
I use zdb to show me ashift properties. The diskinfo command on either distro shows the drives as 512 byte although they are newer and do support advanced format 4K sectors.

In FreeBSD I do the gnop hack get the ashift were I want it.

So FreeNAS is thankfully doing something cool to get the right ashift, perhaps its the partitioning scheme used due to the swap they add.

Why would you say its impossible w/o trying fro yourself?
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
I say impossible because the file system metadata for ZFS is dependent on that ashift. If it was 12 in FreeNAS and somehow you hacked it to be 9 on FreeBSD the zpool wouldn't mount at all because if something said to go to sector 10 on the pool, that's going to be a different place for the different ashifts. So no, it won't mount and there's no way you're going to fix that. Changing the ashift isn't possible after the vdev has been created. That's why I say its not possible and that you are confusing something. That's also why I asked for the commands you used.

zdb is the only way to know what the ashift property is for your pool. The diskinfo tells you the sector size, but that is not the same as the ashift property. Ideally they should match for performance reasons, but they don't have to. When they don't there is a performance penalty that can rank from almost unnoticable to severe.

So I'll ask again for you post the commands you use and the outputs? I can't really explain the mistake you are making in understanding and interpreting the information if I don't know what your sources are.
 

aufalien

Patron
Joined
Jul 25, 2013
Messages
374
Dude, what are you talking about? I never said that I hacked FreeBSD to get me an ashift of 9. And how am I confusing anything, its pretty simple, using zdb on either system gets me a diff ashift value for the pool.

Like I said, try it yourself.

But I am hoping that some one from the FreeNAS devs can chime in as you seem clueless here. Are you the only lurker on this site?
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
Dude, what are you talking about? I never said that I hacked FreeBSD to get me an ashift of 9. And how am I confusing anything, its pretty simple, using zdb on either system gets me a diff ashift value for the pool.

Like I said, try it yourself.

I did no such thing. I gave a hypothetical scenario where you forced it to 9 to explain to you that the zpool wouldn't mount if you changed it to 9.

Oh gee. I just loaded my VM from FreeNAS with FreeBSD 9. Color me shocked. Both say ashift=12.

But I am hoping that some one from the FreeNAS devs can chime in as you seem clueless here. Are you the only lurker on this site?

And still no commands with the outputs.. sigh. I wanted pasted outputs as I am 100% sure you are interpreting something improperly, but don't let me hold you back.

But I am so freakin' clueless. Me and my 5k posts. I should just shut my mouth as clearly there is no intelligence in this thread.

Good day sir.
 

aufalien

Patron
Joined
Jul 25, 2013
Messages
374
Things I found;

The ashift 9 on FreeBSD is to be expected and one would either;

a) use the gnop workaround on the drives.
b) use GELI on the drives.

Both would yield an ashift of 12

Now I suspect that in FreeNAS, the ashift 12 due to the swap being encrypted hence looks like b) above.

Also, I took down my FreeBSD box and installed Solaris on it, same result of ashift 9.

I will confirm by setting up another FreeNAS test box and creating a zpool via CLI. I suspect its ashift will be 9 as I wouldn't have created an encrypted swap on it.

I've a current FreeNAS box in production functioning as an emergency backup now. But I have 2 duplicate servers here, one of which I can play with at will.

I think this is all due to my Seagate Constellations reporting with 512 byte sectors according to the diskinfo command. According to Seagate this is to ensure compatibility with older Windows OS's. However the drives do support Advanced Format 4K sectors.

My problem with you is that you assume every one is wrong and made a mistake. Kind of like the sys admin whom when asked for something automatically says no.

As for commands you want, I simply run zds | grep ashift on Solaris, FreeNAS and FreeBSD. I create the zpool in FreeNAS via the GUI. In FreeBSD/Solaris its via CLI on raw un partitioned drives.

So what output do you really need here?
 

NachoMan77

Dabbler
Joined
Sep 23, 2013
Messages
17
aufalien, it wasn't clear from your first post that you weren't mounting the same zpool on each system, hence CJ's answer (i.e.: it's impossible, since ashift values are embedded in the pool config)

So, after reading the rest of your posts, I assume you are creating different zpools on each system using the exact disks, right?

So basically your question is: why does FreeNAS get's it right while FreeBSD doesn't?

My answer: I don't know, but I hope at least I helped clearing your issue so that someone more knowledgeable can chime in.
 

aufalien

Patron
Joined
Jul 25, 2013
Messages
374
Well I must have explained this very wrong as to me, an ashift of 12 is correct and right value.

My question was why are you guys doing it right and FreeBSD being the parent OS not.

I derived my answer, hopefully in a correct fashion. I did mention FreeNAS doing some magic in my earlier post and would hope that inferred its the preferred result.

And yes, exact same hardware, different distro is all.
 

vegaman

Explorer
Joined
Sep 25, 2013
Messages
58
So what you actually meant in the OP is: FreeNAS creates vdevs with ashift 12 but FreeBSD creates them with ashift 9?

If not I don't know what you mean and would come to the same conclusion as cyberjock.
 

aufalien

Patron
Joined
Jul 25, 2013
Messages
374
That's correct.

To be exact, FreeNAS partitions on 4K blocks when created via the GUI. In FreeBSD, Solaris, Linux etc... you simply create them either by;

1) Creating partitions on 4K blocks then use them in ZFS
2) Creating your zpool with the -o ashift=12 which creates this layout on each drive;

Number Start End Size File system Name Flags
1 1049kB 3001GB 3001GB zfs
9 3001GB 3001GB 8389kB

* Linux used in the example.
Prior to this, the drives were raw, partition-less if you will.

Otherwise if you simply create your zpools on raw drives, you will most likely get an ashift of 9. Unsure how SAS or FC drives are handled, or even other SATA drives for that matter. But mine being Seagate Constellation ES.2, will be seen as 512byte sector capable even though 4K is supported.

I found this very interesting and educational. I'm testing various distros that support ZFS. So far, even thought I prefer CLI, FreeNAS seems the win. Still finalizing my testing however.

I should have considered FreeNAS last year during an important storage transition project but that ship has sailed, for now anyways. This one I'm on now is the flag ship.

I still can't get over the thoroughness and flow of the documentation, simply amazing. I even have it on my Kindle :)

How do these guys make money, there main distro is free. And then they hired some high end guy from Apple with deep FreeBSD roots, that ain't cheap.
 
Status
Not open for further replies.
Top