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 use a file as a Swap partition

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

Share

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

This article will explain in detail how to use the file as a Swap partition, the content of the article is of high quality, so the editor will share it for you as a reference. I hope you will have a certain understanding of the relevant knowledge after reading this article.

Use a file as a Swap partition

1. Create a file to be a swap partition: increase the 1GB size of the swap partition, and the command is written as follows, where the count is equal to the number of blocks you want (bs*count= file size).

# dd if=/dev/zero of=/root/swapfile bs=1M count=1024

two。 Format to swap partition file:

# mkswap / root/swapfile # build the file system of swap

3. Enable swapping partition files:

# swapon / root/swapfile # enable swap files

4. To enable the system to power on itself, add a line to the file / etc/fstab:

/ root/swapfile swap swap defaults 0 0

On how to use the file as a Swap partition to share here, I hope the above content can be of some help to you, can learn more knowledge. If you think the article is good, you can share it for more people to see.

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