I have occasionally wanted to erase all or part of an SSD device to recover performance after heavy random write activity. It can sort-of be done with either newfs -E or creating+deleting a zfs pool on the area to erase, but both write a varying amount of data after they send their BIO_DELETE calls, and there should be a cleaner way to do it. Attached is a patch that adds a "trim" verb to the gpart command, which opens the raw device and calls g_delete on it. Feel free to pick a new name if you can think of a better one. I know that "trim" refers only to the SATA implementation, but "delete" is already taken, "erase" implies unconditional erasure which is not true for devices that ignore BIO_DELETE calls, and most people that want the functionality refer to it as TRIM anyway.
Oops. Small typo in the man page: "this may may fill its blocks" should be "this may fill its blocks"
Responsible Changed From-To: freebsd-bugs->freebsd-geom Over to maintainer(s).
Responsible Changed From-To: freebsd-geom->smh I'll take it.
Responsible Changed From-To: smh->bdrewery I'll take it.
For bugs matching the following criteria: Status: In Progress Changed: (is less than) 2014-06-01 Reset to default assignee and clear in-progress tags. Mail being skipped
A separate dedicated 'trim' command has been added to FreeBSD 12.1 https://www.freebsd.org/cgi/man.cgi?query=trim&sektion=8