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 https://opensource.org/licenses/CDDL-1.0. 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.\" Copyright (c) 2009 Sun Microsystems, Inc. All Rights Reserved. 22.\" Copyright 2011 Joshua M. Clulow <josh@sysmgr.org> 23.\" Copyright (c) 2011, 2019 by Delphix. All rights reserved. 24.\" Copyright (c) 2013 by Saso Kiselkov. All rights reserved. 25.\" Copyright (c) 2014, Joyent, Inc. All rights reserved. 26.\" Copyright (c) 2014 by Adam Stevko. All rights reserved. 27.\" Copyright (c) 2014 Integros [integros.com] 28.\" Copyright 2019 Richard Laager. All rights reserved. 29.\" Copyright 2018 Nexenta Systems, Inc. 30.\" Copyright 2019 Joyent, Inc. 31.\" 32.Dd June 30, 2019 33.Dt ZFS-HOLD 8 34.Os 35. 36.Sh NAME 37.Nm zfs-hold 38.Nd hold ZFS snapshots to prevent their removal 39.Sh SYNOPSIS 40.Nm zfs 41.Cm hold 42.Op Fl r 43.Ar tag Ar snapshot Ns … 44.Nm zfs 45.Cm holds 46.Op Fl rH 47.Ar snapshot Ns … 48.Nm zfs 49.Cm release 50.Op Fl r 51.Ar tag Ar snapshot Ns … 52. 53.Sh DESCRIPTION 54.Bl -tag -width "" 55.It Xo 56.Nm zfs 57.Cm hold 58.Op Fl r 59.Ar tag Ar snapshot Ns … 60.Xc 61Adds a single reference, named with the 62.Ar tag 63argument, to the specified snapshots. 64Each snapshot has its own tag namespace, and tags must be unique within that 65space. 66.Pp 67If a hold exists on a snapshot, attempts to destroy that snapshot by using the 68.Nm zfs Cm destroy 69command return 70.Sy EBUSY . 71.Bl -tag -width "-r" 72.It Fl r 73Specifies that a hold with the given tag is applied recursively to the snapshots 74of all descendent file systems. 75.El 76.It Xo 77.Nm zfs 78.Cm holds 79.Op Fl rH 80.Ar snapshot Ns … 81.Xc 82Lists all existing user references for the given snapshot or snapshots. 83.Bl -tag -width "-r" 84.It Fl r 85Lists the holds that are set on the named descendent snapshots, in addition to 86listing the holds on the named snapshot. 87.It Fl H 88Do not print headers, use tab-delimited output. 89.El 90.It Xo 91.Nm zfs 92.Cm release 93.Op Fl r 94.Ar tag Ar snapshot Ns … 95.Xc 96Removes a single reference, named with the 97.Ar tag 98argument, from the specified snapshot or snapshots. 99The tag must already exist for each snapshot. 100If a hold exists on a snapshot, attempts to destroy that snapshot by using the 101.Nm zfs Cm destroy 102command return 103.Sy EBUSY . 104.Bl -tag -width "-r" 105.It Fl r 106Recursively releases a hold with the given tag on the snapshots of all 107descendent file systems. 108.El 109.El 110. 111.Sh SEE ALSO 112.Xr zfs-destroy 8 113