> 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/man/man5/disktab.5.md).

# disktab.5

`disktab` — 磁盘描述文件

## 名称

`disktab`

## 概要

`#include <disklabel.h>`

## 描述

`Disktab` 是一个简单的数据库，描述磁盘几何结构和磁盘分区特性。它用于初始化磁盘上的磁盘标签。其格式仿照 termcap(5) 终端数据库设计。`Disktab` 中的条目由多个以 `:` 分隔的字段组成。每个条目的第一个字段给出该磁盘条目可被选择的若干名称，名称之间以 `|` 字符分隔。给出的最后一个名称应是完整标识该磁盘的长名称。

每个条目的可选字段如下：

| ID       | 类型   | 描述                               |
| -------- | ---- | -------------------------------- |
| `ty`     | str  | 磁盘类型（如 removable、winchester）     |
| `dt`     | str  | 控制器类型（如 SMD、ESDI、floppy）         |
| `ns`     | num  | 每磁道的扇区数                          |
| `nt`     | num  | 每柱面的磁道数                          |
| `nc`     | num  | 磁盘上柱面总数                          |
| `sc`     | num  | 每柱面的扇区数，默认为 ns\*nt               |
| `su`     | num  | 每单元的扇区数，默认为 sc\*nc               |
| `se`     | num  | 扇区大小（字节），默认为 `DEV_BSIZE`         |
| `sf`     | bool | 控制器支持 bad144 风格的坏扇区转发            |
| `rm`     | num  | 转速（rpm），默认 3600                  |
| `sk`     | num  | 每磁道扇区偏斜，默认 0                     |
| `cs`     | num  | 每柱面扇区偏斜，默认 0                     |
| `hs`     | num  | 磁头切换时间（微秒），默认 0                  |
| `ts`     | num  | 单柱面寻道时间（微秒），默认 0                 |
| `il`     | num  | 扇区交错比（n:1），默认 1                  |
| `d[0-4]` | num  | 依赖驱动器类型的参数                       |
| `bs`     | num  | 引导块大小，默认 `BBSIZE`                |
| `sb`     | num  | 超级块大小，默认 0                       |
| `ba`     | num  | 分区 `a` 的块大小（字节）                  |
| `bd`     | num  | 分区 `d` 的块大小（字节）                  |
| `be`     | num  | 分区 `e` 的块大小（字节）                  |
| `bf`     | num  | 分区 `f` 的块大小（字节）                  |
| `bg`     | num  | 分区 `g` 的块大小（字节）                  |
| `bh`     | num  | 分区 `h` 的块大小（字节）                  |
| `fa`     | num  | 分区 `a` 的片段大小（字节）                 |
| `fd`     | num  | 分区 `d` 的片段大小（字节）                 |
| `fe`     | num  | 分区 `e` 的片段大小（字节）                 |
| `ff`     | num  | 分区 `f` 的片段大小（字节）                 |
| `fg`     | num  | 分区 `g` 的片段大小（字节）                 |
| `fh`     | num  | 分区 `h` 的片段大小（字节）                 |
| `oa`     | num  | 分区 `a` 的偏移量（扇区）                  |
| `ob`     | num  | 分区 `b` 的偏移量（扇区）                  |
| `oc`     | num  | 分区 `c` 的偏移量（扇区）                  |
| `od`     | num  | 分区 `d` 的偏移量（扇区）                  |
| `oe`     | num  | 分区 `e` 的偏移量（扇区）                  |
| `of`     | num  | 分区 `f` 的偏移量（扇区）                  |
| `og`     | num  | 分区 `g` 的偏移量（扇区）                  |
| `oh`     | num  | 分区 `h` 的偏移量（扇区）                  |
| `pa`     | num  | 分区 `a` 的大小（扇区）                   |
| `pb`     | num  | 分区 `b` 的大小（扇区）                   |
| `pc`     | num  | 分区 `c` 的大小（扇区）                   |
| `pd`     | num  | 分区 `d` 的大小（扇区）                   |
| `pe`     | num  | 分区 `e` 的大小（扇区）                   |
| `pf`     | num  | 分区 `f` 的大小（扇区）                   |
| `pg`     | num  | 分区 `g` 的大小（扇区）                   |
| `ph`     | num  | 分区 `h` 的大小（扇区）                   |
| `ta`     | str  | 分区 `a` 的分区类型（4.2BSD 文件系统、swap 等） |
| `tb`     | str  | 分区 `b` 的分区类型                     |
| `tc`     | str  | 分区 `c` 的分区类型                     |
| `td`     | str  | 分区 `d` 的分区类型                     |
| `te`     | str  | 分区 `e` 的分区类型                     |
| `tf`     | str  | 分区 `f` 的分区类型                     |
| `tg`     | str  | 分区 `g` 的分区类型                     |
| `th`     | str  | 分区 `h` 的分区类型                     |

## 文件

**`/etc/disktab`**

## 参见

getdiskbyname(3), bsdlabel(8), newfs(8)

## 历史

`Disktab` 描述文件出现于 4.2BSD。


---

# 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://book.bsdcn.org/man/man5/disktab.5.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
