Matt,
you can’t override the physical block size of a 4Kn ("4K native Advanced
Format") hard drive. (See <http://en.wikipedia.org/wiki/Advanced_Format>.)
Some Advanced Format drives use 4K physical sectors but present 512-byte
sectors to the host by faking it in the drive firmware. This is known as
Advanced Format 512e. It has the advantage that the drive remains compatible
with legacy systems that require 512-byte sectors, but the disadvantage that
all writes that are not completely aligned on 4K boundaries must be executed as
read-modify-write operations, which requires an additional rotation of the disk
platter. There is no way to write a partial sector because sync and ECC
information need to match up with the whole sector. Thus, you can’t override
the block size manually if the drive firmware doesn't support it.
If you anticipate adding Advanced Format drives to a pool sometime in the
future, it is always good to make sure the pool is created with ashift=12,
which should happen automatically if any AF drives are included in the intial
pool configuration, unless they lie to ZFS about their physical sector size.
(Some older ones unfortunately do.)
So you have two options:
- send the data to a new pool with ashift=12, or
- get a replacement drive that has physical 512-byte sectors (good) or supports
AF 512e (not so good, as it will hurt performance).
Best,
Chris
Am 16.03.2014 um 11:51 schrieb Matt Connolly <[email protected]>:
> Hi Austin,
>
> I’m not trying to change the ashift of a pool, I’m trying to override the
> physical block size of a new 4k-sector sized device so I can attach it to an
> existing ashift=9 zpool.
>
> Perhaps I’m doing it backwards trying to add a 4k sector drive to a 512b
> sector pool, and the override only works the other way?
>
> If that’s the case, I’m happy to zfs send to a new ashift=12 pool.
>
> -Matt.
>
> On 16 Mar 2014, at 12:33 pm, Austin Wise <[email protected]> wrote:
>
>> Hi Matt,
>>
>> The ashift is a property of vdevs at the top of the configuration tree. It
>> is not of a property of the vdevs below mirrors and raidz vdevs. So
>> replacing a drive in a mirror or raidz vdev won't affect this property.
>>
>> I also have a suspicion that you can't change the ashift without recreating
>> the pool. A spacemap with a larger ashift would not be able to describe the
>> closely packed allocations in a vdev with a smaller ashift. So increasing
>> the ashift would require rewriting all the blocks and block pointers to fit
>> in the coarser allocation granularity. I don't believe this block pointer
>> rewrite code exists yet.
>>
>> Regards,
>> Austin
>>
>>
>>
>> On Sat, Mar 15, 2014 at 2:53 PM, Matt Connolly <[email protected]> wrote:
>> Dear list,
>>
>> I’ve just replaced a drive in a zpool with ashift=9 with a new drive that
>> has 4k sectors.
>>
>> I’ve read through several instructional pages and I cannot override the size
>> by editing the /kernel/drv/sd.conf file, according to:
>>
>> http://wiki.illumos.org/display/illumos/ZFS+and+Advanced+Format+disks
>> http://blog.delphix.com/gwilson/2012/11/15/4k-sectors-and-zfs/
>>
>> Is the following feature included in the SmartOS live kernel?
>>
>> https://www.illumos.org/issues/2665
>>
>> Perhaps it is and it only supports making block sizes larger, not smaller?
>>
>>
>> Thanks
>> Matt
>>
>> smartos-discuss | Archives | Modify Your Subscription
>>
>> smartos-discuss | Archives | Modify Your Subscription
>
> smartos-discuss | Archives | Modify Your Subscription
-------------------------------------------
smartos-discuss
Archives: https://www.listbox.com/member/archive/184463/=now
RSS Feed: https://www.listbox.com/member/archive/rss/184463/25769125-55cfbc00
Modify Your Subscription:
https://www.listbox.com/member/?member_id=25769125&id_secret=25769125-7688e9fb
Powered by Listbox: http://www.listbox.com