Trying to clone a ZFS drive, can't get ashift=12

Peter Wemm peter at
Wed Apr 1 06:31:49 UTC 2015

On Wednesday, April 01, 2015 12:30:46 AM Daniel Eischen wrote:
> I have an Oracle (nee Sun) X4-2 server with identical 300GB SAS
> drives.  I did an MBR ZFS install from FreeBSD 10.1-RELEASE CD
> and have it updated to p6:
>    # zpool create -o cachefile=/tmp/newpool.cache bootpoolNew label/boot0
>    # zdb -U /tmp/newpool.cache | grep ashift
>                ashift: 9
> What gives?  How do I get it to use 4k?

Before creating the pool, try:
#  sysctl vfs.zfs.min_auto_ashift=12

But watch your alignment of the MBR slices/partitions. I think you'll find it 
easier to manage with gpt for a data disk, eg:

# gpart create -s gpt da1
# gpart add -t freebsd-zfs -a 4k da1
combine that with the sysctl above you should have everything on 4k.

Setting -a just sets the rounding for the start/end sectors, it doesn't affect 
zfs when its sizing the sector size internally.

btw; for a 300G drive you might not want 4k - this changes the base allocation 
size to be 8 times larger.  You might find your space efficiency less than ideal 
if you have a lot of tiny files.

Peter Wemm - peter at; peter at; peter at; KI6FJV
UTF-8: for when a ' or ... just won\342\200\231t do\342\200\246

More information about the freebsd-stable mailing list