FreeBSD 12.2-RELEASE-p9 trim (ZFS, not OpenZFS): open failed: /dev/ada0: Operation not permitted

David Christensen dpchrist at holgerdanske.com
Tue Aug 31 06:47:05 UTC 2021


On 8/30/21 7:46 PM, Graham Perrin wrote:
> On 31/08/2021 02:06, David Christensen wrote:
>> On 8/30/21 2:16 AM, Graham Perrin wrote:
>>> On 30/08/2021 08:45, David Christensen wrote:
>>>
>>>> … created with FreeBSD-12.1-RELEASE-amd64-memstick on a USB flash 
>>>> drive with ZFS boot, encrypted swap, and encrypted ZFS root.

>>>> ZFS kernel module is loaded:
>>>>
>>>> 2021-08-30 00:30:42 toor at f3 ~
>>>> # kldstat
>>>> Id Refs Address                Size Name
>>>>  1   23 0xffffffff80200000  227ae98 kernel
>>>>  2    1 0xffffffff8247c000    1e7b0 geom_eli.ko
>>>>  3    2 0xffffffff8249b000     a448 opensolaris.ko
>>>>  4    1 0xffffffff824a8000     ee98 aesni.ko
>>>>  5    1 0xffffffff824b7000   3bad38 zfs.ko
>>>>  6    1 0xffffffff82872000    27c00 geom_mirror.ko
>>>>  7    1 0xffffffff8289a000    27ce8 fuse.ko
>>>>  8    1 0xffffffff82b21000      acf mac_ntpd.ko

>> I installed the package "openzfs":

>> 2021-08-30 18:01:18 toor at f2 ~
>> # zpool trim bootpool 2>&1 | head -n 1
>> unrecognized command 'trim'

>> 2021-08-30 18:01:22 toor at f2 ~
>> # kldload openzfs
>> kldload: an error occurred while loading module openzfs. Please check 
>> dmesg(8) for more details.
>>
>> 2021-08-30 18:02:10 toor at f2 ~
>> # dmesg | tail -n 2
>> interface zfsctrl.1 already present in the KLD 'zfs.ko'!
>> linker_load_file: /boot/modules/openzfs.ko - unsupported file type

> % pkg query %M openzfs openzfs-kmod
> 
> 
> %
> 
> – strange; openzfs-kmod should probably have a package message.

I also get no output:

2021-08-30 23:40:44 toor at f2 ~
# pkg query %M openzfs openzfs-kmod



But the packages are there:

2021-08-30 23:42:17 toor at f2 ~
# pkg query %n openzfs openzfs-kmod
openzfs
openzfs-kmod



> /boot/loader.conf can be edited to include:
> 
> zfs_load="NO"
> openzfs_load="YES"


2021-08-30 23:42:35 toor at f2 ~
# grep -i zfs /boot/loader.conf
vfs.root.mountfrom="zfs:f2_zroot/ROOT/default"
zpool_cache_type="/boot/zfs/zpool.cache"
zpool_cache_name="/boot/zfs/zpool.cache"
zfs_load="YES"


> – HOWEVER I recommend creating then activating a new boot environment 
> before doing so (and before any future update to 12.0-RELEASE). Given 
> the possibility of the pre-packaged kernel module not working, be 
> prepared to build and install from ports.


I do packages.


> (If the module will not load, you'll be unable to boot. If this happens, 
> you can boot a good environment then use `bectl mount` to temporarily 
> access the affected environment, then revert the two lines in its 
> loader.conf.)
> 
> If the pool will require an upgrade, for what you'd like to do with 
> TRIM, be extremely cautious about upgrading a FreeBSD 12 boot pool.


I wanted to do a trim before taking an image, to reduce the image size. 
  I guess I'll just throw hard drives are the problem for now.


Thank you for your suggestions.  :-)


David


More information about the freebsd-questions mailing list