Bug 175943

Summary: [PATCH] Add trim capability to gpart(8)
Product: Base System Reporter: Dan Nelson <dnelson>
Component: binAssignee: freebsd-geom (Nobody) <geom>
Status: Closed Overcome By Events    
Severity: Affects Only Me CC: allanjude, cem, sigsys
Priority: Normal    
Version: 9.1-STABLE   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
file.diff none

Description Dan Nelson 2013-02-07 23:30:00 UTC
	

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.
Comment 1 Dan Nelson 2013-02-07 23:36:32 UTC
Oops.  Small typo in the man page:

"this may may fill its blocks" should be "this may fill its blocks"
Comment 2 Andrey V. Elsukov freebsd_committer freebsd_triage 2013-06-18 14:29:58 UTC
Responsible Changed
From-To: freebsd-bugs->freebsd-geom

Over to maintainer(s).
Comment 3 Steven Hartland freebsd_committer freebsd_triage 2013-06-18 14:40:50 UTC
Responsible Changed
From-To: freebsd-geom->smh

I'll take it.
Comment 4 Bryan Drewery freebsd_committer freebsd_triage 2014-04-14 19:58:44 UTC
Responsible Changed
From-To: smh->bdrewery

I'll take it.
Comment 5 Eitan Adler freebsd_committer freebsd_triage 2017-12-31 08:01:15 UTC
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
Comment 6 Allan Jude freebsd_committer freebsd_triage 2020-07-16 17:37:55 UTC
A separate dedicated 'trim' command has been added to FreeBSD 12.1

https://www.freebsd.org/cgi/man.cgi?query=trim&sektion=8