1.\" SPDX-License-Identifier: CDDL-1.0 2.\" 3.\" CDDL HEADER START 4.\" 5.\" The contents of this file are subject to the terms of the 6.\" Common Development and Distribution License (the "License"). 7.\" You may not use this file except in compliance with the License. 8.\" 9.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 10.\" or https://opensource.org/licenses/CDDL-1.0. 11.\" See the License for the specific language governing permissions 12.\" and limitations under the License. 13.\" 14.\" When distributing Covered Code, include this CDDL HEADER in each 15.\" file and include the License file at usr/src/OPENSOLARIS.LICENSE. 16.\" If applicable, add the following below this CDDL HEADER, with the 17.\" fields enclosed by brackets "[]" replaced with your own identifying 18.\" information: Portions Copyright [yyyy] [name of copyright owner] 19.\" 20.\" CDDL HEADER END 21.\" 22.\" Copyright (c) 2009 Sun Microsystems, Inc. All Rights Reserved. 23.\" Copyright 2011 Joshua M. Clulow <josh@sysmgr.org> 24.\" Copyright (c) 2011, 2019 by Delphix. All rights reserved. 25.\" Copyright (c) 2013 by Saso Kiselkov. All rights reserved. 26.\" Copyright (c) 2014, Joyent, Inc. All rights reserved. 27.\" Copyright (c) 2014 by Adam Stevko. All rights reserved. 28.\" Copyright (c) 2014 Integros [integros.com] 29.\" Copyright 2019 Richard Laager. All rights reserved. 30.\" Copyright 2018 Nexenta Systems, Inc. 31.\" Copyright 2019 Joyent, Inc. 32.\" 33.Dd June 30, 2019 34.Dt ZFS-HOLD 8 35.Os 36. 37.Sh NAME 38.Nm zfs-hold 39.Nd hold ZFS snapshots to prevent their removal 40.Sh SYNOPSIS 41.Nm zfs 42.Cm hold 43.Op Fl r 44.Ar tag Ar snapshot Ns … 45.Nm zfs 46.Cm holds 47.Op Fl rHp 48.Ar snapshot Ns … 49.Nm zfs 50.Cm release 51.Op Fl r 52.Ar tag Ar snapshot Ns … 53. 54.Sh DESCRIPTION 55.Bl -tag -width "" 56.It Xo 57.Nm zfs 58.Cm hold 59.Op Fl r 60.Ar tag Ar snapshot Ns … 61.Xc 62Adds a single reference, named with the 63.Ar tag 64argument, to the specified snapshots. 65Each snapshot has its own tag namespace, and tags must be unique within that 66space. 67.Pp 68If a hold exists on a snapshot, attempts to destroy that snapshot by using the 69.Nm zfs Cm destroy 70command return 71.Sy EBUSY . 72.Bl -tag -width "-r" 73.It Fl r 74Specifies that a hold with the given tag is applied recursively to the snapshots 75of all descendent file systems. 76.El 77.It Xo 78.Nm zfs 79.Cm holds 80.Op Fl rHp 81.Ar snapshot Ns … 82.Xc 83Lists all existing user references for the given snapshot or snapshots. 84.Bl -tag -width "-r" 85.It Fl r 86Lists the holds that are set on the named descendent snapshots, in addition to 87listing the holds on the named snapshot. 88.It Fl H 89Do not print headers, use tab-delimited output. 90.It Fl p 91Prints holds timestamps as Unix epoch timestamps. 92.El 93.It Xo 94.Nm zfs 95.Cm release 96.Op Fl r 97.Ar tag Ar snapshot Ns … 98.Xc 99Removes a single reference, named with the 100.Ar tag 101argument, from the specified snapshot or snapshots. 102The tag must already exist for each snapshot. 103If a hold exists on a snapshot, attempts to destroy that snapshot by using the 104.Nm zfs Cm destroy 105command return 106.Sy EBUSY . 107.Bl -tag -width "-r" 108.It Fl r 109Recursively releases a hold with the given tag on the snapshots of all 110descendent file systems. 111.El 112.El 113. 114.Sh SEE ALSO 115.Xr zfs-destroy 8 116