# linux磁盘挂载

#### 进行挂载磁盘准备：

```
# 查看磁盘
fdisk -l
# 格式化磁盘 
mkfs.ext4 /dev/vdb
```

#### 创建挂载点：

在Docker的数据目录下创建挂载点,用于挂载硬盘分区。

```
sudo mkdir -p /trasen
```

#### 挂载硬盘分区：

使用mount命令将格式化的硬盘分区挂载到创建的挂载点。

```
sudo mount /dev/vdb /trasen
```

#### 设置挂载自动化

可以在/etc/fstab文件中设置启动时自动挂载,避免每次重启后手动挂载。

```
blkid /dev/vdb
# 输出结果
/dev/sdb: UUID="xxx-xxx" TYPE="ext4"
# 编辑文件
vim /etc/fstab
#添加如下内容
UUID=f51c5584-1d66-487e-be2d-3442b9bb058e /trasen    ext4    defaults    1 2
```


---

# 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://qiangrens-organization.gitbook.io/qkd90/fu-wu-qi-yun-wei-he-ce-shi/linux-fu-wu-qi/linux-ci-pan-gua-zai.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.
