> For the complete documentation index, see [llms.txt](https://book.bsdcn.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://book.bsdcn.org/zfs/shou-ce-ye/xi-tong-guan-li-ming-ling-system-administration-8/zfs-hold.8.md).

# zfs-hold(8)

## 名称

`zfs-hold` — 保留 ZFS 快照，防止其被移除

`zfs-release(8)` 是 `zfs-hold(8)` 的历史别名。

## 概述

```sh
zfs hold [-r] 标签 快照…
```

```sh
zfs holds [-rHp] 快照…
```

```sh
zfs release [-r] 标签 快照…
```

## 说明

### `zfs hold [-r] tag snapshot …`

为指定的快照添加一个用户保留，其名称由 `tag` 参数指定。每个快照都有各自的标签命名空间，标签在该命名空间内必须唯一。

如果快照上存在保留，使用 `zfs destroy` 命令尝试销毁该快照时会返回 `EBUSY`。

#### `-r`

指定带有给定标签的保留会递归应用到所有后代文件系统的快照。

### `zfs holds [-rHp] snapshot …`

列出指定快照的所有现有用户保留。

#### `-r`

除列出指定快照上的保留外，还列出其后代快照上设置的保留。

#### `-H`

不打印表头，输出以制表符分隔。

#### `-p`

以 Unix 纪元时间戳的形式打印保留时间戳。

### `zfs release [-r] tag snapshot …`

从指定的快照中移除一个用户保留，其名称由 `tag` 参数指定。每个快照上都必须存在该标签。

如果快照上存在保留，使用 `zfs destroy` 命令尝试销毁该快照时会返回 `EBUSY`。

#### `-r`

递归释放所有后代文件系统快照上带有给定标签的保留。

## 参考文献

zfs-destroy(8)

2022 年 11 月 8 日


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://book.bsdcn.org/zfs/shou-ce-ye/xi-tong-guan-li-ming-ling-system-administration-8/zfs-hold.8.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
