> 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/an-zhuang-zhi-yin/alpine-linux/index.md).

# 在 Alpine Linux 中启用 ZFS 支持

## 安装

> **注意**
>
> 这是在既有的 Alpine 系统上安装 ZFS。要将 ZFS 用作根（`/`）文件系统，请参阅《[构建以 ZFS 为根文件系统的 Alpine Linux](https://book.bsdcn.org/zfs/an-zhuang-zhi-yin/alpine-linux/rootonzfs.md)》。

1. 安装 ZFS 包：

   ```sh
   apk add zfs zfs-lts
   ```
2. 加载内核模块：

   ```sh
   modprobe zfs
   ```

## zpool 自动导入与挂载

为避免系统启动后还需手动导入并挂载 ZFS 存储池，请务必启用相关服务。

1. 在启动时导入存储池：

   ```sh
   rc-update add zfs-import default
   ```
2. 在启动时挂载存储池：

   ```sh
   rc-update add zfs-mount default
   ```


---

# 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/an-zhuang-zhi-yin/alpine-linux/index.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.
