Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to increase swap Space by Linux

2025-01-20 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly shows you how to increase swap space in Linux. The content is simple and easy to understand. It is clearly organized. I hope it can help you solve your doubts. Let Xiaobian lead you to study and learn this article "How to increase swap space in Linux".

The following operations are performed under root:

0. Record the size of the original swap partition and view it with free -m.

1. First, create a partition, using dd command, such as

dd if=/dev/zero of=/home/swap bs=1024 count=512000

Note: This creates a partition file called/home/swap. The size of the file is 512000 blocks. Generally, 1 block is 1K, so the space here is 512M.

2. Then turn this partition into a swap partition.

/sbin/mkswap /home/swap

3. Then use this swap partition. Make it valid.

/sbin/swapon /home/swap

4. Modify the/etc/fstab file to change the newly added swap partition to autostart and add the following line

vi /etc/fstab

/home/swap swap swap defaults 0 0

5. Use free -m to see if swap increases

That's all for "How Linux Increases Swap Space." Thanks for reading! I believe that everyone has a certain understanding, hope to share the content to help everyone, if you still want to learn more knowledge, welcome to pay attention to the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report