Manually Setting ashift at zpool creation time

53 views
Skip to first unread message

Gordan Bobic

unread,
Feb 20, 2014, 5:24:27 AM2/20/14
to zfs-...@googlegroups.com
I'm trying to set ashift manually at pool creation time, but the current zpool implementation doesn't support

-o ashift=n

option.

In fact, looking at the output of

zpool get all <poolname>

ashift property is not listed at all.

What ashift do pools get created with by default?

Where in the code would I need to make a change to hard-code it to 12 (2^12=4096 for new drives with 4KB sectors)?

Thanks.

Gordan

Durval Menezes

unread,
Feb 20, 2014, 5:53:18 AM2/20/14
to zfs-...@googlegroups.com
Hi Gordan,

This would be interesting to know. Presently I have a smallish (4 x 1TB drives) RAIDZ1 pool running with ashift=12 under zfs-fuse with no issues, but I created it using ZFSOnLinux...

Cheers, 
-- 
   Durval.



--
--
To post to this group, send email to zfs-...@googlegroups.com
To visit our Web site, click on http://zfs-fuse.net/
---
You received this message because you are subscribed to the Google Groups "zfs-fuse" group.
To unsubscribe from this group and stop receiving emails from it, send an email to zfs-fuse+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Gordan Bobic

unread,
Feb 20, 2014, 6:22:04 AM2/20/14
to zfs-...@googlegroups.com
Indeed, my plan B was to yank the disks and create the pools on an x86 box using ZoL, but that's a bit lame. I'd much rather patch the code in zfs-fuse to always use ashift=12 instead of ashift=9 since today 12 makes far more sense in the default case.

ray vantassle

unread,
Feb 20, 2014, 11:44:32 AM2/20/14
to zfs-...@googlegroups.com

Indeed, my plan B was to yank the disks and create the pools on an x86 box using ZoL, but that's a bit lame. I'd much rather patch the code in zfs-fuse to always use ashift=12 instead of ashift=9 since today 12 makes far more sense in the default case.

I tried that once.  Being lazy I just hardcoded 12.  Worked fine...until I tried to add a new disk into a pool that had been created with the original ashift=9.  Which it complained about and refused to do.  So now I have both executables, one does 9 the other does 12.

I once came across a patch which added the -ashift option to zfs-fuse, wasn't sure why it had never gotten into a release.  AFAIK it still isn't in.

Gordan Bobic

unread,
Feb 20, 2014, 11:47:03 AM2/20/14
to zfs-...@googlegroups.com
It isn't in the build I'm using, but if you can find the patch please do post a link.
My proposed patch is broken - it creates a pool that is incompatible with unmodified ZFS which is _bad_.


--

Emmanuel Anne

unread,
Feb 20, 2014, 12:49:35 PM2/20/14
to zfs-...@googlegroups.com
There was never a patch for this, I have no hardware to test it so I never did it, but it's easy to manually modify the hard coded value in the code (just grep ashift, you'll find it).

Gordan Bobic

unread,
Feb 20, 2014, 2:34:20 PM2/20/14
to zfs-...@googlegroups.com
I did, but clearly I put it in the wrong place, as per the patch I sent. It seems to work OK, but the pool shows up as corrupted when accessed with unmodified zfs-fuse. Since a pool created with ashift=12 using ZoL works fine with zfs-fuse, I'm 100% certain my patch breaks it.

So a pointer on which instance to edit would be most welcome.

Reply all
Reply to author
Forward
0 new messages