freebsd-src/man/man8/zfs-destroy.8
Ross Williams 870fc32fc9 Reorganize zfs(8) man page into sections
Most subcommands got their own manpages (e.g. create). Some related
commands grouped into a single manpage and symlinks created (e.g. set, 
get, and inherit). I did this when topics were either too short to 
warrant their own file or so interrelated that a user would want to
refer between commands in the same file.

Corrected .Sx internal references to .Xr cross refs; lots of .Sx 
references from when text was all in zfs.8 needed to be changed to 
.Xr zfs-$SUBCOMMAND 8 cross references.

Divided subcommand list in zfs(8) into sections of related 
functionality. This required writing new descriptions for some 
commands.

Preserved ".Os Linux", `.Os` macro parsing behavior differs between 
mandoc from the "BSD" mandoc package (available on Ubuntu) and man 
from Ubuntu's man-db package, which calls groff to format the manpages.

Groff handles the `.Os` macro differently and wrongly, defaulting 
it to "BSD" in `/usr/share/groff/*/tmac/mdoc/doc-common`, instead of
getting the default from `uname`.

A future set of changes will introduce build-time preprocessing of
manpages for platform-specific documentation and can insert the
correct operating system name.

Added SEE ALSO sections, the newly-divided zfs-*.8 subcommand man
pages needed their own SEE ALSO sections pointing to related
subcommands and, in some cases, documentation from other packages
(e.g. zfs-share.8).

Reviewed-by: Matt Ahrens <matt@delphix.com>
Reviewed-by: Kjeld Schouten <kjeld@schouten-lebbing.nl>
Reviewed-by: Sean Eric Fagan <sef@ixsystems.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ross Williams <ross@ross-williams.net>
Closes #9559
2019-11-12 11:17:40 -08:00

179 lines
5.2 KiB
Groff

.\"
.\" CDDL HEADER START
.\"
.\" The contents of this file are subject to the terms of the
.\" Common Development and Distribution License (the "License").
.\" You may not use this file except in compliance with the License.
.\"
.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
.\" or http://www.opensolaris.org/os/licensing.
.\" See the License for the specific language governing permissions
.\" and limitations under the License.
.\"
.\" When distributing Covered Code, include this CDDL HEADER in each
.\" file and include the License file at usr/src/OPENSOLARIS.LICENSE.
.\" If applicable, add the following below this CDDL HEADER, with the
.\" fields enclosed by brackets "[]" replaced with your own identifying
.\" information: Portions Copyright [yyyy] [name of copyright owner]
.\"
.\" CDDL HEADER END
.\"
.\"
.\" Copyright (c) 2009 Sun Microsystems, Inc. All Rights Reserved.
.\" Copyright 2011 Joshua M. Clulow <josh@sysmgr.org>
.\" Copyright (c) 2011, 2019 by Delphix. All rights reserved.
.\" Copyright (c) 2013 by Saso Kiselkov. All rights reserved.
.\" Copyright (c) 2014, Joyent, Inc. All rights reserved.
.\" Copyright (c) 2014 by Adam Stevko. All rights reserved.
.\" Copyright (c) 2014 Integros [integros.com]
.\" Copyright 2019 Richard Laager. All rights reserved.
.\" Copyright 2018 Nexenta Systems, Inc.
.\" Copyright 2019 Joyent, Inc.
.\"
.Dd June 30, 2019
.Dt ZFS-DESTROY 8
.Os Linux
.Sh NAME
.Nm zfs Ns Pf - Cm destroy
.Nd Destroys the given dataset(s), snapshot(s), or bookmark.
.Sh SYNOPSIS
.Nm
.Cm destroy
.Op Fl Rfnprv
.Ar filesystem Ns | Ns Ar volume
.Nm
.Cm destroy
.Op Fl Rdnprv
.Ar filesystem Ns | Ns Ar volume Ns @ Ns Ar snap Ns
.Oo % Ns Ar snap Ns Oo , Ns Ar snap Ns Oo % Ns Ar snap Oc Oc Oc Ns ...
.Nm
.Cm destroy
.Ar filesystem Ns | Ns Ar volume Ns # Ns Ar bookmark
.Sh DESCRIPTION
.Bl -tag -width ""
.It Xo
.Nm
.Cm destroy
.Op Fl Rfnprv
.Ar filesystem Ns | Ns Ar volume
.Xc
Destroys the given dataset.
By default, the command unshares any file systems that are currently shared,
unmounts any file systems that are currently mounted, and refuses to destroy a
dataset that has active dependents
.Pq children or clones .
.Bl -tag -width "-R"
.It Fl R
Recursively destroy all dependents, including cloned file systems outside the
target hierarchy.
.It Fl f
Force an unmount of any file systems using the
.Nm unmount Fl f
command.
This option has no effect on non-file systems or unmounted file systems.
.It Fl n
Do a dry-run
.Pq Qq No-op
deletion.
No data will be deleted.
This is useful in conjunction with the
.Fl v
or
.Fl p
flags to determine what data would be deleted.
.It Fl p
Print machine-parsable verbose information about the deleted data.
.It Fl r
Recursively destroy all children.
.It Fl v
Print verbose information about the deleted data.
.El
.Pp
Extreme care should be taken when applying either the
.Fl r
or the
.Fl R
options, as they can destroy large portions of a pool and cause unexpected
behavior for mounted file systems in use.
.It Xo
.Nm
.Cm destroy
.Op Fl Rdnprv
.Ar filesystem Ns | Ns Ar volume Ns @ Ns Ar snap Ns
.Oo % Ns Ar snap Ns Oo , Ns Ar snap Ns Oo % Ns Ar snap Oc Oc Oc Ns ...
.Xc
The given snapshots are destroyed immediately if and only if the
.Ql zfs destroy
command without the
.Fl d
option would have destroyed it.
Such immediate destruction would occur, for example, if the snapshot had no
clones and the user-initiated reference count were zero.
.Pp
If a snapshot does not qualify for immediate destruction, it is marked for
deferred deletion.
In this state, it exists as a usable, visible snapshot until both of the
preconditions listed above are met, at which point it is destroyed.
.Pp
An inclusive range of snapshots may be specified by separating the first and
last snapshots with a percent sign.
The first and/or last snapshots may be left blank, in which case the
filesystem's oldest or newest snapshot will be implied.
.Pp
Multiple snapshots
.Pq or ranges of snapshots
of the same filesystem or volume may be specified in a comma-separated list of
snapshots.
Only the snapshot's short name
.Po the part after the
.Sy @
.Pc
should be specified when using a range or comma-separated list to identify
multiple snapshots.
.Bl -tag -width "-R"
.It Fl R
Recursively destroy all clones of these snapshots, including the clones,
snapshots, and children.
If this flag is specified, the
.Fl d
flag will have no effect.
.It Fl d
Destroy immediately. If a snapshot cannot be destroyed now, mark it for
deferred destruction.
.It Fl n
Do a dry-run
.Pq Qq No-op
deletion.
No data will be deleted.
This is useful in conjunction with the
.Fl p
or
.Fl v
flags to determine what data would be deleted.
.It Fl p
Print machine-parsable verbose information about the deleted data.
.It Fl r
Destroy
.Pq or mark for deferred deletion
all snapshots with this name in descendent file systems.
.It Fl v
Print verbose information about the deleted data.
.Pp
Extreme care should be taken when applying either the
.Fl r
or the
.Fl R
options, as they can destroy large portions of a pool and cause unexpected
behavior for mounted file systems in use.
.El
.It Xo
.Nm
.Cm destroy
.Ar filesystem Ns | Ns Ar volume Ns # Ns Ar bookmark
.Xc
The given bookmark is destroyed.
.El
.Sh SEE ALSO
.Xr zfs-create 8 ,
.Xr zfs-hold 8