# VPS添加swap

创建1G的swap，可以根据你的服务器配置来调整大小

```
dd if=/dev/zero of=/mnt/swap bs=1M count=1024  
```

设置权限

```
chmod 600 /mnt/swap
```

设置交换分区文件

```
mkswap /mnt/swap
```

启动swap

```
swapon /mnt/swap
```

设置开机时自启用 swap 分区

需要修改文件`/etc/fstab`中的 `swap` 行，添加 `/mnt/swap swap swap defaults 0 0`

[原文链接](http://doc.ewomail.com/docs/ewomail/install)


---

# 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://book.linh.eu.org/jian-zhan-ji-shu/vps-tian-jia-swap.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.
