getting to 4K disk blocks in ZFS
Stefan Esser
se at freebsd.org
Thu Sep 11 10:23:45 UTC 2014
Am 11.09.2014 um 11:06 schrieb Pete French:
>> This may never hit you, but ZFS is built on the assumption, that it
>> cannot happen at all, which is no longer true with 4KB drives that
>> are used with ashift=9.
>
> Have just been reading this thread, and as people are suggesting
> moving ashift from 9 to 12, doesnt using use 512B drives with
> ahift=12 also violate this ? Or is it smart enough ot know that
> the underlying sectors are separate ?
There is no problem, if ashift covers more than 1 sector, except
that you waste some space. If ashift=12 is used with 512 byte
sectors, then all writes will be to 8 consecutive sectors. There
is no read-modify-write as in the opposite case (ashift=9 with 4K
sectors).
But the amount of wasted space can be quite substantial. I have
read reports of some 8% less usable space with ashift=12 compared
to ashift=9, for an empty ZFS file system. And with lots of small
files, this will become worse, once the file system is filled.
With RAIDZ, the effective allocation unit is not the minimum size
block (as determined by ashift), but that value multiplied by the
number of data drives without parity (e.g. 2*512 / 2*4K for a 3
drive raidz1, 4*512 / 4*4K for a 5 drive raidz1). This leads to
an effective smallest allocation unit of 16 KByte on a 5 drive
raidz1 with ashift=12, vs. 2 KByte with ashift=9.
Regards, STefan
More information about the freebsd-stable
mailing list