Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 30 Aug 2021 23:46:54 -0700
From:      David Christensen <dpchrist@holgerdanske.com>
To:        freebsd-questions@freebsd.org
Subject:   Re: FreeBSD 12.2-RELEASE-p9 trim (ZFS, not OpenZFS): open failed: /dev/ada0: Operation not permitted
Message-ID:  <3d4df331-9795-fd58-d246-3793b0b8690d@holgerdanske.com>
In-Reply-To: <6832fcb4-42d1-efc9-e2cb-7e2df606d8ce@gmail.com>
References:  <dda0a570-53bc-7676-9f38-67bcd7a6f8bb@holgerdanske.com> <b0cb474d-a4e8-5228-b4da-a267ac1a2124@holgerdanske.com> <fe31dae4-571b-a7a7-b857-68cd515fbe74@gmail.com> <a0a0afde-d0b5-78b8-5489-44ed6b3a2e39@holgerdanske.com> <5a1ae42f-d0f7-beb9-fb21-a83e7e8fe06d@gmail.com> <ddb8e2ba-e8ee-8012-166d-e17b31e65e09@holgerdanske.com> <6832fcb4-42d1-efc9-e2cb-7e2df606d8ce@gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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@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@f2 ~
>> # zpool trim bootpool 2>&1 | head -n 1
>> unrecognized command 'trim'

>> 2021-08-30 18:01:22 toor@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@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@f2 ~
# pkg query %M openzfs openzfs-kmod



But the packages are there:

2021-08-30 23:42:17 toor@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@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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3d4df331-9795-fd58-d246-3793b0b8690d>