Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 30 Aug 2021 18:06:24 -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:  <ddb8e2ba-e8ee-8012-166d-e17b31e65e09@holgerdanske.com>
In-Reply-To: <5a1ae42f-d0f7-beb9-fb21-a83e7e8fe06d@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>

next in thread | previous in thread | raw e-mail | index | archive | help
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.
>>
>>
>>> If so: with or without OpenZFS kernel module?
>>
>>
>> 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
>>
>> …
> 
> 
> Thanks. Simply installing sysutils/openzfs will get you a relevant 
> manual page:
> 
> man 8 zpool-trim
> 
> – and `zpool trim` (alone) will run (tested in VirtualBox), however: 
> _without_ an OpenZFS-enabled boot, I'd be wary of specifying a pool to 
> be trimmed. Here be dragons?


Thank you for the response.  :-)


I installed the package "openzfs":

2021-08-30 17:54:40 toor@f2 ~
# pkg install -y openzfs
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.
The following 2 package(s) will be affected (of 0 checked):

New packages to be INSTALLED:
	openzfs: 2021062100
	openzfs-kmod: 2021062100

Number of packages to be installed: 2

The process will require 22 MiB more space.
4 MiB to be downloaded.
[1/2] Fetching openzfs-2021062100.txz: 100%    3 MiB 365.1kB/s    00:08
[2/2] Fetching openzfs-kmod-2021062100.txz: 100%    1 MiB   1.2MB/s 
00:01
Checking integrity... done (0 conflicting)
[1/2] Installing openzfs-kmod-2021062100...
[1/2] Extracting openzfs-kmod-2021062100: 100%
[2/2] Installing openzfs-2021062100...
[2/2] Extracting openzfs-2021062100: 100%


The man page is there:

2021-08-30 18:00:33 toor@f2 ~
# man zpool-trim | head -n 7
ZPOOL-TRIM(8)           FreeBSD System Manager's Manual 
ZPOOL-TRIM(8)

NAME
      zpool-trim - initiate TRIM of free space in ZFS storage pool

SYNOPSIS
      zpool trim [-dw] [-r rate] [-c|-s] pool [device]<?>


When I try to trim a pool that is on an SSD:

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


When I try to load the kernel module:

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


zpool-trim(8) mentions an "autotrim" property, but my pool does not seem 
to have it:

2021-08-30 18:03:14 toor@f2 ~
# zpool get all bootpool | grep -i trim


Suggestions?


David



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?ddb8e2ba-e8ee-8012-166d-e17b31e65e09>