ZFS ashift + gnop



Reaction score: 2
Messages: 49

It's been a while since I've given a look at this and I've been (blindly) following my build recipe for awhile now so I am wondering lately:

when I create a zpool or when adding a subsequent vdev I always:

gnop create -S 4096 /dev/da24
zpool add data1 raidz3 da24.nop da{25,26,27,28,29,30,31,32,33,34,35}
zpool export data1
gnop destroy /dev/da24.nop
zpool import data1

And this is fine and it works and I get my intended ashift=12

However, this is annoying and inconvenient especially since it requires taking the zpool offline to delete the nop device.

I wonder:

1. if my drives being truly 4k, or with the use of:
vfs.zfs.min_auto_ashift: 12

when all is said and done and zdb reports ashift=12, even when I didn't use the nop hack nor adjust vfs.zfs.min_auto_ashift, is that all I care about? Stated another way, is the nop hack doing something else I'm not aware of that I'd be losing if I didn't do it and only looked at the ashift outcome?

2. once a zpool is created and the ashift is established, will that ashift be inherited by subsequent vdevs such that I could never check zdb ever again for that zpool and it will always read the same ashift=12, even after adding several more vdevs comprised of different drive sizes?

3. assuming I still wanted to do the nop hack for vdev additions ... to avoid having to take the zpool offline to delete the nop is there any reason I can't leave it there while the zpool is in use until I can conveniently remove it at the next reboot (weeks or months away)? i.e. is there any conceivable way that removing it could result in data loss?


Aspiring Daemon

Reaction score: 331
Messages: 567

A pool created, while vfs.zfs.min_auto_ashift=12 will remain of course remain a 4k pool even if vfs.zfs.min_auto_ashift isn't set to 12 later.
Also any provider/vdev added to an existing 4k pool, will inherit 4k, no matter if vfs.zfs.min_auto_ashift is set to 9 or 12.

Though a new pool, wouldn't inherit 4k from another 4k pool, when vfs.zfs.min_auto_ashift=9.

To avoid thinking about that and make all new pools 4k, just set vfs.zfs.min_auto_ashift=12 in /etc/sysctl.conf.

I can't say what the gnop tool does, never used it.