On Sun, Mar 16, 2014 at 08:51:46PM +1000, Matt Connolly wrote:

> 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?

Is this a 4k disk, or a 512e disk?  It is possible to send 512-byte
commands to a 512e disk; it is not possible to send them to a 4k disk.
So convincing sd that a 4k disk has 512-byte sectors is not likely to
lead to any good outcome.  That's why you'll note the following code at
sd.c:4227:

        if (strcasecmp(name, "physical-block-size") == 0) {
                if (ddi_strtol(value, &endptr, 0, &val) == 0 &&
                    ISP2(val) && val >= un->un_tgt_blocksize &&
                    val >= un->un_sys_blocksize) {
                        un->un_phy_blocksize = val;
                } else {
                        goto value_invalid;
                }
        ...

So yes, this can be used only to increase the blocksize, not to decrease
it, for the reason described above.

> If that’s the case, I’m happy to zfs send to a new ashift=12 pool.

Recommended.


-------------------------------------------
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

Reply via email to