Date: Fri, 3 Sep 2021 16:49:02 -0400 From: Kurt Hackenberg <kh@panix.com> To: freebsd-questions@freebsd.org Subject: Re: FreeBSD 12.2-RELEASE-p9 trim: open failed: /dev/ada0: Operation not permitted Message-ID: <4019d92e-c33d-6ba1-dc80-7e28ccc44802@panix.com> In-Reply-To: <64099455-5526-beb5-8ead-6ce8a9d073e6@holgerdanske.com> References: <dda0a570-53bc-7676-9f38-67bcd7a6f8bb@holgerdanske.com> <47d0f250-a47c-bbe0-2875-4f42f4464fcc@chezmarcotte.ca> <64099455-5526-beb5-8ead-6ce8a9d073e6@holgerdanske.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On 2021/09/03 16:30, David Christensen wrote: >> It might be that a raw device could be trimmed, but perhaps there's >> some safety there to stop it from wiping a device that is backing a >> mounted filesystem. ... > That is a good point -- the filesystem knows what blocks are in use, > what blocks are not in use, and when blocks are removed from use. > Somehow, trim(8) gets this information (from the kernel filesystem stack?). > > > RTFM trim(8): Do I understand correctly that you want to set a state, so that the filesystem, ongoing, erases a block when it frees the block? According to that man page, the trim command does something different: it erases blocks immediately, unconditionally, regardless of whether they're in use. The man page says: "The trim utility erases specified region of the device." "The whole device is erased by default..." If you're using ZFS, perhaps you should look for a way to configure the ZFS filesystem to erase on free.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4019d92e-c33d-6ba1-dc80-7e28ccc44802>