Bug 175943 - [PATCH] Add trim capability to gpart(8)
Summary: [PATCH] Add trim capability to gpart(8)
Status: Open
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: 9.1-STABLE
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-geom mailing list
Depends on:
Reported: 2013-02-07 23:30 UTC by Dan Nelson
Modified: 2018-12-01 08:19 UTC (History)
2 users (show)

See Also:

file.diff (2.00 KB, patch)
2013-02-07 23:30 UTC, Dan Nelson
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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 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 2013-06-18 14:40:50 UTC
Responsible Changed
From-To: freebsd-geom->smh

I'll take it.
Comment 4 Bryan Drewery freebsd_committer 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