FreeBSD 12.2-RELEASE-p9 trim: open failed: /dev/ada0: Operation not permitted

Derek (freebsd lists) 482254ac at razorfever.net
Fri Sep 3 17:09:37 UTC 2021


On 2021-08-29 10:26 p.m., David Christensen wrote:
> I would like to trim the SSD, but trim(8) is not happy:
> 
> 2021-08-29 19:22:36 toor at f1 ~
> # trim -f /dev/ada0
> trim /dev/ada0 offset 0 length 60022480896
> trim: open failed: /dev/ada0: Operation not permitted
> 

I don't know if it's still relevant to the thread, but I feel like what 
you are encountering here relates to what you are trying to trim.

It feels like if you trim the "raw device", the system wouldn't know 
what is in use, and what isn't.

I feel like you should be trying to trim a filesystem on the device, 
rather than the device itself, as the utility would be able to determine 
what is currently allocated with the filesystem data.

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.

Something to look at?

Derek


More information about the freebsd-questions mailing list