xref: /freebsd/sys/contrib/openzfs/man/man8/zpool-trim.8 (revision eda14cbc264d6969b02f2b1994cef11148e914f1)
1.\"
2.\" CDDL HEADER START
3.\"
4.\" The contents of this file are subject to the terms of the
5.\" Common Development and Distribution License (the "License").
6.\" You may not use this file except in compliance with the License.
7.\"
8.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9.\" or http://www.opensolaris.org/os/licensing.
10.\" See the License for the specific language governing permissions
11.\" and limitations under the License.
12.\"
13.\" When distributing Covered Code, include this CDDL HEADER in each
14.\" file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15.\" If applicable, add the following below this CDDL HEADER, with the
16.\" fields enclosed by brackets "[]" replaced with your own identifying
17.\" information: Portions Copyright [yyyy] [name of copyright owner]
18.\"
19.\" CDDL HEADER END
20.\"
21.\"
22.\" Copyright (c) 2007, Sun Microsystems, Inc. All Rights Reserved.
23.\" Copyright (c) 2012, 2018 by Delphix. All rights reserved.
24.\" Copyright (c) 2012 Cyril Plisko. All Rights Reserved.
25.\" Copyright (c) 2017 Datto Inc.
26.\" Copyright (c) 2018 George Melikov. All Rights Reserved.
27.\" Copyright 2017 Nexenta Systems, Inc.
28.\" Copyright (c) 2017 Open-E, Inc. All Rights Reserved.
29.\"
30.Dd February 25, 2020
31.Dt ZPOOL-TRIM 8
32.Os
33.Sh NAME
34.Nm zpool Ns Pf - Cm trim
35.Nd Initiate immediate TRIM operations for all free space in a ZFS storage pool
36.Sh SYNOPSIS
37.Nm
38.Cm trim
39.Op Fl dw
40.Op Fl r Ar rate
41.Op Fl c | Fl s
42.Ar pool
43.Op Ar device Ns ...
44.Sh DESCRIPTION
45.Bl -tag -width Ds
46.It Xo
47.Nm
48.Cm trim
49.Op Fl dw
50.Op Fl c | Fl s
51.Ar pool
52.Op Ar device Ns ...
53.Xc
54Initiates an immediate on-demand TRIM operation for all of the free space in
55a pool.  This operation informs the underlying storage devices of all blocks
56in the pool which are no longer allocated and allows thinly provisioned
57devices to reclaim the space.
58.Pp
59A manual on-demand TRIM operation can be initiated irrespective of the
60.Sy autotrim
61pool property setting.  See the documentation for the
62.Sy autotrim
63property above for the types of vdev devices which can be trimmed.
64.Bl -tag -width Ds
65.It Fl d -secure
66Causes a secure TRIM to be initiated.  When performing a secure TRIM, the
67device guarantees that data stored on the trimmed blocks has been erased.
68This requires support from the device and is not supported by all SSDs.
69.It Fl r -rate Ar rate
70Controls the rate at which the TRIM operation progresses.  Without this
71option TRIM is executed as quickly as possible. The rate, expressed in bytes
72per second, is applied on a per-vdev basis and may be set differently for
73each leaf vdev.
74.It Fl c, -cancel
75Cancel trimming on the specified devices, or all eligible devices if none
76are specified.
77If one or more target devices are invalid or are not currently being
78trimmed, the command will fail and no cancellation will occur on any device.
79.It Fl s -suspend
80Suspend trimming on the specified devices, or all eligible devices if none
81are specified.
82If one or more target devices are invalid or are not currently being
83trimmed, the command will fail and no suspension will occur on any device.
84Trimming can then be resumed by running
85.Nm zpool Cm trim
86with no flags on the relevant target devices.
87.It Fl w -wait
88Wait until the devices are done being trimmed before returning.
89.El
90.El
91.Sh SEE ALSO
92.Xr zpool-initialize 8 ,
93.Xr zpool-wait 8 ,
94.Xr zpoolprops 8
95