Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 30 Aug 2021 00:45:41 -0700
From:      David Christensen <dpchrist@holgerdanske.com>
To:        freebsd-questions@freebsd.org
Subject:   Re: FreeBSD 12.2-RELEASE-p9 trim: open failed: /dev/ada0: Operation not permitted
Message-ID:  <a0a0afde-d0b5-78b8-5489-44ed6b3a2e39@holgerdanske.com>
In-Reply-To: <fe31dae4-571b-a7a7-b857-68cd515fbe74@gmail.com>
References:  <dda0a570-53bc-7676-9f38-67bcd7a6f8bb@holgerdanske.com> <b0cb474d-a4e8-5228-b4da-a267ac1a2124@holgerdanske.com> <fe31dae4-571b-a7a7-b857-68cd515fbe74@gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On 8/29/21 10:08 PM, Graham Perrin wrote:
> On 30/08/2021 04:54, David Christensen wrote:
>> On 8/29/21 7:26 PM, David Christensen wrote:
>>> freebsd-questions:
>>>
>>> I have a computer with FreeBSD:
>>>
>>> 2021-08-29 19:14:07 toor@f1 ~
>>> # freebsd-version ; uname -a
>>> 12.2-RELEASE-p9
>>> FreeBSD f1.tracy.holgerdanske.com 12.2-RELEASE-p7 FreeBSD 
>>> 12.2-RELEASE-p7 GENERIC  amd64
>>>
>>>
>>> The system disk is an SSD:
>>>
>>> 2021-08-29 19:18:53 toor@f1 ~
>>> # camcontrol devlist | grep ada0
>>> <INTEL SSDSC2CW060A3 400i>         at scbus0 target 0 lun 0 (ada0,pass0)
>>>
>>>
>>> I would like to trim the SSD, but trim(8) is not happy:
>>>
>>> 2021-08-29 19:22:36 toor@f1 ~
>>> # trim -f /dev/ada0
>>> trim /dev/ada0 offset 0 length 60022480896
>>> trim: open failed: /dev/ada0: Operation not permitted
>>>
>>>
>>> Suggestions?
>>>
>>>
>>> David
>>
>>
>> STFW I found:
>>
>> https://forums.freebsd.org/threads/freebsd-10-trim-for-zfs.44803/
>>
>>
>> Checking my system:
>>
>> 2021-08-29 20:51:20 toor@f3 ~
>> # camcontrol identify ada0 | grep -i trim
>> Data Set Management (DSM/TRIM) yes
>>
>>
>> So, SSD trim is enabled (?).
> 
> Given your link to the ZFS-related post, I assume that you use ZFS on 
> the device.


Thank you for the reply.  :-)


Yes.  The system was 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


> <https://forums.FreeBSD.org/threads/79169/post-529408>; I see that with 
> FreeBSD 14.0-CURRENT, this occurs:
> 
> trim: open failed: /dev/da7: Operation not permitted
> 
> – when, for example, a partition within the device is a cache vdev for a 
> pool.


Okay.


David



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?a0a0afde-d0b5-78b8-5489-44ed6b3a2e39>