# 20.7.创建和使用软盘

本节解释了如何在 FreeBSD 中格式化 3.5 英寸软盘。

**过程：格式化软盘的步骤**

软盘在使用之前需要进行低级格式化。通常这是由厂商完成的，但格式化是检查介质完整性的好方法。在 FreeBSD 上进行低级格式化时，可以使用 [fdformat(1)](https://man.freebsd.org/cgi/man.cgi?query=fdformat\&sektion=1\&format=html)。使用该工具时，请注意任何错误信息，这些信息有助于判断软盘是否良好。

1. 将一张新的 3.5 英寸软盘插入首个软盘驱动器，然后执行以下命令进行格式化：

   ```sh
   # /usr/sbin/fdformat -f 1440 /dev/fd0
   ```
2. 在低级格式化软盘后，创建磁盘标签，因为系统需要该标签来确定磁盘的大小和几何结构。支持的几何结构值列在 **/etc/disktab** 中。要写入磁盘标签，使用 [bsdlabel(8)](https://man.freebsd.org/cgi/man.cgi?query=bsdlabel\&sektion=8\&format=html)：

   ```sh
   # /sbin/bsdlabel -B -w /dev/fd0 fd1440
   ```
3. 现在可以对软盘进行高级格式化，格式化时可以选择 UFS 或 FAT 文件系统，通常 FAT 是软盘的更好选择。\
   使用 FAT 格式化软盘，执行以下命令：

   ```sh
   # /sbin/newfs_msdos /dev/fd0
   ```

此时，软盘已经可以使用了。要使用软盘，请通过 [mount\_msdosfs(8)](https://man.freebsd.org/cgi/man.cgi?query=mount_msdosfs\&sektion=8\&format=html) 挂载它。还可以从 Ports 中安装并使用 [emulators/mtools](https://cgit.freebsd.org/ports/tree/emulators/mtools/)。


---

# Agent Instructions: 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:

```
GET https://handbook.bsdcn.org/di-20-zhang-cun-chu/20.7.-chuang-jian-he-shi-yong-ruan-pan.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
