OPNsense Forum

Archive => 22.1 Legacy Series => Topic started by: dirtyfreebooter on January 20, 2022, 09:25:48 PM

Title: zfs root on 22.1 rc1 install
Post by: dirtyfreebooter on January 20, 2022, 09:25:48 PM
i noticed 2 things with ZFS install on SSDs

one, autotrim is off by default, that is easy enough to turn on, but the other, ashift=0 is bad for SSDs, and should be ashift=12 which is not harmful to HDDs. maybe the ashift default should just be 12?
Title: Re: zfs root on 22.1 rc1 install
Post by: onedr0p on January 21, 2022, 06:00:31 AM
ashift looks to be set to zero, but if you actually look at the zpool cache you might see that it was defaulted to 12. Which I believe makes sense because 0 is going to try to determine what ashift actually is:


zdb -U /boot/zfs/zpool.cache | grep ashift
ashift: 12


And for anyone discovering this issue you can turn on autotrim with:


zpool set autotrim=on zroot
Title: Re: zfs root on 22.1 rc1 install
Post by: dirtyfreebooter on January 21, 2022, 04:43:40 PM
you are 100% correct! thank you!
Title: Re: zfs root on 22.1 rc1 install
Post by: franco on January 25, 2022, 08:42:41 AM
FWIW, when using ZFS the following is set during boot of OPNsense:

% git grep ashift
src/etc/rc.loader.d/20-zfs:vfs.zfs.min_auto_ashift=12


Cheers,
Franco
Title: Re: zfs root on 22.1 rc1 install
Post by: dinguz on January 25, 2022, 10:48:30 AM
I don't see autotrim in my current setup, I presume this a 22.x-only feature?
Title: Re: zfs root on 22.1 rc1 install
Post by: franco on January 25, 2022, 10:52:20 AM
FreeBSD 13 is now using OpenZFS so that might be it.


Cheers,
Franco